System Sketch

Automating everything with Flue

Fred
FredCreator of Flue
Jilles
JillesDeveloper Educator, Cloudflare
Oct 20 · 11–11:45 AM PDT · System Sketch

In 45 minutes, you'll sketch an agent that kills one of your chores.

…and if we're fast, we'll build one live.

What eats your week?

Hands up. The winners go on the board.

A
Inbox

Triage & replies

Sorting, answering, following up.

B
Code

PRs & issues

Reviews, labels, release notes.

C
Reports

Digests & status

Summaries nobody wants to write.

D
Support

Questions & tickets

The same answer, for the tenth time.

Something else? Shout it out.

An agent is not just a chatbot.

Wakes up on its own
Thinks
Acts with tools
Remembers
Cron job

Runs on time. Doesn't think.

✓
—
✓
—
Chatbot

Thinks. Forgets. Waits for you.

—
✓
—
—
Workflow

Durable steps. Fixed path.

✓
—
✓
✓
Agent

All four, working toward a goal.

✓
✓
✓
✓

Every agent has the same five parts.

01

Trigger

What wakes it up?

  • Email Workers
  • Cron Triggers
  • Queues
  • Webhooks
Channels, flue run
02

Brain

Which model thinks?

  • Workers AI
  • AI Gateway
Any LLM, useModel
03

Hands

What can it touch?

  • Sandboxes
  • Browser Rendering
  • MCP
  • Bindings
Tools, skills, subagents
04

Memory

What does it remember?

  • Durable Objects
  • D1
  • KV
  • R2
Persistent state, durable sessions
05

Voice

Where does the result land?

  • Email sending
  • Webhooks
Slack, GitHub, Discord…
Cloudflare primitiveFlue feature

Agents are just functions.

agents/assistant.tsFLUE
export function MyAssistant() {
  const [count, setCount] = usePersistentState('count', 0);
  useAgentStart(() => setCount((n) => n + 1));
  useModel('moonshot/kimi-k2');
  return `You are a helpful assistant. This conversation has ${count} messages.`;
}
04 · Memory

usePersistentState

01 · Trigger

useAgentStart

02 · Brain

useModel

Run & call it

flue run ./agents/assistant.ts
POST /agents/assistant/:id

Two agents we actually run.

Jilles · Cloudflare Changelog Digest

The changelog, read for me.

Cron→Ingest→Classify→Summarize→Email
Trigger
Cloudflare Cron Trigger
Brain
Workers AI
Hands
Fetch + classify changelog entries
Memory
SQLite: every stage persists, retries never redo work
Voice
An email digest
Fred · Flue

Fred's story

TBD: ask Fred

Agents can't die when the server goes down.

Let's pull the plug.

$ flue run ./agents/digest.ts
› step 3/5 · summarizing…
✕ process killed
$ flue run ./agents/digest.ts
✓ session resumed at step 3/5
01Accepted work is never lost
02Interrupted sessions resume automatically
03Clients reconnect without starting over

Pick a chore. We'll sketch it together.

Starter A

Inbox triage

TriggerEmail Worker
BrainWorkers AI
HandsClassify, draft a reply
MemoryDurable Object per sender
VoiceEmail reply, Slack ping
Starter B

PR reviewer

TriggerGitHub webhook
BrainAny LLM via AI Gateway
HandsSandbox: clone, run tests
MemoryA session per PR
VoiceGitHub comment
Starter C

Monday digest

TriggerCron Trigger
BrainWorkers AI
HandsFetch sources, summarize
MemoryD1 or a Durable Object
VoiceEmail or Slack
Stretch goal

From sketch to deployed in 10 minutes.

Read https://flueframework.com/start.md then help create my first agent...

Copy prompt
01 · Both

Pick a sketch

The simplest sketch from the board.

02 · Fred

Write the agent

Paste the prompt, shape it with Flue.

03 · Jilles

Wire & deploy

Trigger, bindings, then ship to Workers.

Cloudflare gives you the primitives.
Flue gives you the agent.

01

Trigger

02

Brain

03

Hands

04

Memory

05

Voice

Agents are just functions.

What you can do now.

01Copy the prompt"Read https://flueframework.com/start.md then help create my first agent..."
02Read the docshttps://flueframework.com/docs/guide/getting-started/
03Deploy on Cloudflarehttps://flueframework.com/docs/ecosystem/deploy/cloudflare/
04Take your sketch homeBoard export: link TBD

Your feedback is important.

Complete the session survey in the Cloudflare Events app.

01Open the app
02Tap the bell
03Tap "Survey"
NOW 00:00
← → navigate · click a step to reveal
NEXT
NOTES