api.workflows

Overview

Chains of steps the platform runs on its own: a model call, an agent, a web fetch, an HTTP request, a human approval, mail, storage, a deploy. They outlive your process.

5 methods23 step types4 triggers
Using Python?

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

The difference from an agent is not what it can do but who is there. An agent runs while your process runs and asks you before anything irreversible. A workflow runs with nobody watching — so what it may do is decided when it is saved, not while it runs.

CallDoes
create(definition)Validates and saves it. Returns a Workflow.
list()Every workflow of the account.
get(id)One of them.
getRun(runId)A run, from its identifier alone.
const workflow = await api.workflows.create({
  name: "Weekly digest",
  trigger: { type: "cron", cron: "0 8 * * 1" },
  steps: [
    { id: "read",  type: "storage.query", config: { storage: "…", action: "find", collection: "posts" } },
    { id: "write", type: "model.generate", config: { model: "gemini-3.5-flash",
        prompt: "Summarise these in five lines: {{steps.read.output.result}}" } },
  ],
});

const run = await workflow.run({ input: { since: "2026-10-01" } });
await run.wait();
console.log(run.data.status);
workflow = api.workflows.create({
    "name": "Weekly digest",
    "trigger": {"type": "cron", "cron": "0 8 * * 1"},
    "steps": [
        {"id": "read", "type": "storage.query", "config": {"storage": "…", "action": "find", "collection": "posts"}},
        {"id": "write", "type": "model.generate", "config": {"model": "gemini-3.5-flash",
            "prompt": "Summarise these in five lines: {{steps.read.output.result}}"}},
    ],
})

run = workflow.run(input={"since": "2026-10-01"})
run.wait()
print(run.data["status"])

A graph, not a list

edges connects the steps — branches, parallel fan-outs, merges. Without it the order of steps is the chain, which is the simple case and stays supported.

What acts outside the account needs approval in the graph

Sending, publishing and writing DNS require a human step upstream

In a conversation those three are asked every time and no mode opens them. A workflow has nobody to ask — so the approval is required in the graph, and a definition without it is refused when you save it, where you can still read the message.

A run outlives everything

Starting one returns its identifier and the run continues on the platform. Your process can exit; getRun() picks it up later.

The bounds

ThingBound
Steps per workflow30
Loop iterations500
Loop concurrency10
A wait86 400 seconds — one day
Mail recipients5