Skip to content

Commit 334d55b

Browse files
committed
feat: Support variable assign dict array value config
1 parent 577c928 commit 334d55b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/application/flow/step_node/variable_assign/impl/base_variable_assign_node.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# coding=utf-8
2+
import json
23
from typing import List
34

45
from application.flow.i_step_node import NodeResult
@@ -22,8 +23,13 @@ def execute(self, variable_list, stream, **kwargs) -> NodeResult:
2223
'input_value': self.get_reference_content(variable['fields']),
2324
}
2425
if variable['source'] == 'custom':
25-
self.workflow_manage.context[variable['fields'][1]] = variable['value']
26-
result['output_value'] = variable['value']
26+
if variable['type'] in ['dict', 'array']:
27+
val = json.loads( variable['value'])
28+
self.workflow_manage.context[variable['fields'][1]] = val
29+
result['output_value'] = variable['value'] = val
30+
else:
31+
self.workflow_manage.context[variable['fields'][1]] = variable['value']
32+
result['output_value'] = variable['value']
2733
else:
2834
reference = self.get_reference_content(variable['reference'])
2935
self.workflow_manage.context[variable['fields'][1]] = reference

0 commit comments

Comments
 (0)