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{}يتحول إلى ناتج الخطوة، يمكن قراءته من قبل بقية السلسلة.
لماذا توجد خطوات بشرية
هناك تدفق للعمل مع لا أحد يراقب، لذا لا يمكن سؤال هؤلاء الثلاثة عنهم أثناء التشغيل. الموافقة مطلوبة في الرسم البياني بدلاً من ذلك، و التعريف بدونه يرفض عندما يتم حفظه.
البيانات جزء من السلسلة
ليس مجرد نعم. يمكن للمستعرض أن يغير سطر الموضوع، يختار المتلقي، يختار فرعاً - والخطوات بعد قراءته تلك القيم من خلال قوالب، نفس ناتج أي خطوة أخرى.
// 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 | لا خطوة من هذا القبيل في هذا المسعى. |
يمكن الموافقة عليها من أي مكان
تحصل علىRunR(RR(ed) يعطي كائن تشغيل كامل من محدد الهوية وحده - لذلك واجهة الموافقة لا تحتاج إلا إلى هوية.