# WorkStreams

> WorkStream templates, Workplans (a template bound to a client), Cycles (executions), and Tasks. Inline and containerized execution modes share this…

WorkStream templates, Workplans (a template bound to a client), Cycles (executions), and Tasks. Inline and containerized execution modes share this surface. Replaces the retired playbooks API.

## Operations

POST [Advance a Paused or Awaiting-Approval Workstream Run](https://heyarchie.com/en-gb/developers/api-reference/workstreams/advance-a-paused-or-awaiting-approval-workstream-run/)

Moves a paused or awaiting-approval cycle forward, so an accountant can approve a task, skip a step, pause or resume the work. It needs the cycle_id and the action to take, plus the task_id when approving a task, and a person is asked to confirm before Archie acts on it. It returns the cycle_id, its status and its current and next step.

POST [Cancel a Running Workstream Run](https://heyarchie.com/en-gb/developers/api-reference/workstreams/cancel-a-running-workstream-run/)

Stops a workstream cycle that is running, so an accountant can halt work that was started by mistake or is no longer needed. It needs the cycle_id and accepts an optional reason that is kept in the audit trail, and a person is asked to confirm before Archie cancels the cycle. It returns the cycle_id and its status, which is cancelled on success.

POST [Delete a Workstream](https://heyarchie.com/en-gb/developers/api-reference/workstreams/delete-a-workstream/)

Removes a workstream from listings, so an accountant can retire a process that is no longer used. It needs the workstream_id and confirm set to true, and a person is asked to confirm before Archie deletes anything. It refuses while a cycle of the workstream is still in progress, and it returns the workstream_id, whether it was deleted and its status.

POST [Describe a Workstream by Id, Slug, or Permakey](https://heyarchie.com/en-gb/developers/api-reference/workstreams/describe-a-workstream-by-id-slug-or-permakey/)

Shows the full definition of one workstream, so an accountant can check what it does before running it. It needs the workstream_id, which can be a UUID, a slug or the seven-character permakey. It returns the name, status and execution mode, the inputs a run needs and the number of steps.

POST [Duplicate a Workstream](https://heyarchie.com/en-gb/developers/api-reference/workstreams/duplicate-a-workstream/)

Copies a workstream into a new draft, so an accountant can adapt a trusted process for another client or period without touching the original. It needs the workstream_id to copy and accepts an optional new_name. It returns the identifier, permakey and name of the new copy.

POST [List Workstreams Visible to the Caller](https://heyarchie.com/en-gb/developers/api-reference/workstreams/list-workstreams-visible-to-the-caller/)

Lists the workstreams you can see, so an accountant can find the right one to run or review. It needs no inputs, but you can narrow the list by authoring scope or lifecycle status and page through it with a cursor. It returns one summary row per workstream with its id, permakey, name, execution mode and status, plus a total count.

POST [Start a Workstream Run](https://heyarchie.com/en-gb/developers/api-reference/workstreams/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 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.

POST [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/)

Reports where a workstream cycle has got to, so an accountant can check progress without opening the workstream. It needs the cycle_id returned when the cycle was started, or its seven-character permakey. It returns the status of the cycle, its current and next step and an approximate percentage complete.

POST [Update a Workstream's Metadata](https://heyarchie.com/en-gb/developers/api-reference/workstreams/update-a-workstreams-metadata/)

Renames a workstream or changes its description, so an accountant can keep a shared process tidy without rebuilding it. It needs the workstream_id plus whichever of the name, description, steps or schemas you want to change, and only the fields you send are updated. It returns the workstream's identifier, permakey, name and status. Cycles already running are not affected.

Endpoints

[POST /api/v1/skills/workstream.advance/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/advance-a-paused-or-awaiting-approval-workstream-run/)[POST /api/v1/skills/workstream.cancel/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/cancel-a-running-workstream-run/)[POST /api/v1/skills/workstream.delete/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/delete-a-workstream/)[POST /api/v1/skills/workstream.describe/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/describe-a-workstream-by-id-slug-or-permakey/)[POST /api/v1/skills/workstream.duplicate/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/duplicate-a-workstream/)[POST /api/v1/skills/workstream.list/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/list-workstreams-visible-to-the-caller/)[POST /api/v1/skills/workstream.run/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/start-a-workstream-run/)[POST /api/v1/skills/workstream.status/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/get-the-current-status-of-a-workstream-run/)[POST /api/v1/skills/workstream.update/invoke](https://heyarchie.com/en-gb/developers/api-reference/workstreams/update-a-workstreams-metadata/)
