Send Chat Message
Sends a message in a chat conversation with Google's Gemini API, maintaining conversation history.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The connection ID obtained from the Connect node.
- User Prompt - The text message to send to the model.
- Chat History - Previous conversation history to maintain context.
- Local File Paths - Array of local file paths to include as input (images, documents, etc.).
- Custom Local File Paths - Alternative way to provide file paths as an array.
- Uploaded Files - Previously uploaded files from the File Upload node.
Options
- Model - The Gemini model to use for chat. Options include:
- Gemini 2.5 Pro
- Gemini 2.5 Flash
- Gemini 2.5 Flash Lite
- Gemini 2.0 Flash
- Gemini 2.0 Flash Lite
- Gemini Live 2.5 Flash Preview
- Gemini 2.0 Flash Image Generation
- Custom Model
- Custom Model - Custom model name when "Custom Model" is selected.
- Stream - Whether to stream the response as it's generated. Default is false.
- Temperature - Controls randomness (0.0-2.0).
- TopP - Nucleus sampling (0.0-1.0).
- TopK - Top-k sampling (1-100).
- Max Output Tokens - Maximum number of tokens in the response.
- Safety Settings - Controls for various content categories:
- Harassment
- Hate Speech
- Sexually Explicit
- Dangerous Content
- Civic Integrity
- Response MIME Type - Format for the response: application/json or text/plain.
- Presence Penalty - Penalty for new tokens (-2.0 to 2.0).
- Frequency Penalty - Penalty for repeated tokens (-2.0 to 2.0).
- Enable Code Execution - Allow model to execute code. Default is false.
- Enable Google Search - Allow model to search Google. Default is false.
- Timeout (seconds) - Request timeout in seconds (default: 60).
Output
- Response - The model's response to the message.
- Chat History - Updated conversation history including the new message and response.
How It Works
The Send Chat Message node sends a message in a chat conversation with Google's Gemini API while maintaining conversation history. When executed, the node:
- Validates the provided connection ID and user prompt
- Processes any chat history to maintain context
- Configures the selected model with all specified parameters
- Processes any local files or uploaded files to include as input
- Sets up safety settings and generation parameters
- Creates a chat session with the Gemini API
- Sends the message and receives a response
- Handles the response either as a complete result or as a stream
- Returns the model's response and updated chat history
Requirements
- A valid Google Gemini API key
- Connection ID from a successful Connect node execution
- Valid text prompt for the model to respond to
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Connection ID
- Empty User Prompt
- Invalid custom model name
- Invalid parameter values (temperature, top_p, top_k, etc.)
- Invalid chat history format
- File read errors for local file paths
- Missing or invalid URI in uploaded files
- API errors from Google's Gemini service
Usage Notes
- Chat history should be provided in the format expected by the node
- Local files are processed as inline data
- Uploaded files are referenced by URI
- The node maintains conversation context through the chat history output
- Streaming responses are useful for long-generation tasks
- Safety settings can be adjusted to control content filtering
- The default timeout is 60 seconds, which can be adjusted for complex requests
- Response MIME type can be set to enforce JSON format
- Presence and frequency penalties help control repetition in responses
- Code execution and Google Search tools must be explicitly enabled
- The default model is "gemini-2.5-flash"