Vertex AI Integration Issue - Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')

We are implementing Google Vertex AI (Gemini 2.5 Pro) inside n8n workflows, using the new AI Agent nodes and the Structured Output Parser to enforce JSON communication between agents.

Context

  • Workflow uses multiple AI Agents (Entry Agent → Stock Control → Finance → Marketing, etc.).

  • Each agent has its own prompt and JSON schema, processed through Structured Output Parser for consistency.

  • Vertex AI is connected via the native n8n Vertex AI node (not via HTTP Request).

Problem

  • On the very first AI Agent (Entry Agent), the workflow fails before parsing with the following error:
Problem in node ‘Agente de Entrada’
Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')

  • This happens even when the JSON schema is valid inside the Structured Output Parser.

  • Yesterday the same workflow worked fine → today it fails with the error above, no schema changes.

  • It seems related to how the Vertex AI node returns its output to the Parser:

    • Sometimes the node returns undefined or non-iterable output.

    • The Parser then tries to iterate over undefined, triggering the error.

What we already tried

  1. Removed the Parser temporarily → workflow runs, so the issue is specifically on the Parser step.

  2. Checked the output of Vertex AI → sometimes plain text, sometimes malformed JSON.

  3. Tried Auto-Fix Format in the Parser → same issue.

  4. Updated Docker + n8n version → problem persists.

  5. Verified that in Vertex AI Console there is no saved prompt/schema (so output should be free-form).

Hypothesis

  • The error may be caused by the Vertex AI node using streaming output internally, while the Parser expects a fully resolved JSON object.

  • When the response is empty, malformed, or stream-based, the Parser receives undefined instead of iterable JSON.

Request

:backhand_index_pointing_right: Has anyone faced the Symbol.asyncIterator error when chaining Vertex AI → Structured Output Parser?
:backhand_index_pointing_right: Is there a known fix (e.g., disabling streaming, normalizing output with a Function node, or bugfix in recent n8n versions)?
:backhand_index_pointing_right: Should we switch to HTTP Request node + responseSchema instead of the native Vertex AI node for reliable JSON outputs?

Hi @eltonns74 ! :waving_hand: That error usually means the Vertex AI node is returning undefined or a stream, and the Parser can’t handle it. Try disabling streaming, or add a Function node to normalize the output before the Parser. If it keeps failing, using the HTTP Request node with a response schema is more reliable.