Connect the steps. Keep a person where one belongs.
A flow puts scripts in order on a canvas, with branches, loops and steps that wait for someone to decide. It remembers where it is after every step, so a restart never loses a run. And it's a file in your repository, so the canvas and the code never disagree.
- several triggers per flow
- approvals
- survives restarts
- retry from a step
Draw it, try it, ship it.
-
1Draw
Add steps from the palette and join them by dragging. Each step's form is drawn from what it runs, and scripts, flows and events are picked from what the workspace has.
-
2Try
Run the saved draft beside the canvas and watch each step's result. Start from any step, and the steps before it keep what an earlier run did.
-
3Ship
Deploy the draft, then promote the same bundle to production. Runs already going finish on the version they started with.
What a flow is made of.
A small set of steps that combine well, and your own scripts for everything else.
| Step | What it does |
|---|---|
| Triggers | By hand, on a schedule, from a webhook, from an event, or from a form the platform serves. A flow can have several, each starting its own branch. |
| Script | Runs one of your scripts, with its input written from the trigger and earlier steps. The step can hand it a connection, a table or an event for this run only. |
| Set | Works out values with short expressions, for the steps after it. |
| Branch | Takes the first case that's true, or "otherwise". |
| For each | Runs a script or a flow per item, so many at a time. Stops at the first failure, or carries on and marks the failed items. |
| Join and delay | Waits for every path that can still arrive, or waits a set time. |
| Approval | Pauses until someone in the named groups or roles decides, with a timeout. Rejecting or timing out takes the step's error path. |
| Sub-flow | Runs another flow and waits for it. Which flow can be chosen by the data, from a list you allow. |
| Answer and fail | Answers the webhook that started the flow, or stops the flow on purpose with a message. |
Five ready-made steps come with every instance: an HTTP request, send an email, read rows, write a row, and publish an event.
A flow remembers where it is.
An approval can wait three days. A deploy can happen in the middle. The run carries on from where it stopped either way.
- State is saved after every step, so a restart of the control plane or a worker loses nothing.
- A step that finished is never started again. A script step's idempotency key comes from the run, the step and the item.
- Retry a failed run from the step that failed. If a fix has been promoted since, the retry can run on it, as long as every step it keeps is unchanged.
Drawn on a canvas, kept as a file.
What you draw is saved as a definition like this one, and what you write is drawn. Steps pass data with plain references and a small expression language that can't run away or reach anything.
- Expressions read the trigger, earlier steps' output, and the item inside a loop.
- Each expression field shows what it gives against the latest run, as you type.
- Moving a step on the canvas changes no version and no behaviour.
- The build checks the graph: every step reachable, no cycles, every script and flow it names there.
export const review = defineFlow({
path: "requests/review",
nodes: {
submitted: trigger.event(requestSubmitted),
by_hand: trigger.manual({ input: RequestInput }),
route: step.branch({ small: "trigger.kind in ['calculator', 'charger']" }),
ask: step.approval("Lend a device", {
timeoutSeconds: 3 * 24 * 3600,
approvers: { groups: ["tech-desk"] },
}),
approve: step.script(decideRequest, { input: "{'decision': 'approve', …}" }),
deny: step.script(decideRequest, { input: "{'decision': 'deny', …}" }),
},
edges: [
["submitted", "route"], ["by_hand", "route"],
["route", "approve", { when: "small" }],
["route", "ask", { when: "otherwise" }],
["ask", "approve"],
["ask", "deny", { error: true }],
],
}); Shortened from the higher-education example. A rejection, or nobody deciding in three days, denies the request.
Where a flow meets people and other systems.
- Approvals people can answer
- In the workspace's queue, or from a link in an email. A rejection needs a comment, and both are kept under the person's name.
- Listed where it matters
- An approval belongs to its workspace. A step can also list it on the tenant's page, for a decision that matters beyond one team.
- Webhooks that check who sent them
- An HMAC signature checked before anything starts, in the formats GitHub, Shopify and Slack use. A failed check is answered 401.
- Answer the caller
- Hold the request open for up to 25 seconds and answer it from inside the flow, with a status, headers and a body.
- Forms as a way in
- Up to thirty fields of seven plain types, served as a page of the tenant's portal to anyone with the address, or only to people signed in.
- Started by an agent
- A flow with a manual trigger is a tool over MCP. Its input schema is what the agent is shown, and what's checked when it calls.
- Schedules that don't pile up
- In the workspace's time zone or one you name. A time is skipped while the last run from that schedule is still going, unless you allow it.
- Tagged from the start
- A trigger can tag the run it starts from what it was given, such as an order's number, so the run can be found by it.
Every run, step by step.
A flow's run is the graph with each step's status on it. Choose a step to see its input, its output, its error and the script run behind it.
- Steps that never ran are marked as skipped, not left blank.
- Retry from the failed step, or from the start with new input.
Related
Draw the first flow.
Start from a script you already have, and add the steps around it.