Skip to content

Output Parser Injection #15763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aidivas opened this issue May 27, 2025 · 3 comments
Open

Output Parser Injection #15763

aidivas opened this issue May 27, 2025 · 3 comments
Labels
in linear Issue or PR has been created in Linear for internal review Needs Feedback Waiting for further input or clarification.

Comments

@aidivas
Copy link

aidivas commented May 27, 2025

Bug Description

Hi - seeing multiple breaking issues since updating. All longstanding production flows failing. Self hosted linux nginx reverse proxy. Have rebuilt flows from scratch now as airtable nodes also stopped working

looks like it was reported here #12709

  1. Seeing an intermittent issue with this in output parsers with basic llm chain. Switched to gpt40 and same issues - looks like this is injected into the output - not by me - ive got a strict json output defined that did work for a year. Cleared cache and its returning from time to time breaking my flows.

ou must format your output as a JSON value that adheres to a given "JSON Schema" instance.

"JSON Schema" is a declarative language that allows you to annotate and validate JSON documents.

For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}}}
would match an object with one required property, "foo". The "type" property specifies "foo" must be an "array", and the "description" property semantically describes it as "a list of test words". The items within "foo" must be strings.
Thus, the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of this example "JSON Schema". The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted.

Your output will be parsed and type-checked according to the provided schema instance, so make sure all fields in your output match the schema exactly and there are no trailing commas!

Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock:

{"type":"object","properties":{"output":{}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}

{"type":"object","properties":{"output":{"type":"object","properties":{"ai_title":{"type":"string"},"ai_tags":{"type":"string"},"ai_article":{"type":"string"}},"required":["ai_title","ai_tags","ai_article"]}},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}

To Reproduce

Intermittent Issue after running Basic LLM Chain with output parser attached. No issues before updates. Have swtiched LLM to gpt40 and fails from time to time. Previously worked with mini

I cant reproduce it - flow works then stops working

Soemthing is injecting object properties into my schema so it breaks the output parser and rest of automation

{
"action": "parse",
"text": "json\n{\"type\":\"object\",\"properties\":{\"output\":{\"type\":\"object\",\"properties\":{\"ai_title\":{\"type\":\"string\"},\"ai_tags\":{\"type\":\"string\"},\"ai_article\":{\"type\":\"string\"}},\"required\":[\"ai_title\",\"ai_tags\",\"ai_article\"]}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n"
}

{
"action": "parse",
"response": {}
}

My precise instructions
Output Requirements
Generate the following output in valid JSON format (without wrapping it in code blocks or including unnecessary characters). The output should match this structure exactly:

{
"ai_title": "Concise, punchy title under 60 characters",
"ai_tags": "Comma-separated keywords (e.g., 'AI, technology, speech')",
"ai_article": "Full article content as a single string, with all Markdown formatting included"
}
Important Note: Do not add backticks, json, or any code block formatting. Output plain JSON.

Expected behavior

All worked for at least 8 months - production flow failing with on/off issues. Started after updates

Operating System

ubuntu

n8n Version

Version 1.92.2

Node.js Version

18

Database

SQLite (default)

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented May 27, 2025

Hey @aidivas,

We have created an internal ticket to look into this which we will be tracking as "GHC-2200"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label May 27, 2025
@aidivas
Copy link
Author

aidivas commented May 27, 2025

hi see here #12709 as its the same issue thanks. For now ive had to delete the output parser and add a code node instead but ive spent 2 days having to debug and rebuild several live automations that all worked fine before. Maybe N8N can document fully any hidden prompt injections 😜.. or not inject anything at all...thanks!

@Joffcom
Copy link
Member

Joffcom commented May 28, 2025

Hey @aidivas,

What version did you update to and what version were you using when it was working?

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review Needs Feedback Waiting for further input or clarification.
Projects
None yet
Development

No branches or pull requests

2 participants