Skip to content
Proud to collaborate with Microsoft for Startups

queue.claim-next ​

Lease the next eligible queue item in FIFO order. Skips partition keys that already have an active item and owners at their concurrency cap. Returns claimed=false when nothing is eligible.

Lease the next eligible item for a queue, respecting per-key exclusivity.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-queue
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuidstringYes——
queue_namestringYes——
lease_secondsintegerNo——
max_active_per_ownerintegerNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
claimedbooleanNo——
itemjsonNo——
item_uuidstringNo——
claim_tokenstringNo——
targetjsonNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_layerstringNo——
failed_stepstringNo——
errorstringNo——
error_typestringNo——
reasonstringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeAccepted
completedNoYesYes—Completed
failedNoYesNo—Failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedRun the queue operation
* (any state)failfailedMark failed

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "queue.claim-next",
  "initial_data": {
    "organization_uuid": "value",
    "queue_name": "value"
  }
}