API reference › WorkStreams
Advance a Paused or Awaiting-Approval Workstream Run
POST/api/v1/skills/workstream.advance/invoke
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.
Body parameters
cycle_idstring · uuid or stringRequired
The cycle to advance (UUID or permakey).
actionenumRequired
What to do:
approve_task: mark the task intask_idapproved; the run moves on.skip_step: skip the current step.pause: halt the run in-place.resume: continue a previously paused run.
approve_taskskip_steppauseresume
task_idstring · uuid
Required for
approve_task. The task being approved.reasonstring
Audit trail. Recommended for skip_step.
idempotency_keystring
Caller-supplied stable token. Replaying within 24h returns the same outcome rather than re-applying the action.
Returns
Skill executed successfully
skillstringRequired
Example workstream_advance
outputobjectRequired
Cycle state after the action lands.
output.stub_fieldsarray of strings
output.warningsarray of strings
output.cycle_idstring · uuid
The cycle the action was applied to.
output.run_idstring · uuidDeprecated
output.statusenum · default running
Lifecycle state after the action.
runningpausedawaiting_approvalcompletedcancelledfailed
output.current_stepstring · default
Slug of the currently-executing step.
output.next_stepstring
Slug of the next step (None on terminal states).
output.errorstringDeprecated
output.error_envelope
Canonical structured error. Populated when the action could not be applied.
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.advance/invoke \ -X POST \ -H "Authorization: Bearer sk_..." \ -H "Content-Type: application/json" \ -d '{ "cycle_id": null, "action": "approve_task", "task_id": null, "reason": null, "idempotency_key": null }'
from heyarchie import Archie archie = Archie(api_key="sk_...") result = archie.skills.invoke( "workstream.advance", cycle_id=None, action="approve_task", task_id=None, reason=None, idempotency_key=None, ) print(result)
import { Archie } from "heyarchie";
const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workstream.advance", {
"cycle_id": null,
"action": "approve_task",
"task_id": null,
"reason": null,
"idempotency_key": null
});
console.log(result);Response
{
"skill": "workstream_advance",
"output": {
"current_step": "post_accruals",
"cycle_id": "b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94",
"next_step": "final_review",
"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.