Batch-generate 20 to 500 assets
Turn a list of products, variants or scenes into 20 to 500 FLORA generations from your agent: quote the batch, fire in chunks of 20, poll, and retry only what failed.
Hand your agent a list (SKUs, markets, scenes, a CSV) and one style, and FLORA MCP returns one asset per row on a single canvas. Use this recipe when the job is a list. For a handful of one-off images, Generate an image or video is simpler; when each row needs a saved multi-step workflow, run one Technique per row with the same method.
Works in: Claude · Claude Code · ChatGPT · Codex · Cursor (a coding agent such as Claude Code, Codex or Cursor is the most comfortable for 100+ rows)
You need: a connected client, a workspace, about $0.07 per image with Nano Banana 2 at 1K (about $7 for 100)
Use when: the input is a list, spreadsheet or folder and you want one output per row in one consistent style.
Don't use when: you need one item, or each row needs a genuinely different treatment (that's several batches).
Ask your agent
Use FLORA to make one studio product shot per row of the list below, all in one style: seamless warm-grey backdrop, soft light from camera left, subtle contact shadow, square. Put them in a new project called "Fall PDP". Show me the cost first and wait for my OK, then fire them in batches of 20 and retry only the items that fail. List: [paste your list or CSV]
What the agent does
Plan: parse the list, fix the style, pick one model
Parse the rows and confirm the count and a few sample rows with you. A misread column is free to fix now and paid to fix later.
Build one style string and append each row's subject to it. That string is the whole consistency mechanism.
Pick one model for the batch and read its parameters with
flora_list_modelsandmodel_id. Use only theparamsnames and values it returns; a mistyped value can silently fall back to the model's default and still bill.Put the batch in its own project (
flora_create_project), so history reads and the canvas stay clean.
Quote the whole batch, then wait for approval
Rows with the same model and params cost the same, so the agent quotes one representative item and multiplies, or quotes every chunk if the params vary:
{
"quote": true,
"generations": [
{
"project_id": "prj_abc",
"type": "image",
"prompt": "A matte black ceramic pour-over dripper. Studio product photo on a seamless warm-grey backdrop, soft light from camera left, subtle contact shadow, 85mm, centred, no props, no text",
"model": "t2i-gemini-3.1-flash-image",
"params": { "aspect_ratio": "1:1", "resolution": "1K" }
}
]
}It tells you plainly: "120 items × $0.072 = about $8.64. Proceed?" and waits.
Fire in chunks of up to 20
flora_create_generations takes 1 to 20 items per call, so 120 rows is 6 calls. Within a call, every item starts at once.
{
"generations": [
{
"project_id": "prj_abc",
"type": "image",
"prompt": "A matte black ceramic pour-over dripper. Studio product photo on a seamless warm-grey backdrop, soft light from camera left, subtle contact shadow, 85mm, centred, no props, no text",
"model": "t2i-gemini-3.1-flash-image",
"params": { "aspect_ratio": "1:1", "resolution": "1K" }
},
{
"project_id": "prj_abc",
"type": "image",
"prompt": "A brushed steel insulated water bottle. Studio product photo on a seamless warm-grey backdrop, soft light from camera left, subtle contact shadow, 85mm, centred, no props, no text",
"model": "t2i-gemini-3.1-flash-image",
"params": { "aspect_ratio": "1:1", "resolution": "1K" }
}
]
}The response keeps input order. Each entry has index and ok. A success also carries run_id, node_id, model.model_id, estimated_seconds, charged_cost (an estimate at start time), project_id, canvas_url and poll_url; a failure carries error and usually status. The longest estimated_seconds in a chunk is a good hint for when to make its first poll. The agent writes down a run_id → row map after every call (in a file if it has one, otherwise in the conversation). That map is the only link between a run and the row it came from.
Fire the chunks back to back; there's no need to pace them on a timer. Save each response's map before the next call. For very large lists, fire a wave of a few chunks (for example 100 rows), poll them, and fire the next wave as they finish, so polling stays inside the workspace's per-minute rate limit.
Poll each chunk in one call
Each chunk is one flora_list_generations call with that chunk's run_ids (up to 20), no more often than the polling rule allows (40 seconds for 20 runs):
{
"run_ids": ["run_01", "run_02", "run_03", "run_04", "run_05", "run_06", "run_07", "run_08", "run_09", "run_10", "run_11", "run_12", "run_13", "run_14", "run_15", "run_16", "run_17", "run_18", "run_19", "run_20"]
}Key on status only. completed with outputs means the asset exists; failed carries error_code and error_message; pending and running are still going. A failed run can also report progress: 100, so don't read that as success.
Collect results and settle the cost
The agent reports one row per item, in your order, keyed by your SKU or filename:
PO-01
completed
$0.072
https://media.flora.ai/…
WB-04
failed
none
GENERATION_PROMPT_MODERATED: needs a reworded prompt
charged_cost can appear a little after a run completes. The agent re-reads the batch once everything is finished before it totals the cost, and calls the total a floor if any value is still missing. flora_get_usage shows the workspace's spend afterwards.
Retry only what failed
A batch is not all-or-nothing. Never re-fire the whole batch: the items that succeeded already spent money.
error_code
What to do
GENERATION_PROVIDER_TIMEOUT, GPU_PROVIDER_ERROR, GENERATION_GENERIC_ERROR, GENERATION_FAILED_TO_START, SERVER_ERROR
Retry once, as a new item.
GENERATION_DOWNSTREAM_SERVICE_ERROR, GENERATION_QUEUE_TOO_LARGE, GENERATION_NO_RESULT
Wait a few minutes, then retry once.
GENERATION_PROMPT_MODERATED, GENERATION_INVALID_PARAMS, GENERATION_INVALID_URL
Change the prompt or input first.
BILLING_*, ACCESS_*
Stop and tell you. Don't retry.
Read error_message as well as the code: a provider error sometimes wraps a safety refusal, and retrying it unchanged only fails the same way. Failed runs aren't charged, but every retry is a new generation and is billed if it succeeds.
Recover after a timeout
flora_create_generations has no idempotency key. If a create call times out or the conversation drops, some items may have started anyway, and firing them again bills twice. Before re-firing, the agent reads history for the batch's project, with the submitted prompts, 20 to 50 runs per page:
Without run_ids, flora_list_generations returns history newest first, and include_inputs adds each run's submitted prompt and references. The agent matches prompts to rows, fires only the rows with no run, and reads older pages by passing the response's meta.next_cursor as cursor.
include_inputs pages have a size budget of about 200 KB. Prompts longer than 2,000 characters come back trimmed (the entry is flagged inputs.truncated), and a page that still won't fit fails the whole call with "include_inputs history exceeds the ~200 KB tool-result budget even as previews". When that happens:
Ask for a smaller page (
limitof 10 or 20), and keep paging withcursor.Narrow it with
status(for example"pending"or"running"to see what's still in flight).Or drop
include_inputsand match on what history always returns: compare the runs created since the chunk was sent (created_at) with therun_idsyou already saved. If the count doesn't settle which rows started, the agent asks you before re-firing anything.
Check it worked
The number of
completedruns equals the number of rows, or the report names every row that didn't finish and why.The canvas shows one node per completed row. To lay them out, see Put results on a canvas.
If it fails
Runs fail with BILLING_NOT_ENOUGH_CREDITS (or another BILLING_* code) when you poll
The workspace ran out of balance mid-batch. Creates still return ok: true; the billing error shows up on the run
Stop firing. Every later item fails the same way. Report what finished and relay the message.
Some entries ok: false with input_validation_error
A bad model, key or ID on those items
Fix and re-fire only those items. Nothing was charged for them.
429 or rate_limited
Too many requests against the per-minute limit (counted against your credential's default workspace)
Wait retry_after_seconds if the error has it; otherwise back off about 60 seconds. Then retry reads and continue with fewer chunks in flight. Don't blindly re-fire creates: check history first.
Rows stuck running long past estimated_seconds
A slow or stuck provider
See the stuck-run guidance in runs. Don't re-fire until history shows the run failed.
Outputs drift in style across the batch
The style string changed between rows, or rows used different models
Keep one style string and one model per batch; split real differences into separate batches.
unknown_error on every item
Often a malformed prj_ or ws_ ID
Check the IDs with flora_get_project before assuming an outage.
Related: cost and limits, runs and polling, and the flora-batch-generate skill.
Last updated
Was this helpful?