| الاستدعاء | الوظيفة |
|---|---|
| درجة | تعيد قراءة حالتها. |
| حتى تصل إلى وضعية سميتها | |
| resume(stepId, data) | يُعد خطوة إنسانية في انتظارك |
| Tr reth | يديره مرة أخرى من خطوة، حفظ ما جاء قبل ذلك. |
| إلغاء () | -يوقفه |
ما الذي تحتفظ به البيانات
run.data;
// {
// id, workflowId, status: "running" | "waiting" | "succeeded" | "failed" | "cancelled",
// input: { … },
// steps: [{ id, type, status, output, credits, error, warnings, attempts, startedAt, endedAt }],
// credits, startedAt, endedAt
// }run.data
# {
# "id", "workflowId", "status": "running" | "waiting" | "succeeded" | "failed" | "cancelled",
# "input": {…},
# "steps": [{"id", "type", "status", "output", "credits", "error", "warnings", "attempts", "startedAt", "endedAt"}],
# "credits", "startedAt", "endedAt"
# }ألف - الحالات الخمسة
| الوضع | المعنى | ما يمكنك فعله |
|---|---|---|
running | قيد التنفيذ. | cancel() |
waiting | وتوقفت عند خطوة بشرية | resume() · cancel() |
succeeded | تم الانتهاء. | — |
failed | خطوة واحدة فاشلة. | retry() |
cancelled | -مُنَهَضَةٌ. | — |
كل طريقة تحديث الجسم
refresh(), resume(), retry() and cancel() all replace data with what came back and return the same instance — so a reference you hold stays current.
إنها مجرد لقطة حتى تُنْقِلها
فالركض على المنصة دون ان يخبركم : قراءة البيانات مرتين دون ان تُنعش تعطي الجواب نفسه .