# get()

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

`api.workflows.get(id) → Promise<Workflow>`

One workflow by its identifier, with its definition and its methods.

Status: GET /api/workflows/:id · free · 404 if unknown

```javascript
const workflow = await api.workflows.get(id);

console.log(workflow.data.name);
console.log(workflow.data.steps.map((s) => `${s.id} (${s.type})`));

const run = await workflow.run({ input: { since: "2026-10-01" } });
```

## What data carries {#data}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string |  | Its name. |
| `trigger` | object |  | `{ type: "manual" \| "cron" \| "webhook" \| "mail", … }`. |
| `steps` | array |  | Every step with its `id`, `type`, `name` and `config`. |
| `edges` | array |  | `{ from, to, branch }`. `__trigger` is the start. |

## Reading before changing {#editing}

```javascript
const workflow = await api.workflows.get(id);

await workflow.update({
  steps: workflow.data.steps.map((step) =>
    step.id === "write" ? { ...step, config: { ...step.config, model: "gemini-3.1-pro" } } : step),
});
```

`update()` validates the whole definition again, so sending the steps back changed is the safe shape — there is no patch of a single step.

## Errors {#errors}

An unknown identifier answers 404. A workflow belongs to its account and nothing else can reach it.

- [update()](/sdk/ref/workflow/update): Changing it.
- [run()](/sdk/ref/workflow/run): Starting it.

```python
workflow = api.workflows.get(workflow_id)

print(workflow.data["name"])
print([f"{s['id']} ({s['type']})" for s in workflow.data["steps"]])

run = workflow.run(input={"since": "2026-10-01"})
```

```python
workflow = api.workflows.get(workflow_id)

workflow.update(steps=[
    {**step, "config": {**step["config"], "model": "gemini-3.1-pro"}} if step["id"] == "write" else step
    for step in workflow.data["steps"]
])
```
