# resume()

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

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

Approves a waiting human step and lets the chain continue. What you pass becomes that step's output, so the rest of the chain can read it.

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 | required | The waiting step. |
| `data` | object | {} | Becomes the step's output, readable by the rest of the chain. |

## Why human steps exist {#why}

> **Sending, publishing and writing DNS require one upstream**
>
> A workflow runs with nobody watching, so those three cannot be asked about during the run. The approval is required in the graph instead, and a definition without it is refused when it is saved.

## The data is part of the chain {#data}

It is not just a yes. A reviewer can change a subject line, pick a recipient, choose a branch — and the steps after it read those values through templates, the same as any other step's output.

```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 {#errors}

| Code | When |
| --- | --- |
| run_not_waiting | The run is not stopped at a human step. |
| step_not_found | No such step in this run. |

## It can be approved from anywhere {#anywhere}

[getRun(runId)](/sdk/ref/workflows/get-run) gives a full run object from the identifier alone — so an approval interface needs nothing but the id.

- [human](/sdk/workflows/steps/human): The step.
- [wait()](/sdk/ref/workflow-run/wait): Noticing that one is waiting.

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