# Start a Workstream Run

> Starts a cycle of a workstream for a client and period, so an accountant can launch a repeatable piece of work from one request. It needs the…

POST /api/v1/skills/workstream.run/invoke

Starts a cycle of a workstream for a client and period, so an accountant can launch a repeatable piece of work from one request. It needs the workstream_id and optionally takes a client_id, a period, runtime variables and an idempotency key, and a person is asked to confirm before Archie starts the cycle. It returns the cycle_id, its status and execution mode, and links for following progress live and opening the cycle.

Body parameters

workstream_id string Required

UUID, slug, or 7-char permakey. The adapter resolves it.

Example 7f3c8d9e-1a2b-4c5d-8e6f-901234567890

client_id string · uuid

Client to run against. Optional for client-agnostic workstreams.

period string

Period label (e.g., 'FY26-Q1', '2026-04').

runtime_vars object

Runtime overrides for the workstream's declared inputs. Keys are input names from `WorkstreamDescribeOutput.inputs_required`; values are JSON-typed (string, number, boolean, array, object, null).

idempotency_key string

Caller-supplied stable token (≤200 chars). When the same key is replayed within 24h the API returns the original cycle id rather than starting a duplicate run. Strongly recommended for any automated retry loop.

Returns

Skill executed successfully

skill string Required

Example workstream_run

output object Required

Pointer to the new cycle + URLs the caller can use to monitor / open it.

The canonical noun is `cycle` (Workstream → Blueprint → Cycle → Task). The legacy `run_id` field is kept populated alongside `cycle_id` for backwards compat with SDK consumers; new code should read `cycle_id` and treat `run_id` as deprecated.

output.stub_fields array of strings

output.warnings array of strings

output.cycle_id string · uuid

The cycle id of the launched workstream cycle.

output.run_id string · uuid Deprecated

output.status enum · default pending

pending running awaiting_approval

output.execution_mode enum · default inline

inline containerized

output.query_id string

output.events_url string · default

output.detail_url string · default

output.error string Deprecated

output.error_envelope

Canonical structured error. Set when the cycle failed to start (workstream not found, validation, FGA denied, rate limited, etc.). The legacy `error` string is populated alongside it for back-compat.

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← List Workstreams Visible to the Caller](https://heyarchie.com/en-gb/developers/api-reference/workstreams/list-workstreams-visible-to-the-caller/)[Next Get the Current Status of a Workstream Run →](https://heyarchie.com/en-gb/developers/api-reference/workstreams/get-the-current-status-of-a-workstream-run/)

```
curl https://uk.heyarchie.com/api/v1/skills/workstream.run/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "workstream_id": "7f3c8d9e-1a2b-4c5d-8e6f-901234567890",
       "client_id": null,
       "period": "FY26-Q1",
       "runtime_vars": {},
       "idempotency_key": "close-2026-04-acme-001"
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.run",
    workstream_id="7f3c8d9e-1a2b-4c5d-8e6f-901234567890",
    client_id=None,
    period="FY26-Q1",
    runtime_vars={},
    idempotency_key="close-2026-04-acme-001",
)
print(result)
```

```
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workstream.run", {
  "workstream_id": "7f3c8d9e-1a2b-4c5d-8e6f-901234567890",
  "client_id": null,
  "period": "FY26-Q1",
  "runtime_vars": {},
  "idempotency_key": "close-2026-04-acme-001"
});
console.log(result);
```

Response

```
{
  "skill": "workstream_run",
  "output": {
    "cycle_id": "b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94",
    "detail_url": "/workstream-studio/runs/ws-b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94",
    "events_url": "/api/v1/workstreams/cycles/b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94/events",
    "execution_mode": "inline",
    "query_id": "ws-b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94",
    "status": "running"
  },
  "correlation_id": "<string>"
}
```

```
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
