# runStep()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/workflow/run-step/
Language: zh

`workflow.runStep(stepId, { fromRun?, input?, steps? }) → Promise<Step>`

单步运行, 由您选择上下文 。 没有创建运行, 没有运行被改变 。 这是在部署链之前尝试一步的方法 。

Status: changes nothing · 16 minutes · human steps are refused

```javascript
const step = await workflow.runStep("write", {
  input: { since: "2026-10-01" },
  steps: { read: { output: { result: [{ title: "…" }] } } },
});

console.log(step.status, step.output, step.credits);
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `stepId` | string | 必填 | 哪个步骤? |
| `fromRun` | string |  | 将现有流程的上游产出取而代之。 |
| `input` | object |  | 运行输入。 覆盖 `fromRun`. . . . . . . |
| `steps` | object |  | 手工提供的产出。 **赢过这些 `fromRun`.** |

## 提供背景的三种方式 {#context}

| 你有过 | 使用使用 |
| --- | --- |
| 跑得这么远的跑步 | `fromRun` |
| 运行, 但您想要不同的输入 | `fromRun` 和 `input` |
| 什么都没有——你在建立这一步 | `steps`,与您所期望的形状 |

## 返回值 {#returns}

```javascript
{
  id: "write", type: "model.generate", status: "succeeded",
  output: { text: "…", usage: { credits: 4 } },
  credits: 4,
  startedAt: "…", endedAt: "…",
  error: "", warnings: []
}
```

## 真的很运行 {#real}

> **具有效果的步骤具有这种效果**
>
> 存储写作、 部署部署、 邮件步骤发送。 只有运行记录没有被保存 。 测试计算步骤, 而不是操作步骤 , 或者指向可一次性的 。

## 人不能走脚步 {#human}

答案是: `step_not_executable` - 没有什么可以执行,只有某种批准。未知的识别答案 `step_not_found`.

## 16分钟 16分钟 {#timeout}

代理职级或 HTTP 步骤需要很长时间,所以这一呼吁使客户通常的上限大大高于该上限,而不是放弃仍在运行的工作。

- [工作流步骤](/zh/sdk/workflows/steps): 全部 23 种类型。
- [run()](/zh/sdk/ref/workflow/run): 整个链条

```python
step = workflow.run_step(
    "write",
    input={"since": "2026-10-01"},
    steps={"read": {"output": {"result": [{"title": "…"}]}}},
)

print(step["status"], step["output"], step["credits"])
```

```python
{
    "id": "write", "type": "model.generate", "status": "succeeded",
    "output": {"text": "…", "usage": {"credits": 4}},
    "credits": 4,
    "startedAt": "…", "endedAt": "…",
    "error": "", "warnings": [],
}
```
