Resume Agent Run
Resume a failed or cancelled run.
Resumes a failed or cancelled run by re-queueing eligible runtime nodes. Trigger/source nodes are excluded from resume.
Request
bash
curl -X POST "https://api.mosaic.so/agent_run/[run_id]/resume" \
-H "Authorization: Bearer mk_your_api_key"Response
json
{
"success": true,
"run_id": "7f8d9c2b-4a6e-8b3f-1d5c-9e2f3a4b5c6d",
"agent_state_id": "7f8d9c2b-4a6e-8b3f-1d5c-9e2f3a4b5c6d",
"nodes_queued": 4,
"nodes_considered": 7,
"requeued_nodes": 4,
"requeued_node_tasks_detached": 4,
"requeued_node_active_tasks_cancelled": 1,
"requeued_node_active_tasks_total": 1
}Notes
- Run status must be
failedorcancelled - Resume only re-queues runtime nodes (
not_started,blocked,cancelled,failed) - Trigger node types are never resumed
- Existing trigger metadata is preserved, and resume metadata is appended
If the run cannot be resumed in its current state, Mosaic returns 409 with a detail message.
Credit-blocked runs (needs_credits)
Use this endpoint to continue runs that failed because of insufficient credits:
- Detect credit-blocking via
GET /agent_run/{run_id}(needs_credits: true) and/orGET /agent_run/{run_id}/nodes(nodes[].needs_credits: true). - Check the current plan with
GET /plan. - If you are on a free/no paid plan:
- List purchasable plans with
GET /plan/list. - Upgrade with
POST /plan/upgrade. - If upgrade returns
requires_checkout: true, complete checkout atcheckout_url, then re-checkGET /plan.
- List purchasable plans with
- Optionally enable auto top-ups with
POST /credits/settings(eligible plans only:creator,creator_annual,professional,professional_annual). - Call
POST /agent_run/{run_id}/resumeto re-queue eligible failed/blocked runtime nodes.