Price-drop sale videos for 200 SKUs: two bulk queues, one key each
A bulk queue holds at most 100 items. For 200 marked-down SKUs, send two queues, give each its own Idempotency-Key, and track both queue ids yourself.

You cannot put 200 items in one Sume bulk queue. The items array takes 1 to 100 entries, so a 200-SKU markdown event is two POST .../bulk-runs calls, each with its own Idempotency-Key.
Split the list, not the Format
Both queues call the same Format. The docs say the scope of an idempotency key is one Format, and that a replay of a spent key returns 202 with the old queue. If you reuse one key for the second half with a different payload, the API answers 409 idempotency_conflict and details.queue_id names the first queue. So mint one key per chunk, and store it next to the chunk before you send.
import os, uuid, requests
API = "https://api.sume.com/v1/formats/sume/product-commercial/bulk-runs"
H = {"Authorization": "Bearer " + os.environ["SUME_API_KEY"]}
def submit(rows):
items = [{"instruction": "Price drop announcement",
"input": {"sku": r["sku"], "was": r["was"], "now": r["now"]}}
for r in rows]
key = str(uuid.uuid4()) # persist this with the chunk
res = requests.post(API, headers={**H, "Idempotency-Key": key},
json={"concurrency": 8, "items": items}, timeout=30)
res.raise_for_status()
return res.json()["data"]["id"]
# rows: your 200 marked-down products
rows = [{"sku": f"SKU-{i}", "was": 40, "now": 28} for i in range(200)]
queues = [submit(rows[i:i + 100]) for i in range(0, len(rows), 100)]
print(queues)What to record
- The queue id and the key for each chunk, so a retry after a timeout cannot start a second batch.
- The chunk's SKU order. Item
indexis the zero-based position in the array you sent, and the queue keeps that order. - The Format slug. Check it with
GET /v1/formats/sume/{slug}before the sale starts; an unlisted slug answers404 format_not_found.
Each chunk finishes on its own
Queue completed only means every item is terminal. Read counts.failed and counts.canceled for both queues before you tell merchandising the sale assets are ready. Each create spends one write from your rate-limit budget, so two queues cost two writes, not 200.
Sources
Related posts
More in Formats
- Release a 50-SKU holiday batch in two bulk queues: 5 first, 45 after
Submit 5 SKUs as a pilot queue, review the clips, then queue the other 45. Sume bulk queues take 1-100 items at concurrency 1-16. Runnable payload builder.
- Format run, schedule or Agent Completion for repeatable holiday ads
Use a Format when only inputs change, Scheduled when the clock starts the work, Agent Completions when the task changes. Set a spend cap on each.
- Retry only the missing ad variants with previous_run_id on a Format
When a variants run returns some clips as null, continue it with previous_run_id and name the missing slots, so you do not pay for the finished variants again.
- Retry two scenes in one Format run: scene_ids with previous_run_id
Continue the thread with previous_run_id and put scene_ids in input to redo two clips in one run. Voice and other clips stay; send a cap.
Written by Sume