feat: Add structured JSON output support to Agent Node (#5470)

* feat: Add structured JSON output support to Agent Node

- Add agentStructuredOutput input parameter matching LLM Node structure
- Implement configureStructuredOutput method to convert schema to Zod
- Add createZodSchemaFromJSON helper for complex JSON schemas
- Configure structured output before binding tools (required order)
- Disable streaming when structured output is enabled
- Extract structured fields in prepareOutputObject method
- Resolves issue #5256

* lint fix

* add structured output to Agent node

* add structured output to Agent node

---------

Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
Siddharth Chauhan
2025-11-26 01:22:49 +05:30
committed by GitHub
parent 4d79653741
commit 1f3f7a7194
4 changed files with 355 additions and 180 deletions
@@ -112,7 +112,7 @@ export const suggestionOptions = (
category: 'Node Outputs'
})
const structuredOutputs = nodeData?.inputs?.llmStructuredOutput ?? []
const structuredOutputs = nodeData?.inputs?.llmStructuredOutput ?? nodeData?.inputs?.agentStructuredOutput ?? []
if (structuredOutputs && structuredOutputs.length > 0) {
structuredOutputs.forEach((item) => {
defaultItems.unshift({