transitionTask
mutation · in the family Task
What it does
Move a task through its life — take it, complete it, cancel it, or pull a postponed one back now.
Fire ONE declared caller transition on a Task: start · unstart · complete · cancel · unpostpone. postpone is the ONE bespoke exception — it carries its own returnAt argument, so it rides the postponeTask mutation (realized.bespokeTransitionOps). Deny-by-default: an op whose edge is not declared from the task's current state refuses CONFLICT/FSM_TRANSITION_INVALID; requires the unrestricted capability + the record's current revision. The optional reason rides the transition events — and on a note-minted task every transition auto-appends ONE reply note under the origin root (the narrative law: the transition word + the reason verbatim, authored by the acting user; the scheduled return speaks as createdBy). Terminal transitions remove the task's user/team book rows in the same txn (the inbox self-prunes); postpone prunes them too (parking means quiet — the REF row stays), and the return re-mints them. Template class (hand-derived v29).
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Work and notes — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows
api:transitionTask
Careful
Completed and cancelled are endpoints — reopen means a new task.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
revision | ID ID! | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
op | TaskTransitionOp TaskTransitionOp! | yes | One of the values of [TaskTransitionOp](/types/TaskTransitionOp/). |
reason | String | no |
Concurrency
Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.
Returns
Task Task! — The CsCase chassis reused: caption required (the subject line) + its OWN description field (≤8192 — the task's brief; the conversation is the generic Note thread at note#<taskId>, addNote/notes). priority ∈ {low, normal, high, urgent} (its OWN canned registry — kit-stamped 'normal' when unnamed). createdBy is server-stamped (immutable); reportTo names WHO the work reports to. Assignment is multi: assigneeUserIds ≤8 + teamIds ≤4 (in-tenant + active at set) — each holds a write-once taskbook inbox row while the task lives (terminal transitions remove user/team rows in the same txn: the inbox self-prunes, bounded by open work). labelIds ≤16 (TaskLabel — the work vocabulary). constructRefs ≤16 {type,id} bind live domain constructs ref-only (the CsCase @375 law: validated in-tenant + non-doomed at write, NO doom arms grow, a purged target renders as a tombstone; each holds a taskbook#REF row while the task is non-doomed — the tasksByConstruct lane). dueAt: overdue = computed at read (dueAt < now ∧ live; + the dueBefore filter) — NO sweep lane in v1. 'blocked' is deliberately NOT a state — it is a label (no machine consequence in v1). Searchable by caption. The ops event domain (at.ops.task.* — the facility→ops neighborhood).
Example request
mutation ExampleTransitionTask($id: ID!, $revision: ID!, $op: TaskTransitionOp!, $reason: String) {
transitionTask(id: $id, revision: $revision, op: $op, reason: $reason) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
description
priority
createdBy
systemOrigin
reportTo
assigneeUserIds
teamIds
labelIds
dueAt
overdue
linkedFromTaskId
returnAt
originNoteId
originAnchorType
originAnchorId
}
}Variables:
{
"id": "01900000-0000-7000-8000-76ef3d8c0000",
"revision": "01900000-0000-7000-8000-b7960e180000",
"op": "start",
"reason": "Correcting a miscount."
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"transitionTask": {
"id": "01900000-0000-7000-8000-76ef3d8c0000",
"sysId": "TK-EXMP-0000-000F",
"type": "Task",
"caption": "Blue jeans",
"status": "in_progress",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"description": "Straight-cut, mid-rise, five pockets.",
"priority": "<priority>",
"createdBy": "01900000-0000-7000-8000-0b14e5a60000",
"systemOrigin": "<system origin>",
"reportTo": "01900000-0000-7000-8000-9d69c9660000",
"assigneeUserIds": [
"01900000-0000-7000-8000-d459f84d0000"
],
"teamIds": [
"01900000-0000-7000-8000-2329c92c0000"
],
"labelIds": [
"01900000-0000-7000-8000-9eccf29d0000"
],
"dueAt": "2027-01-31T00:00:00.000Z",
"overdue": true,
"linkedFromTaskId": "01900000-0000-7000-8000-7e29bd050000",
"returnAt": "2027-01-31T00:00:00.000Z",
"originNoteId": "01900000-0000-7000-8000-1dba181f0000",
"originAnchorType": "<origin anchor type>",
"originAnchorId": "01900000-0000-7000-8000-093379960000"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)