Flows: chaining steps that don't need a brain
A flow is a sequence of steps that runs on a schedule or a trigger, mostly deterministic, with an AI step or two mixed in. Think of it as plumbing.
Flows vs. agents (again)
A flow is the boring, reliable cousin of an agent. It doesn't decide anything at a high level — you decided everything when you drew the flow. AI shows up as a step: "classify this email," "summarize this doc," "draft this reply." The flow itself is just Python or a visual boxes-and-arrows canvas.
You know the exact sequence. You need predictability. You have a schedule or a trigger event (new email, new file, cron). You want to ship in an hour, not a week.
Where you can build flows
| Tool | Character | Good for |
|---|---|---|
| n8n (open source) | Visual, self-hostable, developer-friendly | Serious internal automation. Deploy on your own server. Free. |
| Make | Visual, powerful, cloud-only | Rich UI, great for complex branching. Paid. |
| Zapier | Visual, simplest, most integrations | Quick wins, non-technical teammates. Paid. |
| Perplexity Computer cron | Natural-language scheduled tasks | "Every Monday at 8am, summarize new RFPs in my inbox." Zero setup. |
| Cloudflare Workers | Code, cheap, global edge | Custom logic you fully control. Runs on the network we already use. |
Case study: inbound-lead intake flow
Trigger: a new email to hello@your-company.com. Same pattern works for a design agency, a real-estate broker, a plumbing contractor, or a small SaaS.
Build it in n8n (visual)
n8n is a free, open-source visual flow builder. You can self-host it on a Cloudflare tunnel or run it locally. The above flow, in n8n, is roughly:
- Gmail Trigger node — polls every 5 min for new mail to
hello@. - OpenAI / Anthropic node — prompt classifies to
NEW_LEAD | EXISTING_CLIENT | SPAM, returns JSON. - Switch node — routes based on the classification.
- NEW_LEAD branch: OpenAI node extracts
{client, budget, deadline}→ Notion node creates a CRM card → OpenAI node drafts a reply → Gmail node saves as draft. - EXISTING_CLIENT branch: Gmail node adds a label, sends Slack ping to
#projects. - SPAM branch: Gmail node moves to archive.
Total time to build once you have n8n running: 30–45 minutes. Total lines of code: zero.
Build it in Cloudflare Workers (code)
Because you already deploy on Cloudflare, here's the same flow as a Worker triggered by Gmail push:
TypeScript · Cloudflare Workerexport default {
async fetch(request, env, ctx) {
const email = await request.json();
// 1. Classify with a cheap model
const cls = await classify(email, env);
if (cls === "SPAM") return new Response("ok");
// 2. Route
if (cls === "NEW_LEAD") {
const details = await extractLeadDetails(email, env);
await createNotionCard(details, env);
const draft = await draftReply(email, details, env);
await saveGmailDraft(draft, env);
} else if (cls === "EXISTING_CLIENT") {
await labelEmail(email.id, "active-project", env);
await pingSlack("#projects", email, env);
}
return new Response("ok");
}
};
async function classify(email, env) {
const res = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${env.OPENAI_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-5-mini",
messages: [
{ role: "system", content: "Classify to NEW_LEAD, EXISTING_CLIENT, or SPAM. Reply one word." },
{ role: "user", content: `Subject: ${email.subject}\n\n${email.body}` }
],
temperature: 0
})
});
const json = await res.json();
return json.choices[0].message.content.trim();
}
Deploy with wrangler deploy. The whole thing runs at the edge, no server to maintain, roughly $0.30/month at your volume.
The simplest flow: a scheduled task in Computer
You don't need n8n or a Worker for many flows. In Perplexity Computer, you can just say:
"Every weekday at 8am, check my inbox for new emails, classify each as NEW_LEAD / EXISTING_CLIENT / SPAM, and send me a Slack summary to #inbox-triage with a link to each. Don't reply automatically."
That's a real cron job. It writes the schedule, wires the connectors, and runs while you sleep. We'll build one properly in Module 8.
Pick one flow and specify it fully
Choose a repetitive task from your business. Draft the flow before touching any tool:
- Trigger: what starts it? (new email, new Drive file, cron, form submit)
- Steps: list every step as a verb — "classify," "extract," "draft," "notify."
- AI steps: mark which ones need an LLM.
- Data at each step: what's the input, what's the output?
- Failure modes: what if the LLM returns junk? What if the API is down?
Save this spec. In Module 8 we'll actually build it.