n8n AI Agent Nodes Break After Google's Gemini Interactions API Migration: How to Fix It
Why n8n's Gemini and LangChain AI Agent nodes stopped returning usable responses, and the Code-node workaround while the official fix is still pending.
TL;DR: n8n's Gemini AI Agent nodes broke when Google retired the legacy "outputs" response format on June 8, 2026; with no official n8n fix yet, add a Code node that manually parses the new "steps" array instead.
The workflow ran fine for months, then Gemini calls through n8n's AI Agent or LangChain nodes started returning empty or malformed responses with no error in the workflow itself. That's the signature of a provider-side schema migration landing underneath a node that hasn't been updated to match it.
Why did my n8n Gemini AI Agent node stop working?
Google migrated the Gemini Interactions API from a legacy outputs array to a new steps array, and removed the legacy format entirely on June 8, 2026. Per Google's own breaking-changes migration guide, the old response shape looked like this:
{
"id": "int_123",
"outputs": [{ "type": "text", "text": "..." }]
}The new shape wraps every turn - user and model - into a single timeline:
{
"id": "int_123",
"steps": [
{ "type": "user_input", "content": [{ "type": "text", "text": "..." }] },
{ "type": "model_output", "content": [{ "type": "text", "text": "..." }] }
]
}n8n's Gemini and LangChain nodes still parse the old outputs[-1].text path. GitHub issue #31525 tracks the break, pinned to the @google/genai package version bundled under packages/@n8n/nodes-langchain not yet handling the new shape.
Has n8n fixed the Gemini Interactions API breaking change?
Not yet. As of this writing, issue #31525 is still open. The only activity is an automated acknowledgment from the n8n-assistant bot confirming an internal tracking ticket - no maintainer response, no workaround, and no target release version. If you're on n8n 2.22.6 or earlier and using the Gemini node or a LangChain node against Gemini, you're affected until n8n ships an update.
How do you work around the Gemini steps-array break in n8n?
Google's guidance is to read the response via the SDK's output_text convenience property, or to walk the steps array for the entry whose type is model_output and read its content. n8n's built-in nodes don't do that yet, so the workaround is the same pattern automatelab covered for returning structured JSON from a Code node instead of trusting a node's own output: intercept the raw response and parse it yourself.
- Add a Code node after the failing Gemini/LangChain node. Set it to "Run Once for Each Item."
- Point downstream nodes at the Code node's output (
text) instead of the Gemini node's own parsed field, until n8n ships a fix that understandsstepsnatively.
Parse the raw response for the model_output step instead of trusting the node's own output:
const raw = $input.first().json;
const modelStep = (raw.steps || []).find(s => s.type === 'model_output');
const text = modelStep?.content?.[0]?.text ?? null;
return [{ json: { text, raw } }];
How do you verify the workaround worked?
Run the workflow manually and inspect the Code node's output item: text should hold the model's actual reply instead of null or an empty string. If text comes back null, log raw to confirm Google's response actually contains a steps array with a model_output entry - a non-text response type (function call, image) needs a different content-array index than [0].
Does this affect all Gemini models in n8n, or only some?
The break is in n8n's parsing layer, not in a specific model - any Gemini call routed through n8n's Interactions-API-based nodes hits the same outputs-vs-steps mismatch regardless of which Gemini model is selected. It's the same failure shape automatelab has seen before: a similar wire-format break in n8n's OpenAI streaming node, where flipping between two OpenAI response shapes silently broke a hand-written parser. Provider response-shape migrations are becoming a recurring category of n8n breakage, not a one-off.
Check the Automation Error Index for other n8n AI Agent and LangChain node errors while you're patching this one - and watch issue #31525 for whichever n8n release finally ships native steps support, since the Code node workaround is only meant to hold until then.
FAQ
Why did my n8n Gemini AI Agent node stop working in June 2026?
Google removed the legacy "outputs" response format from its Gemini Interactions API on June 8, 2026, replacing it with a "steps" array. n8n's Gemini and LangChain nodes still parse the old format, so responses come back empty or malformed.
What is Google's Gemini Interactions API steps migration?
A breaking change to the Gemini Interactions API's response shape: instead of a flat "outputs" array holding only model responses, the API now returns a "steps" array that includes both user and model turns, with content nested one level deeper.
Has n8n fixed the Gemini Interactions API breaking change?
Not as of n8n 2.22.6. GitHub issue #31525 is open with only an automated acknowledgment - no maintainer fix, workaround, or target version has been posted yet.
How do you manually parse the new Gemini steps response in n8n?
Add a Code node after the affected Gemini/LangChain node, find the entry in the "steps" array where type is "model_output", and read its content[0].text instead of relying on n8n's built-in parsing.
Does this affect all Gemini models in n8n, or only some?
It's a parsing-layer issue in n8n, not model-specific - any Gemini call through n8n's Interactions-API-based nodes hits the same mismatch regardless of which Gemini model is configured.