Skip to main content
POST
/
agent_run
/
{run_id}
/
resume
Resume Agent Run
curl --request POST \
  --url https://api.example.com/agent_run/{run_id}/resume
Resumes a failed or cancelled run by re-queueing eligible runtime nodes. Trigger/source nodes are excluded from resume.

Request

curl -X POST "https://api.mosaic.so/agent_run/[run_id]/resume" \
  -H "Authorization: Bearer mk_your_api_key"

Response

{
  "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 failed or cancelled
  • 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:
  1. Detect credit-blocking via GET /agent_run/{run_id} (needs_credits: true) and/or GET /agent_run/{run_id}/nodes (nodes[].needs_credits: true).
  2. Check the current plan with GET /plan.
  3. 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 at checkout_url, then re-check GET /plan.
  4. Optionally enable auto top-ups with POST /credits/settings (eligible plans only: creator, creator_annual, professional, professional_annual).
  5. Call POST /agent_run/{run_id}/resume to re-queue eligible failed/blocked runtime nodes.