Reference · Tools

Gemini Chat

Chat with Google Gemini models using the generateContent API.

Action AI v1

Gemini Chat connects your BusyBot workflow to Google Gemini's generateContent API, letting you send user messages and receive model-generated text responses. You control the model version, system prompt, temperature, maxOutputTokens, topP, topK, and safety settings per run. A common use case is building a document summarization pipeline where each incoming item is independently sent to Gemini and the response text is passed downstream.

Node type
Action
Parameters
8
Outputs
Output, Error
Credentials
Google AI

Gemini Chat

Chat with Google Gemini models using the generateContent API.

Overview

Gemini Chat sends a user message to the Google Gemini generativeAI API (generateContent) and returns the model response. Supports model selection, system prompts, generation config (temperature, maxOutputTokens, topP, topK), and safety settings. Each input item is processed independently with configurable concurrency. The response includes the generated text, finish reason, and token usage metadata.

Category: AI
Tool Name: gemini_chat
Version: 1

Appearance: Icon: gemini | Color: #ffffff

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Google AI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
ModeloptionsNo(current default)The Gemini model to use for generation. 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 PromptstringNoYou are a helpful assistant.System instruction that sets the behavior and persona of the model. Defaults to a generic helpful-assistant prompt — override per workflow as needed. Supports expressions.
User MessagestringYesThe message to send to the Gemini model. Falls back to item.message or item.prompt if empty. Supports expressions like {{ $json.question }}.
File URIsstringNoOptional. fileUri value(s) from the Gemini File Upload tool. Pass a single URI or a JSON array for multiple files. Files are sent as multimodal context alongside the message. Falls back to item.fileUris if empty. Gemini File API retains uploads for 48 hours. Supports expressions.
OptionscollectionNo{}Optional generation settings — add only the fields you need.
— TemperaturenumberNo1Controls randomness. Lower values are more deterministic, higher values are more creative. Range: 0-2.
— Max Output TokensnumberNo8192Maximum number of tokens in the generated response.
— Top PnumberNoNucleus sampling threshold. Only tokens with cumulative probability up to topP are considered.
— Top KnumberNoLimits sampling to the top K most probable tokens.
— Response Field NamestringNoresponseThe key name in the output JSON where the generated text will be stored.
Safety SettingsfixedCollectionNo{ settings: [] }Configure safety filtering thresholds per harm category. Add one entry per category you want to change; categories you leave out keep the API’s own default.
— CategoryoptionsNoHARM_CATEGORY_HARASSMENTThe harm category to configure.
Options: HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT
— ThresholdoptionsNoBLOCK_MEDIUM_AND_ABOVEThe blocking threshold for this category.
Options: BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH
Include InputbooleanNofalseWhether to merge the input item JSON into the output item.
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One request per input item, and one output item per input item. The reply text lands on the field named by Response Field Name (response by default), with model, finishReason and usage 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.

{
  "response": "The generated reply text",
  "model": "the model that produced the reply",
  "finishReason": "the API's reason for ending generation",
  "usage": { "promptTokenCount": 128, "candidatesTokenCount": 256 }
}
  • finishReason is the API’s own reason for ending generation — the field to check when a reply comes back cut off or empty, whether against the Max Output Tokens cap or a Safety Settings threshold that blocked the content.
  • usage is the token accounting the API returned for that call.
  • Turning on Include Input merges the original item fields into the same object, so make sure your response field name does not collide with an incoming field.

Reference the result downstream by expression, e.g. {{ $json.response }}.

Usage Examples

  • Send a question to Gemini and get a response
  • Summarize text using a Gemini model with a system prompt
  • Generate creative content with a system prompt and temperature control
  • Process multiple items through Gemini with concurrency
  • Use a more capable Gemini model for complex reasoning tasks

Example Configuration

Ask a question with the default model and system prompt:

{
  "type": "gemini_chat",
  "parameters": {
    "userMessage": "Explain what a vector database is in two sentences."
  }
}

Classify each item deterministically and keep the original fields:

{
  "type": "gemini_chat",
  "parameters": {
    "systemPrompt": "Classify the sentiment of the text as POSITIVE, NEGATIVE, or NEUTRAL. Reply with one word only.",
    "userMessage": "{{ $json.review }}",
    "includeInput": true,
    "maxConcurrency": 20,
    "options": {
      "temperature": 0,
      "maxOutputTokens": 10,
      "responseFieldName": "sentiment"
    }
  }
}

Ask about a file uploaded by an upstream Gemini File Upload node, with one safety threshold relaxed. Each safety entry pairs a category with a threshold, so add an entry only for a category you actually want to change:

{
  "type": "gemini_chat",
  "parameters": {
    "systemPrompt": "You are a legal analyst. Answer only from the attached document.",
    "userMessage": "What are the termination clauses in this contract?",
    "fileUris": "{{ $json.fileUri }}",
    "options": {
      "temperature": 0.2,
      "responseFieldName": "contractSummary"
    },
    "safetySettings": {
      "settings": [
        { "category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_ONLY_HIGH" }
      ]
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Gemini Chat sends user messages to the Google Gemini generateContent API and returns model-generated responses, with model selection across the available Gemini chat models. Use it when your workflow requires Google Gemini inference with control over temperature, maxOutputTokens, topP, topK, system prompts, or safety settings. Each processed item produces an output containing the generated text, finish reason, and token usage metadata.

Frequently asked questions

What credentials do I need to use the Gemini Chat node?

You need a Google AI credential (type: googleAi) configured in BusyBot. This is distinct from a general Google Cloud credential — it uses an API key issued through Google AI Studio, not a service account. Make sure you create and select a googleAi credential specifically, or the node will fail to authenticate.

What exactly does the node return for each processed item?

Each item produces two possible outputs: Output and Error. On success, the Output contains the generated text, the finish reason (e.g. STOP, MAX_TOKENS), and token usage metadata including prompt and completion token counts. If the API call fails or a safety setting blocks the response, the item is routed to the Error output instead.

How does the node handle multiple input items — does it batch them into one API call?

No. Each input item is sent to the Gemini API as a completely independent generateContent request. The node processes items with configurable concurrency, so you can control how many run in parallel, but there is no batching. This means token usage metadata in the output reflects a single item's call, not an aggregated total.

Which generation parameters can I tune, and what do they control?

The node exposes temperature (randomness of output), maxOutputTokens (response length cap), topP (nucleus sampling threshold), and topK (top candidate token count). These map directly to Gemini's generateContent generation config. You can also set safety settings and a system prompt, giving you meaningful control over output style and content filtering without leaving the node.

Can I use this node to maintain a multi-turn conversation?

The Gemini Chat node sends a single user message per item and does not natively manage conversation history across turns. If you need multi-turn dialogue, you would need to construct the full conversation context yourself and pass it in via the message or system prompt parameters on each run. The node itself has no built-in session or memory state.

Build with the Gemini Chat 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 BusyBot

Last updated . Spotted something wrong? Tell us.