Talk with Archie
API reference › WorkStreams
API reference › WorkStreams

Cancel a Running Workstream Run

POST/api/v1/skills/workstream.cancel/invoke
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.
Body parameters
cycle_idstring · uuid or stringRequired
The cycle to cancel (UUID or permakey). Identified by cycle_id from workstream_run.
reasonstring
Audit trail. Strongly recommended.
idempotency_keystring
Caller-supplied stable token. Replaying within 24h returns the same cancellation result rather than erroring on the already-cancelled cycle.
Returns

Skill executed successfully

skillstringRequired
Example workstream_cancel
outputobjectRequired
Cycle state after cancellation.
output.stub_fieldsarray of strings
output.warningsarray of strings
output.cycle_idstring · uuid
The cycle that was cancelled.
output.run_idstring · uuidDeprecated
output.statusenum · default cancelled
cancelled on success; failed if the cancel signal could not be delivered.
cancelledfailed
output.errorstringDeprecated
output.error_envelope
Canonical structured error. Populated when status == 'failed'.
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALIDAuthentication required
403PERMISSION.CAPABILITY_DENIEDInsufficient permissions
404SKILL.NOT_FOUNDSkill not found
422VALIDATION.INVALID_FORMATValidation error
429RATE_LIMIT.USERRate limit exceeded
5XXINTERNAL.UNKNOWNInternal server error
curl https://uk.heyarchie.com/api/v1/skills/workstream.cancel/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "cycle_id": null,
       "reason": null,
       "idempotency_key": null
     }'
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.cancel",
    cycle_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.cancel", {
  "cycle_id": null,
  "reason": null,
  "idempotency_key": null
});
console.log(result);
Response
{
  "skill": "workstream_cancel",
  "output": {
    "cycle_id": "b7d4e2a1-9c3f-4e58-a6b2-1f0d3c5e7a94",
    "status": "cancelled"
  },
  "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.