workflow_claim
Atomically claim a workflow for exclusive processing. Only succeeds if the workflow is in 'created' status; otherwise returns a reason for failure.
Instructions
Atomically claim a workflow for this agent.
Only succeeds if the workflow is in 'created' status. If two agents call this concurrently for the same run_id, exactly one will succeed.
After claiming, call workflow_checkpoint() as each step completes. If this agent crashes, use workflow_discover() + workflow_claim() from a replacement agent to resume — the sidecar preserves all checkpoint state.
Returns claimed=False with a reason if the workflow is already taken or does not exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | ||
| agent_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | ||
| run_id | Yes | ||
| claimed | Yes | ||
| agent_id | No |