const step = run.data.steps.find((s) => s.status === "waiting");
await run.resume(step.id, { approved: true, note: "Checked the figures." });
// Downstream steps can read {{steps.<id>.output.approved}}step = next(s for s in run.data["steps"] if s["status"] == "waiting")
run.resume(step["id"], {"approved": True, "note": "Checked the figures."})
# Downstream steps can read {{steps.<id>.output.approved}}stepIdstring必填等待的一步。
dataobject{}成为该阶梯的输出, 由链条的其余部分可以读取 。
人类的脚步为何存在
发送、出版和写作 DNS 需要一个上游
工作流程运行时无人观看, 因此在运行过程中无法询问这三个问题。 图表中需要批准, 而保存时拒绝定义, 但没有定义则拒绝 。
数据是链链的一部分
它不仅仅是一个是。 审评员可以改变主题行、选择收件人、选择分支 — — 以及从模板读取这些值之后的步骤,与任何其他步骤的输出一样。
// The human step
{ id: "approve", type: "human", config: { title: "Send this?" } }
// A step after it
{ id: "send", type: "mail.send", config: {
box: "ops@example.com",
to: "{{steps.approve.output.recipient}}",
subject: "{{steps.approve.output.subject}}",
text: "{{steps.draft.output.text}}" } }# The human step
{"id": "approve", "type": "human", "config": {"title": "Send this?"}}
# A step after it
{"id": "send", "type": "mail.send", "config": {
"box": "ops@example.com",
"to": "{{steps.approve.output.recipient}}",
"subject": "{{steps.approve.output.subject}}",
"text": "{{steps.draft.output.text}}"}}错误
| 代码 | 触发条件 |
|---|---|
| run_not_waiting | 跑步不是在人类的一步上停止的 |
| step_not_found | 本次运行中没有这样的步。 |
不论从何处批准,均可以批准
raun( runId) 获取运行 仅从标识符中给出一个完整运行对象,所以一个批准接口除了身份识别码以外,不需要任何东西。