工作流程流动

resume()

run.resume(stepId, data) → Promise<WorkflowRun>

批准等待人类一步,让链条继续。通过的东西成为该一步的输出, 其余的链条可以读取它。

the approvaldata becomes outputrun_not_waiting
Using Python?

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

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) 获取运行 仅从标识符中给出一个完整运行对象,所以一个批准接口除了身份识别码以外,不需要任何东西。