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
feat: remove file and file[] restriction in code node (#17382)
Good Woodb3f4e90862d0
diff --git a/api/core/workflow/nodes/code/code_node.py b/api/core/workflow/nodes/code/code_node.pyindex b1a50c2dcc2..3c34c5b4e76 100644--- a/api/core/workflow/nodes/code/code_node.py+++ b/api/core/workflow/nodes/code/code_node.py@@ -6,6 +6,7 @@ from core.helper.code_executor.code_executor import CodeExecutionError, CodeExecfrom core.helper.code_executor.code_node_provider import CodeNodeProviderfrom core.helper.code_executor.javascript.javascript_code_provider import JavascriptCodeProviderfrom core.helper.code_executor.python3.python3_code_provider import Python3CodeProvider+from core.variables.segments import ArrayFileSegmentfrom core.workflow.entities.node_entities import NodeRunResultfrom core.workflow.nodes.base import BaseNodefrom core.workflow.nodes.code.entities import CodeNodeData@@ -49,7 +50,10 @@ class CodeNode(BaseNode[CodeNodeData]):for variable_selector in self.node_data.variables:variable_name = variable_selector.variablevariable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector)- variables[variable_name] = variable.to_object() if variable else None+ if isinstance(variable, ArrayFileSegment):+ variables[variable_name] = [v.to_dict() for v in variable.value] if variable.value else None+ else:+ variables[variable_name] = variable.to_object() if variable else None# Run codetry:result = CodeExecutor.execute_workflow_code_template(diff --git a/web/app/components/workflow/nodes/code/use-config.ts b/web/app/components/workflow/nodes/code/use-config.tsindex c53c07a28e3..13b89624390 100644--- a/web/app/components/workflow/nodes/code/use-config.ts+++ b/web/app/components/workflow/nodes/code/use-config.ts@@ -101,7 +101,7 @@ const useConfig = (id: string, payload: CodeNodeType) => {})const filterVar = useCallback((varPayload: Var) => {- return [VarType.string, VarType.number, VarType.secret, VarType.object, VarType.array, VarType.arrayNumber, VarType.arrayString, VarType.arrayObject].includes(varPayload.type)+ return [VarType.string, VarType.number, VarType.secret, VarType.object, VarType.array, VarType.arrayNumber, VarType.arrayString, VarType.arrayObject, VarType.file, VarType.arrayFile].includes(varPayload.type)}, [])// single run