From 488534290e4622947ccb17e2d871b8cdb876a225 Mon Sep 17 00:00:00 2001 From: "hobo.l" Date: Mon, 4 Nov 2024 16:41:22 +0300 Subject: [PATCH] fixed: code_node is not compatible with previous versions --- api/core/workflow/nodes/code/code_node.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/api/core/workflow/nodes/code/code_node.py b/api/core/workflow/nodes/code/code_node.py index de70af58dda54..6ff1af7b2138a 100644 --- a/api/core/workflow/nodes/code/code_node.py +++ b/api/core/workflow/nodes/code/code_node.py @@ -48,14 +48,9 @@ def _run(self) -> NodeRunResult: variables = {} for variable_selector in self.node_data.variables: variable_name = variable_selector.variable - variable = self.graph_runtime_state.variable_pool.get(variable_selector.value_selector) - if variable is None: - return NodeRunResult( - status=WorkflowNodeExecutionStatus.FAILED, - inputs=variables, - error=f"Variable `{variable_selector.value_selector}` not found", - ) - variables[variable_name] = variable.to_object() + variable = self.graph_runtime_state.variable_pool.get_any(variable_selector.value_selector) + + variables[variable_name] = variable # Run code try: result = CodeExecutor.execute_workflow_code_template(