Workflows

Build durable graphs from code, agents, waits, and human decisions.

Define explicit steps and branches, run bounded JavaScript or start an agent inside a step, persist waits, and pause for human input or exact-call approval.

Workflow model

A workflow is a saved graph, not just a trigger.

Each run follows explicit steps and branches. A step can execute deterministic JavaScript, start or poll an agent, return a durable wait, or pause for a person. Triggers decide when the graph starts; grants and approvals still decide what its tool calls may do.

Start

Captured trigger input

Manual, schedule, or matching event.

Deterministic step

Run bounded JavaScript

Transform, call a granted tool, or select a declared branch.

Open-ended step

Start and poll an agent

Persist the agent run id and resume from its result.

Continue

Route to the next step

Pass saved output into a declared branch.

Pause

Wait for time, a person, or approval

Persist the pause, then resume the graph with evidence.

Saved definition

Inspect the workflow before it runs.

The workflow view keeps the job, starting signal, recent runs, and scoped grants together before you inspect the graph or start another run.

Incident response workflow showing an enabled incident.created event trigger, three recent runs, and three scoped grants with one Ask rule
The saved view shows the job, start signal, recent runs, and external authority its steps receive.

What each run preserves

Keep each run recoverable and inspectable.

The run stores the definition and access-policy snapshot it started with, commits progress between graph steps, and keeps outputs, waits, approvals, and linked agent sessions inspectable.

Snapshot

Freeze what this run is executing.

The run keeps its workflow definition, trigger input, and access-policy snapshot even if the saved workflow changes later.

Progress

Commit between durable boundaries.

Successful graph steps and waits persist before the next step begins, so recovery resumes from saved state instead of one long process.

Evidence

Keep the run inspectable.

Inputs, outputs, step state, waits, linked agent sessions, approvals, artifacts, and failures stay attached to the run.

Examples

Workflow shapes that use the same durable building blocks.

1A JavaScript step classifies an event, routes it to an agent investigation, then waits for the result.
2An agent proposes an external update; the exact tool call pauses for approval before the graph continues.
3A polling step returns a durable wait and resumes later without keeping JavaScript or an agent loop alive.

Create a workflow

Choose the signal, describe what should happen, and inspect the saved definition.

Start manually, on a schedule, or from a supported event. The workflow-building agent can validate and save the definition before you enable or run it.

Create a workflowRead workflow docs