Skip to main content
A flow is a server-run, multi-step automation built from a template. Where an execution runs one action, a flow chains several steps — tool calls, data transforms, timed waits, and human approval gates — while ClawLink persists state between them. Flows are useful when work spans multiple actions or needs to pause for approval. Each step is one of four types: tool_call, transform, wait, or approval.

Lifecycle

A flow moves through these statuses:
waiting means the flow has paused — typically on an approval step, or a wait until a timestamp. You advance it with approve or resume.

List templates

Flows are template-based. Discover the available templates and their keys:

Start a flow

POST /api/flows/start
string
required
A template key from /api/flows/templates.
object
default:"{}"
Template inputs. For example, summarize_unread_gmail accepts optional query (a Gmail search, default is:unread), maxResults (1–20), and gmailConnectionId. gmail_to_notion_task_sync additionally requires notionParent.
string
default:"manual"
One of agent, manual, webhook, schedule. Records how the flow was started.
The response includes the new flowId, the full flow (record + steps), and the templates list:

Get a flow

GET /api/flows/{id} returns the current { flow, steps }. Poll it to watch progress.
Each step record carries stepKey, stepIndex, stepType, status, input, output, error, attemptCount, and timestamps — so you can see exactly where a flow is and what each step produced.

List your flows

GET /api/flows?limit=30 (max 100) returns { flows: [...] }, most recent first.

Approve a step

When a flow is waiting on an approval step (e.g. gmail_to_notion_task_sync pauses before creating Notion pages), approve it to continue: POST /api/flows/{id}/approve
string
The approval step to approve. Optional — omit to approve the current waiting step.
Returns the updated { flow, steps }.

Resume

POST /api/flows/{id}/resume re-drives a flow that is waiting (e.g. its wait timestamp has passed) or retries one that failed. Returns the updated { flow, steps }.

Cancel

POST /api/flows/{id}/cancel stops a flow and sets its status to cancelled. Returns the updated { flow, steps }.
All flow endpoints return 404 {"error":"Flow not found"} for an unknown id or a flow that belongs to another account.