Bulk run for an ad matrix: 3 hooks by 4 ratios in 12 queue items
Build a 3 by 4 creative matrix as one Sume bulk run: 12 items, concurrency 4, and an index-to-name map so every finished file has a clear label.

Twelve hook-by-ratio combinations fit comfortably in one bulk run, which accepts 1 to 100 items and a concurrency of 1 to 16. Submit them in a fixed order, derive each file's name from its index, and read each child's receipt for the result.
The shape of the queue
| Item | Value |
|---|---|
| Items per queue | 1 to 100 |
| Concurrency | 1 to 16 |
| Queue webhook | None; webhooks are per item |
completed | Every item is terminal, not all succeeded |
| Item order | Same as submitted; index is zero-based |
Build the matrix and the name map
Each item sends its hook and ratio as input, which is data the Format reads. The Format you call must be written to use those keys; acme/ad-matrix is a placeholder.
import itertools, os, uuid, requests
API = "https://api.sume.com"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
hooks = ["save-time", "cut-cost", "less-risk"]
ratios = ["1:1", "4:5", "2:3", "9:16"]
combos = list(itertools.product(hooks, ratios))
items = [{"instruction": f"Ad creative for hook {h}", "input": {"hook": h, "ratio": r}}
for h, r in combos]
r = requests.post(f"{API}/v1/formats/acme/ad-matrix/bulk-runs",
headers={**H, "Idempotency-Key": str(uuid.uuid4())},
json={"concurrency": 4, "items": items}, timeout=30)
r.raise_for_status()
q = r.json()["data"]
names = {i: f"{h}_{r.replace(':', 'x')}" for i, (h, r) in enumerate(combos)}
print(q["status_url"], len(names), "items")After the queue
Poll status_url until status is completed, branch on counts.failed, and read each run_id at GET /v1/format-runs/{run_id}. Retry only the failed indexes in a new queue with a fresh Idempotency-Key.
Sources
Related posts
More in Formats
- Same Idempotency-Key replay: bulk run answers 202, single run 200
Replaying a Format bulk-run create returns 202 and the original queue with no idempotency_hit flag. A single run returns 200 with idempotency_hit true.
- Same intro and outro on every Short: allowed on YouTube?
YouTube allows a repeated intro and outro if the rest differs. What that means for AI-made Shorts built on a fixed format, and how to vary the body.
- Cancel one bulk-run child: pay for what finished, slot moves on
Cancel a Format run inside a bulk queue with POST /v1/format-runs/{run_id}/cancel. The item turns canceled, its slot starts the next one, no webhook fires.
- Change a Format grant role: PATCH run to write and back
PATCH .../grants/{workspace} with {role} changes a pending or accepted grant. Raising to write applies on the next authoring call; lowering to run closes it now
Written by Sume