Reference · Tools
Gemini Batch
Process multiple Gemini requests in a batch.
Gemini Batch sends a list of prompts to Google Gemini's batchGenerateContent endpoint in a single synchronous call and returns every response matched back to its source input. Use it to process a list of product descriptions, user queries, or document summaries all at once — no polling loop required. Failures route to a dedicated Error output so successful responses are never mixed with failed ones.
- Node type
- Action
- Parameters
- 6
- Outputs
- Output, Error
- Credentials
- Google AI
Gemini Batch
Process multiple Gemini requests in a batch.
Overview
Gemini Batch uses the Google Gemini batchGenerateContent endpoint to process multiple content generation requests in a single synchronous API call. Unlike OpenAI and Anthropic batch APIs which are asynchronous, Gemini batch is synchronous — it sends all requests at once and receives all responses in a single response. Each input item becomes one request in the batch. Individual responses are matched back to their input items.
Category: AI
Tool Name: gemini_batch
Version: 1
Appearance: Icon: gemini | Color: #ffffff
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires Google AI credentials. See the Credentials Guide for setup instructions.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Model | options | No | (current default) | The Gemini model to use for batch requests. Pick a specific version — labels are pinned, not aliased to “latest”. |
| Options: the Gemini chat models available to your workspace — pick one from the dropdown. | ||||
| System Prompt | string | No | — | System instructions applied to all batch requests. Supports expressions. |
| File URIs | string | No | — | Optional. fileUri value(s) from the Gemini File Upload tool, attached to every batch request. Pass a single URI or a JSON array. Per-item override: include a “fileUris” field on the input item. Gemini File API retains uploads for 48 hours. Supports expressions. |
| Options | collection | No | {} | Optional generation and output settings — add only the fields you need. |
| — Temperature | number | No | 1 | Sampling temperature (0-2). Lower values make output more focused. |
| — Max Output Tokens | number | No | 4096 | Maximum number of tokens per response. |
| — Response Field Name | string | No | batch | Field name in the output JSON where the extracted response text will be placed. Do not use “response” — the raw API response object is always written to that key and would overwrite the extracted text. |
| Include Input | boolean | No | false | Whether to include the original input item fields in the output. |
| Max Concurrency | number | No | 5 | Maximum number of items to process concurrently. |
Output Data
Every input item becomes one request in a single batch call, and one output item comes back per input item. The generated text lands on the field named by Response Field Name (batch by default), with the raw API response and the item’s position in the batch beside it. The rest of the input item JSON is dropped unless Include Input is on; binary data on the input item is forwarded unchanged.
{
"batch": "The generated text for this item",
"response": "the raw Gemini response object for this request",
"model": "the model that produced the responses",
"finishReason": "the API's reason for ending generation",
"usage": { "promptTokenCount": 128, "candidatesTokenCount": 256 },
"batchIndex": 0,
"totalRequests": 25
}
- Each item supplies its own prompt. There is no user-message parameter on this node: the prompt is read from the item’s
message,promptortextfield, in that order. Put it there with an upstream Edit Fields node. - An item carrying none of those three fields is still returned, with the response field set to
null,status: "skipped"and areasonsaying no message, prompt or text field was found. If no item in the run carries a prompt, every item comes back withstatus: "empty"instead. responsealways holds the raw Gemini response for that request, so do not set Response Field Name toresponse— the raw object would overwrite the extracted text.batchIndexis the item’s position within the batch andtotalRequestsis how many requests were sent, which is what to log when reconciling a large run.usageis the per-request token accounting, present only when the API reported it.
Reference the result downstream by expression, e.g. {{ $json.batch }}.
Usage Examples
- Process 100 prompts in a single Gemini batch call
- Translate multiple texts using Gemini batch
- Generate summaries for a dataset in one API call
- Bulk classify content using Gemini batch
- Run batch content generation with a system prompt
Example Configuration
Summarize every incoming item — each item must carry its prompt on message, prompt or text:
{
"type": "gemini_batch",
"parameters": {
"systemPrompt": "Summarize the following text in 2-3 sentences.",
"includeInput": true,
"maxConcurrency": 10,
"options": {
"temperature": 0.4,
"maxOutputTokens": 256,
"responseFieldName": "summary"
}
}
}
High-throughput classification with deterministic output:
{
"type": "gemini_batch",
"parameters": {
"systemPrompt": "Classify the sentiment of the input as POSITIVE, NEGATIVE, or NEUTRAL. Reply with only the label.",
"includeInput": false,
"maxConcurrency": 20,
"options": {
"temperature": 0,
"maxOutputTokens": 16,
"responseFieldName": "sentiment"
}
}
}
Ask a batch of questions against one uploaded document:
{
"type": "gemini_batch",
"parameters": {
"systemPrompt": "Answer each question using only the attached document. Reply in one sentence.",
"fileUris": "{{ $json.fileUri }}",
"includeInput": true,
"options": {
"responseFieldName": "answer"
}
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Gemini Batch sends multiple content generation requests to the Google Gemini batchGenerateContent endpoint in a single synchronous API call. Use it when you need to process a list of prompts or inputs together and want all results returned at once without managing asynchronous job polling. It produces matched response objects on the main output for each successful input item and routes failures to the error output.
Frequently asked questions
How is this different from calling Gemini once per item in a loop?
Gemini Batch packages all requests into a single batchGenerateContent API call and receives all responses in one reply, rather than making one HTTP round-trip per item. This keeps your workflow simpler because you don't need a loop node or any state management between iterations — every response arrives together.
Is this node asynchronous like the OpenAI or Anthropic batch APIs?
No. Unlike those APIs, which submit a job and require you to poll for completion later, Gemini Batch is fully synchronous. The workflow step blocks until all responses are returned in the same call. There is no job ID to track and no separate polling step needed.
What credentials does this node require?
Gemini Batch authenticates using a Google AI credential (googleAi) configured in BusyBot. You'll need to create or connect a Google AI credential before the node can make requests — standard Google Gemini API access applies.
What happens when one request in the batch fails?
Failed individual responses are routed to the Error output, while successful responses continue through the main Output. This means a single bad prompt does not block you from using the results that did succeed — you can handle errors and successes in parallel branches of your workflow.
How are responses matched back to the inputs I sent?
Each input item corresponds to one request in the batch, and the node matches each response back to its originating input item before routing to the Output or Error branch. You don't need to write any custom matching logic — the pairing is handled by the node itself.
Build with the Gemini Batch node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Google AI credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.