Workflow definition

Overview

A name, a trigger, steps and the edges between them. Everything that can be checked is checked when you save it — because a workflow fails where nobody is watching.

30 steps23 typesvalidated on save
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

{
  name: "Weekly digest",
  trigger: { type: "cron", cron: "0 8 * * 1" },
  steps: [
    { id: "read",  type: "storage.query",  config: { … } },
    { id: "write", type: "model.generate", config: { … } },
  ],
  edges: [
    { from: "__trigger", to: "read" },
    { from: "read", to: "write" },
  ],
}
{
    "name": "Weekly digest",
    "trigger": {"type": "cron", "cron": "0 8 * * 1"},
    "steps": [
        {"id": "read", "type": "storage.query", "config": {}},
        {"id": "write", "type": "model.generate", "config": {}},
    ],
    "edges": [
        {"from": "__trigger", "to": "read"},
        {"from": "read", "to": "write"},
    ],
}
namestringrequired

What it is called.

triggerobjectrequired

manual · cron · webhook · mail.

stepsarrayrequired

One to 30 steps.

edgesarray

The graph. Absent means the order of steps is the chain.

Step identifiers

A letter, then letters, digits, underscores or dashes, 40 characters at most, unique in the workflow. They are what templates and edges name, so they are worth choosing readably: draft, approve, send.

Templates

WrittenReads
{{input.since}}The run's input.
{{steps.read.output.result}}An upstream step's output.

A reference to a step the workflow does not hold, or to one that is not upstream, is refused when the workflow is saved — see Errors.

Three step types require a human step

mail.send, hosting.deploy and domain.records

Each one acts outside the account, and a run has nobody to ask. A human step must be upstream on the path that reaches it — and a definition without one is refused when you save it.

The rest of this branch