# Overview

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

A saved workflow: run it, list its runs, test one step, change it, delete it.

Status: 5 methods · data holds the definition · update revalidates

| Call | Does |
| --- | --- |
| [run({ input })](/sdk/ref/workflow/run) | Starts a run and returns it. |
| [runs()](/sdk/ref/workflow/runs) | Its run history. |
| [runStep(id, context)](/sdk/ref/workflow/run-step) | Runs one step alone, changing nothing. |
| [update(patch)](/sdk/ref/workflow/update) | Changes it. Revalidated whole. |
| [destroy()](/sdk/ref/workflow/destroy) | Deletes it. |

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `id` | string |  | Its identifier. |
| `data` | object |  | The definition: `name`, `trigger`, `steps`, `edges`. |

## The usual sequence {#lifecycle}

```javascript
const workflow = await api.workflows.create(definition);

await workflow.runStep("write", { input: { since: "2026-10-01" } });   // try one step
const run = await workflow.run({ input: { since: "2026-10-01" } });    // then the chain
await run.wait();
```

> **Test a step before deploying a chain**
>
> runStep() runs one step with whatever context you give it and changes no run. It is far cheaper than discovering at the fifth step that the second one produced the wrong shape.

## The object updates itself {#mutation}

`update()` replaces `data` on the object with what came back, so the instance you hold stays current.

- [Workflow definition](/sdk/workflows): What a definition holds, and what is refused.
- [WorkflowRun](/sdk/ref/workflow-run): Following, approving, retrying.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
workflow = api.workflows.create(definition)

workflow.run_step("write", input={"since": "2026-10-01"})   # try one step
run = workflow.run(input={"since": "2026-10-01"})           # then the chain
run.wait()
```
