diff --git a/dagflow/dagflow.py b/dagflow/dagflow.py index 6d49b53..8dd1aba 100644 --- a/dagflow/dagflow.py +++ b/dagflow/dagflow.py @@ -344,7 +344,7 @@ where backid=${backid}$ }) async def node_transfer(self, sor, dsl, inst, ne, node, flow_def): - nnode = [] + nnodes = [] ctx = json.loads(inst.ctx) for edge in dsl.get('edges', []): if edge['from'] != ne.node_id: @@ -354,19 +354,14 @@ where backid=${backid}$ continue m_on = edge.get('foreach') if m_on: - ns = DictObject(**{ - 'sor': sor, - 'm_on': m_on, - 'ctx': ctx, - 'node': node - }) on_array = safe_eval_condition(m_on, ctx) for e in on_array: nnodes.add((edge['to'], str(e))) else: nnodes.add(edge['to'], None) - for node, ctx_ext in nnodes: + for node_id, ctx_ext in nnodes: + node = dsl['nodes'][node_id] x = await self.is_ok_to_create_new_node_exe(sor, node, edges, inst) if x: env = ServerEnv()