---
title: "POST /workflow-runs/{run_id}/steps"
method: POST
path: "/workflow-runs/{run_id}/steps"
tags: ["Workflow Executor"]
---

# POST /workflow-runs/{run_id}/steps

`POST /workflow-runs/{run_id}/steps`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/workflow-runs/{run_id}/steps`
- Auth: HTTP bearer

## Path parameters

- `run_id` string, uuid, required

## Request body

- WorkflowStepWriteRequest: `POST /workflow-runs/{run_id}/steps` body: record one journal entry.
  - `attempts` integer, required: Attempts made so far, this one included.
  - `child` WorkflowChildStart, nullable: A child run a `child` entry starts. Temps records the entry `pending` with `{"run_id": ...}` and completes it with the child's [`child_result`] when the child finishes.
    - `input` object
    - `workflow` string, required: The child's workflow, in the same environment.
  - `duration_ms` integer, nullable
  - `error` string, nullable
  - `error_ref` string, nullable: Error-tracking event id of the attempt's exception.
  - `event` WorkflowEmittedEvent, nullable
    - `key` string, nullable
    - `name` string, required
    - `payload` object
  - `kind` 'step' | 'sleep' | 'wait' | 'now' | 'random' | 'send_event' | 'child', required: What a journal entry records.
  - `name` string, required
  - `result` object
  - `sequence` integer, required
  - `status` 'pending' | 'completed' | 'failed', required: A journal entry's state. `pending` is a sleep or wait not yet over, or a step whose failed attempt is waiting for its retry.
  - `trace_id` string, nullable: OTEL trace id of the attempt's span (metadata only).
  - `wake_at` string, date-time, nullable

## Response `200`

The entry as recorded; when already_recorded, continue with it

- WorkflowStepWriteResponse: The entry as Temps holds it after the write. When `already_recorded` is true, the executor must continue with this recorded value, not its own.
  - `already_recorded` boolean, required
  - `entry` WorkflowJournalEntry, required: One recorded journal entry as the executor replays it.
    - `attempts` integer, required
    - `error` string, nullable: The recorded error message (`failed`, or the last failed attempt).
    - `kind` 'step' | 'sleep' | 'wait' | 'now' | 'random' | 'send_event' | 'child', required: What a journal entry records.
    - `name` string, required
    - `result` object, required: The recorded result (`completed`), decrypted for the executor.
    - `sequence` integer, required
    - `status` 'pending' | 'completed' | 'failed', required: A journal entry's state. `pending` is a sleep or wait not yet over, or a step whose failed attempt is waiting for its retry.
    - `wake_at` string, date-time, nullable: A `sleep`'s wake time or a `wait`'s timeout.
  - `lease_expires_at` string, date-time, required

## Other responses

- `400`: Invalid entry
- `401`: Missing or invalid invocation token
- `404`: Run not found
- `409`: Stale lease, or the replay does not match the journal (WorkflowIncompatible)
- `413`: Result too large
- `429`: The run reached its step or journal-size quota

## Changes

- **2026-11-15** `188ea295ffc6`: 1 info
  - endpoint added
- **2026-11-15** `72c32d8dee65`: 1 breaking
  - api path removed without deprecation
- **2026-11-14** `101ef74660bc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/workflow-runs/:run_id/steps/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
