# workflow

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

`workflow({ action, id?, definition?, input?, run?, step?, data? })`

The account's workflows: build one, run it, follow it, approve a human step. Reading is free; everything that changes or starts something is asked, even in auto.

Status: read, or storage · 12 actions · read the docs first

## The actions {#actions}

| Free (read) | Asked (storage) |
| --- | --- |
| `list` · `get` · `runs` · `run_status` | `create` · `update` · `delete` |
| `test_step` — before saving a chain | `run` · `resume` · `retry` · `cancel` |

## It is told to read the docs first {#docs-first}

`iagenify_docs { topic: "workflows" }` before writing a definition — step ids, the template syntax and what each step type outputs are in it. A definition invented from memory fails validation.

## A definition travels as JSON text {#json-text}

```javascript
workflow({
  action: "create",
  definition: '{"name":"Triage","trigger":{"type":"manual"},"steps":[{"id":"draft","type":"model.generate","config":{…}}]}',
})
```

## A run keeps going after the answer {#following}

> **run_status is how it follows one**
>
> Starting a run returns its id and the run continues on its own. The agent checks back with run_status rather than waiting — a run that outlives the conversation is the point of a workflow.

## A human step is yours to approve {#human}

`resume` approves a waiting step, and the tool's description says plainly that the user decides, not the agent — ask them first.

## test_step before saving {#test}

Runs one step alone. Cheaper than deploying a chain to find out that the third step was wrong.

- [Workflow definition](/sdk/workflows): What a definition looks like.
- [api.workflows](/sdk/ref/workflows): Doing it from code.
- [Agent tools](/sdk/agent/tools): The 35, by family.

```python
# The Python workflow tool lists, reads and runs; creating one is done from your code
workflow = api.workflows.create({
    "name": "Triage",
    "trigger": {"type": "manual"},
    "steps": [{"id": "draft", "type": "model.generate", "config": {}}],
})
# The model then calls: workflow {"action": "run", "workflow_id": workflow.id}
```
