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.

Use script_run when an agent needs many small Sume tool calls in one turn, such as 20 tts_create or generate_image submits, and use a bulk run when each unit is a whole Format run that takes minutes. script_run is bounded by one request of at most 55 seconds, so it submits jobs and returns their ids. A bulk queue holds up to 100 Format runs on the server.
Both are programmatic fan-out, but they sit at different layers, and mixing them up is the usual reason a batch dies halfway.
What each one is
script_run is programmatic tool calling on the Sume MCP server. The agent writes a short JavaScript body that calls other Sume tools in a loop and returns one value, and the intermediate results stay out of the conversation. A bulk run is POST /v1/formats/{handle}/{slug}/bulk-runs, a server-side queue of ordinary Format runs.
| Limit | script_run | Bulk run |
|---|---|---|
| Unit of work | One tool call (a job submit) | One Format run (a whole agent turn) |
| Wall clock | timeout_seconds 5 to 55, default 45 | Queue drains until every item is terminal |
| Size | max_calls default 32, ceiling 64 | 1 to 100 items |
| Paid calls | max_paid_calls default 16, ceiling 32 | Per-item generation_spend_cap_usd |
| Parallelism | 4 calls in flight, 8 call starts per second | concurrency 1 to 16 |
| Result | Value plus a journal of calls and child job ids | Queue receipt with counts and per-item run_id |
The script_run rules that bite
- A budget stop ends the run with
script_timeout,script_call_budget_exceeded,script_paid_budget_exceededorscript_tool_forbidden, and the journal is still complete. - Paid creates inside a script still need their own distinct
idempotency_key, for example one per loop index. - Do not wait for long jobs inside the script. Submit, return the job ids, then
jobs_waitandjobs_resultoutside it. - Discovery tools and
script_runitself are refused inside a script.
The bulk rules that bite
- The queue has no webhook. Put
communication.webhook_urlon each item, or pollstatus_url. - Queue
completedmeans every item is terminal, not that every item succeeded. Checkcounts.failed. - A bad item fails the create with
400anddetails.indexbefore any queue exists. - Mint a fresh
Idempotency-Keyper batch, because a replayed key returns the old queue.
A rule of thumb for 20 variants
If the 20 variants are 20 stills or 20 voice lines, fan out inside one script_run and wait for the jobs afterwards. If each variant is a finished video from a saved Format, queue them as 20 bulk items with concurrency at 3 or 4, and give every item a cap. The second path is the one that survives a closed laptop.
Mixed designs work too. An agent can use script_run to submit twenty cheap stills, wait for them outside the script, pick six, and then hand those six to a Format run or a bulk queue for motion. The two limits then protect different things: the script budget bounds the fan-out of the first step, and the per-item cap bounds the cost of the second.
Sources
Related posts
More in Agents
- 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.
- Run a weekly short video series on autopilot with a Sume schedule
A weekly short-video series needs a schedule with a cron expression, an IANA timezone and a spend cap, plus an optional API trigger. How to set it up on Sume.
- Run the Sume video agent from your backend with Agent Completions
POST /v1/agent/completions runs the same agent as the Sume Agents chat, with tools and media generation, and returns an async run receipt you poll or webhook.
Written by Sume