const runs = await workflow.runs();
for (const run of runs) {
console.log(run.id, run.data.status, run.data.startedAt);
}
const waiting = runs.filter((r) => r.data.status === "waiting");runs = workflow.runs()
for run in runs:
print(run.id, run.data["status"], run.data.get("startedAt"))
waiting = [r for r in runs if r.data["status"] == "waiting"]The statuses
| status | Means |
|---|---|
running | In progress. |
waiting | Stopped at a human step. Nothing moves until it is resumed. |
succeeded | Finished. |
failed | A step failed. |
cancelled | Cancelled. |
Finding what needs a person
for (const run of await workflow.runs()) {
if (run.data.status !== "waiting") continue;
const step = run.data.steps.find((s) => s.status === "waiting");
console.log(run.id, step.id, step.config?.title);
}for run in workflow.runs():
if run.data["status"] != "waiting":
continue
step = next(s for s in run.data["steps"] if s["status"] == "waiting")
print(run.id, step["id"], (step.get("config") or {}).get("title"))A waiting run waits indefinitely
There is no timeout on a human step. That is deliberate — an approval that expired on its own would let a chain stall with nobody told. Listing the waiting runs is how an interface builds an inbox.
Deleting a workflow leaves its runs
The history is kept. Reach a run by its identifier with getRun() even after the workflow is gone.