Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
support returning structured output when using LLM API non streaming invocation (#26451)
goofy86c3c58e64b2
diff --git a/api/core/workflow/node_events/node.py b/api/core/workflow/node_events/node.pyindex c1aeb9fe27e..93dfefb6798 100644--- a/api/core/workflow/node_events/node.py+++ b/api/core/workflow/node_events/node.py@@ -20,6 +20,7 @@ class ModelInvokeCompletedEvent(NodeEventBase):usage: LLMUsagefinish_reason: str | None = Nonereasoning_content: str | None = None+ structured_output: dict | None = Noneclass RunRetryEvent(NodeEventBase):diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.pyindex 7767440be60..36183bf8db9 100644--- a/api/core/workflow/nodes/llm/node.py+++ b/api/core/workflow/nodes/llm/node.py@@ -23,6 +23,7 @@ from core.model_runtime.entities.llm_entities import (LLMResult,LLMResultChunk,LLMResultChunkWithStructuredOutput,+ LLMResultWithStructuredOutput,LLMStructuredOutput,LLMUsage,)@@ -278,6 +279,13 @@ class LLMNode(Node):# Extract clean text from <think> tagsclean_text, _ = LLMNode._split_reasoning(result_text, self._node_data.reasoning_format)+ # Process structured output if available from the event.+ structured_output = (+ LLMStructuredOutput(structured_output=event.structured_output)+ if event.structured_output+ else None+ )+# deduct quotallm_utils.deduct_llm_quota(tenant_id=self.tenant_id, model_instance=model_instance, usage=usage)break@@ -1048,7 +1056,7 @@ class LLMNode(Node):@staticmethoddef handle_blocking_result(*,- invoke_result: LLMResult,+ invoke_result: LLMResult | LLMResultWithStructuredOutput,saver: LLMFileSaver,file_outputs: list["File"],reasoning_format: Literal["separated", "tagged"] = "tagged",@@ -1079,6 +1087,8 @@ class LLMNode(Node):finish_reason=None,# Reasoning content for workflow variables and downstream nodesreasoning_content=reasoning_content,+ # Pass structured output if enabled+ structured_output=getattr(invoke_result, "structured_output", None),)@staticmethod