Workflow

Overview

A saved workflow: run it, list its runs, test one step, change it, delete it.

5 methodsdata holds the definitionupdate revalidates
Using Python?

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

CallDoes
run({ input })Starts a run and returns it.
runs()Its run history.
runStep(id, context)Runs one step alone, changing nothing.
update(patch)Changes it. Revalidated whole.
destroy()Deletes it.
idstring

Its identifier.

dataobject

The definition: name, trigger, steps, edges.

The usual sequence

const workflow = await api.workflows.create(definition);

await workflow.runStep("write", { input: { since: "2026-10-01" } });   // try one step
const run = await workflow.run({ input: { since: "2026-10-01" } });    // then the chain
await run.wait();
workflow = api.workflows.create(definition)

workflow.run_step("write", input={"since": "2026-10-01"})   # try one step
run = workflow.run(input={"since": "2026-10-01"})           # then the chain
run.wait()
Test a step before deploying a chain

runStep() runs one step with whatever context you give it and changes no run. It is far cheaper than discovering at the fifth step that the second one produced the wrong shape.

The object updates itself

update() replaces data on the object with what came back, so the instance you hold stays current.