Polling a Sume agent run: next_action values and backoff
Poll Sume runs by branching on next_action (poll_status, retry_later, none), using status_url and result_url, backing off on 429 and 503.

Poll a Sume agent run on status_url and branch on next_action, not on the status string. poll_status means keep waiting with backoff, retry_later means the run was skipped because another was active, and none means the run is terminal and there is nothing more to fetch. These three values are the full set on schedule runs, and Agent Completions use the same rule: poll until next_action is not poll_status.
The values
| next_action | When | What to do |
|---|---|---|
poll_status | queued or processing | Poll again after a backoff delay |
retry_later | skipped | Another run was active; start the run again later |
none | completed, failed, canceled | Stop. On failure read error and output_error on the receipt |
Use the URLs the receipt gives you
Each receipt carries status_url, result_url and cancel_url, and the docs ask you not to build URLs yourself. status_url returns a trimmed payload meant for loops: id, status, started_at, finished_at, next_action and cancelable.
result_url returns the full receipt only after the run is terminal. While the run is queued or processing it answers 409 run_not_completed with the current status in details.status, so do not treat that 409 as a failure.
Backoff, not a fixed sleep
Video runs take minutes, and long host videos usually take 15 to 30 minutes, so polling every second buys nothing and spends your read budget. The docs recommend exponential backoff in production. A 429 or 503 during a poll loop is temporary: the run and its spend continue, so wait for retry-after and carry on instead of cancelling.
A short poll loop is enough. Call status_url, stop when next_action is not poll_status, sleep with exponential backoff and jitter between calls, and cap the total wait with your own deadline. When the deadline passes, cancel through cancel_url only if the run is still cancelable, and then poll status_url until the status reads canceled.
What the receipt tells you at the end
Do not parse the status_url body for the result. It is trimmed on purpose. Fetch result_url once, after the run is terminal, and log the request_id with your own job id so a support question can be answered from one line.
status:completed,failed,canceledor (for schedules)skipped.outputandoutput_error: checkoutput_errorbefore you readoutput. A projection failure on an API run is a run failure.usage: generation spend against the cap. It isnullwhen Sume could not read the spend, which is different from0.request_id: log it.
Prefer a webhook, keep the poll as a backup
A run webhook removes the loop. It fires once when the run completes or fails, and a canceled or skipped run sends nothing, which is exactly when a poll still helps. After you cancel, poll status_url until payload.status is canceled, and do not wait for a POST that will not arrive.
Sources
Related posts
More in Agents
- Scheduled or Format API: does the clock or your user start the run?
A Sume Scheduled run fires on a cron; a Format run fires when your backend calls it. Same agent, same receipt, new trigger. How to choose without dupes.
- script_run or bulk runs: where to fan out 20 ad variants
script_run fans out three or more Sume tool calls inside one 55-second request; bulk runs queue up to 100 Format runs for hours. Limits and a rule of thumb.
- Three ways to run the Sume video agent from code
Format runs, Scheduled runs and Agent Completions all start the same Sume agent. Pick by how often your task changes, then read the receipt the same way.
- A video agent run takes 15 to 30 minutes: design the waiting
Long-form video from an agent is minutes of work, not seconds. Email-me-when-ready, saved drafts and honest limits for a Sume Format run in your product.
Written by Sume