| 调用 | 功能 |
|---|---|
| ( 刷新) | 重新读取状态。 |
| 等待( 选项) | 投票直到达到你命名的状态 |
| (stepID, 数据) | 批准等待人类一步 |
| 重试( stepId) | 保持以前的一切 继续往前走 |
| (取消) | 停止它。 停止它。 停止它。 |
哪些数据
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() 和 cancel() 全部替换 data 与那些回来的回信 和同样的事例—— 所以你认为的参考 保持时尚。
简单一点,再刷新
数据是任何上次返回的调用。在平台上运行的移动没有告诉你—— 两次阅读数据而不更新会给出相同的答案。