# resume()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/workflow-run/resume/
Language: zh

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

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

Status: the approval · data becomes output · run_not_waiting

```javascript
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}}
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `stepId` | string | 必填 | 等待的一步。 |
| `data` | object | {} | 成为该阶梯的输出, 由链条的其余部分可以读取 。 |

## 人类的脚步为何存在 {#why}

> **发送、出版和写作 DNS 需要一个上游**
>
> 工作流程运行时无人观看, 因此在运行过程中无法询问这三个问题。 图表中需要批准, 而保存时拒绝定义, 但没有定义则拒绝 。

## 数据是链链的一部分 {#data}

它不仅仅是一个是。 审评员可以改变主题行、选择收件人、选择分支 — — 以及从模板读取这些值之后的步骤,与任何其他步骤的输出一样。

```javascript
// 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}}" } }
```

## 错误 {#errors}

| 代码 | 触发条件 |
| --- | --- |
| run_not_waiting | 跑步不是在人类的一步上停止的 |
| step_not_found | 本次运行中没有这样的步。 |

## 不论从何处批准,均可以批准 {#anywhere}

[raun( runId) 获取运行](/zh/sdk/ref/workflows/get-run) 仅从标识符中给出一个完整运行对象,所以一个批准接口除了身份识别码以外,不需要任何东西。

- [人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人 人](/zh/sdk/workflows/steps/human): 一步。
- [wait()](/zh/sdk/ref/workflow-run/wait): 点着那一个在等待

```python
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}}
```

```python
# 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}}"}}
```
