api.workflows

getRun()

api.workflows.getRun(runId) → Promise<WorkflowRun>

仅仅从识别码上运行——不知道它属于哪个工作流程。

GET /api/workflows/runs/:idfreeno workflow needed
Using Python?

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

const run = await api.workflows.getRun(runId);

await run.wait();
console.log(run.data.status, run.data.steps.map((s) => `${s.id}: ${s.status}`));
run = api.workflows.get_run(run_id)

run.wait()
print(run.data["status"], [f"{s['id']}: {s['status']}" for s in run.data["steps"]])

设计目的

运行标识符通常是您仅有的全部

开始运行的有东西 —— 代理、网络钩、预定触发器—— 并发回了身份证明。 没有这个,你必须先知道工作流程,然后在列表中找到运行,这是你已经确认的事物的绕行。

跟踪整个进程

// One process starts it
const { id } = (await workflow.run({ input })).data;
await queue.push(id);

// Another, later, follows it
const run = await api.workflows.getRun(id);
await run.wait({ until: ["succeeded", "failed", "waiting"] });
# One process starts it
run_id = workflow.run(input=payload).id
queue.push(run_id)

# Another, later, follows it
run = api.workflows.get_run(run_id)
run.wait(until=["succeeded", "failed", "waiting"])

运行并不取决于两个进程: 它从开始那一刻起就在平台上 。

是一个完整的工作流程运行

refresh(), wait(), resume(), retry() 和 cancel() 所有的作品——所以人类的认可 可以从一个完全不同的地方 得到,与开始运行的地方完全不同的地方。