# resume()

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

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

Aproba un passo umano in attesa e lascia la catena continuare. Quello che passa diventa la saída del passo, per che il resto della catena puè lere.

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 | obrigatório | Il passo d'attesa. |
| `data` | object | {} | Divende la saída del paso, leggibile dal resto de la catena. |

## Por què i passus umanis existen {#why}

> **Enviando, publishing e scrivendo DNSnecessari un amont**
>
> Un flusso di lavoro corre con nessuno vigile, quindi non si puè interrogare di tre durante la run. L'aprobazion è richiesto nel grafo in lugar, e una definizion senza essa è negata quando è salvat.

## I dati fa parte della catena {#data}

Non è un simple si. Un revisor può cambiare una linea d'oggetto, scegliere un destinatario, scegliere una sucursal — e i passi dopo il legì i valori mediante template, ime di ogni altro passo di 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}}" } }
```

## Erros {#errors}

| Código | Quando |
| --- | --- |
| run_not_waiting | La corsa non è fermada a un pas umano. |
| step_not_found | Nessuna tassa in questa run. |

## Può essere approvat da n'importe da n'importe qualcun {#anywhere}

[getRun(runId)](/pt/sdk/ref/workflows/get-run) dà un oggetto full run del identificatore solo — quindi una interface di approvazione non ha bisogno di altro che del id.

- [humanos](/pt/sdk/workflows/steps/human): Il pas.
- [wait()](/pt/sdk/ref/workflow-run/wait): Noticindo che uno sta esperando.

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