@@ -38,9 +38,11 @@ def execute
3838 params [ :flow_settings ] = settings
3939 end
4040
41- if params . key? ( :starting_node ) && params [ :starting_node ] . is_a? ( Types ::Input ::NodeFunctionInputType )
42- node = create_node_function ( params [ :starting_node ] , t )
43- params [ :starting_node ] = node
41+ if params . key? ( :starting_node_id )
42+ params [ :starting_node ] = create_node_function ( params [ :starting_node_id ] , params [ :nodes ] , t )
43+
44+ params . delete ( :starting_node_id )
45+ params . delete ( :nodes )
4446 end
4547
4648 flow = Flow . create ( project : namespace_project , **params )
@@ -76,7 +78,9 @@ def execute
7678 end
7779 end
7880
79- def create_node_function ( node_function , t )
81+ def create_node_function ( node_function_id , input_nodes , t )
82+ node_function = input_nodes . find { |n | n . id == node_function_id }
83+
8084 runtime_function_definition = SagittariusSchema . object_from_id ( node_function . runtime_function_id )
8185 if runtime_function_definition . nil?
8286 t . rollback_and_return! ServiceResponse . error (
@@ -139,8 +143,9 @@ def create_node_function(node_function, t)
139143 )
140144 end
141145
142- next_node = nil
143- next_node = create_node_function ( node_function . next_node , t ) if node_function . next_node . present?
146+ next_node = if node_function . next_node_id . present?
147+ create_node_function ( node_function . next_node_id , input_nodes , t )
148+ end
144149
145150 NodeFunction . create (
146151 next_node : next_node ,
0 commit comments