# 工作流程工作流程

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

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

账户的工作流程 : 构建一个账户, 运行它, 跟随它, 批准一个人的一步 。 阅读是免费的 ; 更改或启动的东西都要求, 甚至在自动中 。

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

## 操作 {#actions}

| 免费( 读) | 问(存储) |
| --- | --- |
| `list` · `get` · `runs` · `run_status` | `create` · `update` · `delete` |
| `test_step` - 在拯救链条之前 | `run` · `resume` · `retry` · `cancel` |

## 命令它先读完医生的书 {#docs-first}

`iagenify_docs { topic: "workflows" }` 在写入定义前先写入一个定义 - 步骤ids, 模板语法和其中每个步骤类型输出的内容。 从记忆中发明的定义失败验证 。

## 旅行的定义为: JSON 文字文字文字文字 {#json-text}

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

## 跑步不停地追寻答案 {#following}

> **run_status 其随后是如何的**
>
> 开始运行返回其 ID , 运行继续独立运行。 代理程序检查 run_status 而不是等待,比对话时间长的跑步是工作流程的要点。

## 人脚脚下,你可批准 {#human}

`resume` 工具的描述清楚说明用户决定而不是代理——先问他们。

## test_step 保存前 {#test}

单靠一步跑 便宜得比用链子 找出第三步错了

- [工作流定义](/zh/sdk/workflows): 定义是什么样子的?
- [api.workflows](/zh/sdk/ref/workflows): 做它从代码。
- [智能体工具](/zh/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}
```
