Task lifecycle
The statuses of a task, the transitions that move it between them and what each transition checks or changes, including the output validation on complete.
A task moves through a small state machine. Every move is a named transition: you never set the status by hand, you ask for a transition and Sommatic AI checks that it is allowed from the current status.
Statuses
| Status | Meaning |
|---|---|
queued | Created, waiting for an assignee or a claim. |
assigned | Assigned to a user or a group. |
claimed | A specific person took ownership. |
in_progress | The person is working on it. |
completed | The output was provided and validated. |
rejected | Concluded as rejected. |
invalidated | No longer applicable (cancelled or replaced). |
expired | Its deadline passed. |
Transitions
| Transition | From | To |
|---|---|---|
assign | queued | assigned (claimed when the assignee is a user) |
claim | queued, assigned | claimed |
start | claimed | in_progress |
complete | queued, assigned, claimed, in_progress | completed |
reject | queued, assigned, claimed, in_progress | rejected |
invalidate | queued, assigned, claimed, in_progress | invalidated |
expire | queued, assigned, claimed, in_progress | expired |
restart | completed, rejected, invalidated | queued |
A transition that is not allowed from the current status fails with
Transition '<name>' not allowed from status '<status>'. GET /work-management/task/transitions returns this table.
What each transition does
assignsetsassigneefrom the payload. When the assignee is a user, the task is also claimed by that user and goes straight toclaimed.claimsetsownership(is_claimed,claimed_by,claimed_at) and, whenclaimed_byis given, makes that person the assignee.completevalidatesoutputsagainstrequired_output.schemaand saves them. Every field listed inrequiredmust be present and not empty, or the transition fails withCannot complete task: missing required outputs: <fields>.rejectsavesoutputs. Put the reason there (for exampleoutputs.reason), which the portal shows on rejected tasks.completeandrejecton a task nobody claimed: when the payload carriesclaimed_by, that person becomes the claimant and the assignee.restartreturns the task toqueued, clears its ownership and empties itsoutputs.
A task created with a user assignee starts in claimed, so it can be worked right away.
Call a transition
PATCH /work-management/task/transition/ with the task id, the transition_name and an optional payload.
curl -X PATCH https://api.sommatic.ai/work-management/task/transition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<task-id>",
"transition_name": "complete",
"payload": {
"outputs": { "decision": "approved", "reason": "Within policy." }
}
}'curl -X PATCH https://api.sommatic.ai/work-management/task/transition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<task-id>",
"transition_name": "claim",
"payload": {
"claimed_by": { "id": "<user-identity>", "name": "Ana Ruiz" }
}
}'curl -X PATCH https://api.sommatic.ai/work-management/task/transition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<task-id>",
"transition_name": "assign",
"payload": {
"assignee": { "assignee_type": "group", "group": { "id": "<group-id>", "name": "Supervisors" } }
}
}'The answer is the updated task in the standard envelope.
Read tasks
GET /work-management/task/:queryselector with:
| Selector | Returns |
|---|---|
id | One task (?search=<task-id>). |
inbox | The tasks of a person. |
all, list | Tasks with pagination and filters. |
statuses, types, priorities, transitions | The catalogs on this page. |