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
fix(workflow): handle NoneSegments in variable extraction (#9585)
-LAN-2e657b7b1291
diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.pyindex f310a67b76e..4179d34f9a1 100644--- a/api/core/workflow/nodes/llm/node.py+++ b/api/core/workflow/nodes/llm/node.py@@ -22,7 +22,7 @@ from core.model_runtime.utils.encoders import jsonable_encoderfrom core.prompt.advanced_prompt_transform import AdvancedPromptTransformfrom core.prompt.entities.advanced_prompt_entities import CompletionModelPromptTemplate, MemoryConfigfrom core.prompt.utils.prompt_message_util import PromptMessageUtil-from core.variables import ArrayAnySegment, ArrayFileSegment, FileSegment+from core.variables import ArrayAnySegment, ArrayFileSegment, FileSegment, NoneSegmentfrom core.workflow.constants import SYSTEM_VARIABLE_NODE_IDfrom core.workflow.entities.node_entities import NodeRunMetadataKey, NodeRunResultfrom core.workflow.enums import SystemVariableKey@@ -320,11 +320,12 @@ class LLMNode(BaseNode[LLMNodeData]):variable_selectors = variable_template_parser.extract_variable_selectors()for variable_selector in variable_selectors:- variable_value = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)- if variable_value is None:+ variable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)+ if variable is None:raise ValueError(f"Variable {variable_selector.variable} not found")-- inputs[variable_selector.variable] = variable_value.to_object()+ if isinstance(variable, NoneSegment):+ continue+ inputs[variable_selector.variable] = variable.to_object()memory = node_data.memoryif memory and memory.query_prompt_template:@@ -332,11 +333,12 @@ class LLMNode(BaseNode[LLMNodeData]):template=memory.query_prompt_template).extract_variable_selectors()for variable_selector in query_variable_selectors:- variable_value = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)- if variable_value is None:+ variable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)+ if variable is None:raise ValueError(f"Variable {variable_selector.variable} not found")-- inputs[variable_selector.variable] = variable_value.to_object()+ if isinstance(variable, NoneSegment):+ continue+ inputs[variable_selector.variable] = variable.to_object()return inputs