Skip to content

Adding Structured Output Parser throws an "Unexpected Token" error #26004

Description

@acquia-ankith

Bug Description

I have created an AI Agent with

  • LLM Model: sonnet 4.5
  • Tools: 2-3 MCP Servers
  • Memory: Simple memory or PostgresDB
  • Parser: Structured output parser.

When I execute the AI Agent the node completes the task that is provided in the user prompt but fails after completing with error stating "Unexpected Token 'I', "I'll help" ... is not a valid JSON .

Image

To Reproduce

  1. Create a simple workflow with manual trigger, AI Agent node, and any other type of nodes following the AI Agent node.
  2. Connect LLM Model, Memory, Tools and Parser to the AI agent node. The exact config I used:
  • LLM Model: sonnet 4.5
  • Tools: 2-3 MCP Servers
  • Memory: Simple memory or PostgresDB
  • Parser: Structured output parser.
  1. Execute the workflow.
  2. Once the AI Agent completes the task provided in the user prompt then we observe an error on as shown below
Image

FYI: I observe the first response from LLM starts as "I'll help you with .... "

Expected behavior

The AI agent node should execute and provide the structured output without causing any error.

Debug Info

Debug info

core

  • n8nVersion: 2.8.3
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.22.0
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 6e39d534-70f6-4ad4-89cf-9088b694bc20

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/145.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2026-02-19T13:52:41.474Z

Operating System

n8n official Docker image "stable" tag

n8n Version

2.8.3

Node.js Version

22.22.0

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions