Workflows
Durable workflow execution
Build complex, long-running workflows that survive failures. Each step is tracked, with automatic retries and the ability to resume from where you left off.
Workflow Executions
Recent Executions
Workflow executions (auto-refreshes every 5 seconds)
| ID | Status | Steps | Duration | Started | |
|---|---|---|---|---|---|
| exec_a1b2c3... | Completed | 4/4 | 2.3s | 1/15/2024, 10:30:00 AM | View |
| exec_d4e5f6... | Running | 2/4 | - | 1/15/2024, 10:29:45 AM | View |
| exec_g7h8i9... | Completed | 4/4 | 1.9s | 1/15/2024, 10:25:00 AM | View |
| exec_j0k1l2... | Failed | 3/4 | 5.4s | 1/15/2024, 10:20:00 AM | View |
| exec_m3n4o5... | Cancelled | 1/4 | 450ms | 1/15/2024, 10:15:00 AM | View |
Key Features
Durable Execution
Workflows survive server restarts and failures automatically.
Step Tracking
Monitor progress with detailed step-by-step execution logs.
Automatic Retries
Failed steps are automatically retried with exponential backoff.
Manual Triggers
Start workflows manually or automatically from events.
Workflow Definition
Define multi-step workflows with automatic durability.
src/index.ts
export default {
async fetch(request, env) {
const { executionId } = await env.FLOW
.trigger({ userId: "123" });
return Response.json({ executionId });
},
workflows: {
async onboarding({ input, step }) {
await step.run("welcome", async () => {
return { sent: true };
});
},
},
};