Describe the problem/error/question
An AI Agent (@n8n/n8n-nodes-langchain.agent) using gemini-3-flash-preview with Postgres Chat Memory and tools fails on multi-turn conversations: the turn that makes parallel tool calls succeeds, but the next turn fails with a 400 from the model, before any tool runs.
Root cause: when Gemini 3 returns parallel function calls in one step, n8n persists AI messages to Postgres Chat Memory whose function calls are missing their thought_signature (the re-emitted single-call message is stored with additional_kwargs: {}). On the next turn this history is replayed, and the Google Vertex Chat Model node rejects it with a 400 (missing thought_signature).
This is endpoint-sensitive, and looks like a regression:
- Google Vertex Chat Model → 400 on the turn after a parallel-call turn.
- Google Gemini Chat Model (consumer API) → tolerates the same missing signatures (no error), so it masks the bug.
- On an older n8n version the same workflow stored a single, signed tool-call message per turn and never failed; after upgrading to 2.25.7 it stores parallel calls without signatures and the next turn 400s on Vertex.
Steps to reproduce (deterministic, ~6 nodes)
- Chat Trigger → AI Agent + Google Vertex Chat Model (
gemini-3-flash-preview) + Postgres Chat Memory + 2 trivial Code tools, with a system prompt that forces the model to call both tools in parallel every turn (workflow below). - Turn 1 in a fresh chat (e.g.
hi): agent calls both tools in parallel → succeeds. - Turn 2 (same chat, even text-only): first LLM call → 400 before any tool runs.
Using the Google Gemini Chat Model (consumer) node instead, the exact same workflow runs fine for many turns — it tolerates the missing signatures. So the malformed history is produced regardless of endpoint; only Vertex enforces and rejects it.
My questions
- Is this a known regression in 2.25.7 in how the AI Agent serializes Gemini
thought_signatures to chat memory for parallel tool calls (re-emitted call stored withadditional_kwargs: {})? - Which n8n version persists parallel-call signatures correctly, so I can pin to it?
- Any supported workaround besides downgrading, avoiding parallel tool calls, or stripping tool-call messages from memory between turns?
What is the error message (if any)?
n8n wrapper error on the Chat Model node:
Bad request - please check your parameters
Underlying Google API 400 by node:
- Vertex node: function call is missing a
thought_signature. - Gemini consumer node: tolerates missing signatures (no error). It only 400s with a corrupted
thought_signatureif a session mixes endpoints (Vertex-generated signature replayed through the consumer API).
Please share your workflow
Minimal reproduction (replace YOUR_GCP_PROJECT, add your Vertex credential on the model node and a Postgres credential on the memory node — no other data needed):
Share the output returned by the last node
The failing turn never reaches the last node — the Agent’s first LLM call 400s. The cause is visible in the n8n_chat_histories rows written by the previous turn (one parallel-call turn shown):
ai | tool_calls: [tool_a, tool_b] | additional_kwargs.__gemini_function_call_thought_signatures__: { tool_a_id: "<sig>" } // only 1 sig for 2 calls
tool | tool_a result
ai | tool_calls: [tool_b] | additional_kwargs: {} // <-- re-emitted call, NO thought_signature
tool | tool_b result
ai | "done"
With the Vertex node, the next turn replaying this 400s. With the consumer Gemini node, the identical history is stored but the next turn succeeds (signatures are not enforced). On the older n8n version, the same turn instead stored a single consolidated tool-call message with its signature, and replays never failed.
Information on your n8n setup
n8n version: 2.25.7 (reproduces on n8n Cloud and self-hosted Docker 2.25.7 with the Vertex node; did not reproduce on an older self-hosted version)
Database (default: SQLite): PostgreSQL (Postgres Chat Memory)
n8n EXECUTIONS_PROCESS setting (default: own, main): default
Running n8n via (Docker, npm, n8n cloud, desktop app): n8n Cloud and self-hosted Docker
Operating system: Linux (Docker, VPS) / n8n Cloud

