API reference › WorkStreams
Start a Workstream Run
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_idstringRequired
UUID, slug, or 7-char permakey. The adapter resolves it.
Example 7f3c8d9e-1a2b-4c5d-8e6f-901234567890
client_idstring · uuid
Client to run against. Optional for client-agnostic workstreams.
periodstring
Period label (e.g., 'FY26-Q1', '2026-04').
runtime_varsobject
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_keystring
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
skillstringRequired
Example workstream_run
outputobjectRequired
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_fieldsarray of strings
output.warningsarray of strings
output.cycle_idstring · uuid
The cycle id of the launched workstream cycle.
output.run_idstring · uuidDeprecated
output.statusenum · default pending
pendingrunningawaiting_approval
output.execution_modeenum · default inline
inlinecontainerized
output.query_idstring
output.events_urlstring · default
output.detail_urlstring · default
output.errorstringDeprecated
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_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALID Authentication required
403PERMISSION.CAPABILITY_DENIED Insufficient permissions
404SKILL.NOT_FOUND Skill not found
422VALIDATION.INVALID_FORMAT Validation error
429RATE_LIMIT.USER Rate limit exceeded
5XXINTERNAL.UNKNOWN Internal server error
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>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"retry_after_seconds": "<integer>"
}
}{
"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.