Skip to content

support sub flows#980

Open
raphael-goetz wants to merge 3 commits into
mainfrom
#931-support-sub-flows
Open

support sub flows#980
raphael-goetz wants to merge 3 commits into
mainfrom
#931-support-sub-flows

Conversation

@raphael-goetz
Copy link
Copy Markdown
Member

Resolves: #931

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2544402924

Status: Failed
Duration: 62 minutes

Job summaries

rspec: [cloud]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14491577593/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2544402924/test_report
Finished in 0.00021 seconds (files took 16 minutes 26 seconds to load)
0 examples, 0 failures, 267 errors occurred outside of examples
Line Coverage: 59.07% (3225 / 5460)
section_end:1779389208:step_script
�[0Ksection_start:1779389208:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m�[0;m
�[32;1mUploading artifacts...�[0;m
rspec.xml: found 1 matching artifact files and directories�[0;m
Uploading artifacts as "junit" to coordinator... 201 Created�[0;m correlation_id�[0;m=9ff5befa99449c2b-IAD id�[0;m=14491577593 responseStatus�[0;m=201 Created token�[0;m=6f_HCYtQX
section_end:1779389209:upload_artifacts_on_failure
�[0Ksection_start:1779389209:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1779389209:cleanup_file_variables
�[0K
�[31;1mERROR: Job failed: exit code 1�[0;m

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14491577592/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2544402924/test_report
Finished in 0.00021 seconds (files took 15 minutes 3 seconds to load)
0 examples, 0 failures, 246 errors occurred outside of examples
Line Coverage: 58.62% (3097 / 5283)
section_end:1779389127:step_script
�[0Ksection_start:1779389127:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m�[0;m
�[32;1mUploading artifacts...�[0;m
rspec.xml: found 1 matching artifact files and directories�[0;m

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14491577591/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2544402924/test_report
Finished in 0.0013 seconds (files took 13 minutes 31 seconds to load)
0 examples, 0 failures, 232 errors occurred outside of examples
Line Coverage: 58.07% (2974 / 5121)
section_end:1779389040:step_script
�[0Ksection_start:1779389040:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m�[0;m
�[32;1mUploading artifacts...�[0;m
rspec.xml: found 1 matching artifact files and directories�[0;m
Uploading artifacts as "junit" to coordinator... 201 Created�[0;m correlation_id�[0;m=9ff5bade9a906bad-DFW id�[0;m=14491577591 responseStatus�[0;m=201 Created token�[0;m=6f_kTh9AK
section_end:1779389040:upload_artifacts_on_failure
�[0Ksection_start:1779389040:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1779389041:cleanup_file_variables
�[0K
�[31;1mERROR: Job failed: exit code 1�[0;m

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/14491613946/artifacts/out/index.html

rubocop

841 files inspected, no offenses detected

@raphael-goetz raphael-goetz marked this pull request as ready for review May 21, 2026 19:17
Copilot AI review requested due to automatic review settings May 21, 2026 19:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the old “function value” (NodeFunctionIdWrapper / node_functions.value_of_node_parameter) mechanism with a first-class SubFlow model that can be used as a node-parameter value, and wires it through GraphQL, persistence, and gRPC serialization. It also adds an optional cast field to flow settings and node parameters.

Changes:

  • Introduces SubFlow + SubFlowSetting models, tables, factories, and specs; updates NodeParameter to use sub_flow instead of function_value.
  • Updates Flow create/update GraphQL inputs and response unions to accept/return subFlow values (and removes NodeFunctionIdWrapper).
  • Adds cast to flow_settings and node_parameters (GraphQL + persistence + gRPC), plus docs updates.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spec/requests/graphql/mutation/namespace/projects/flows/update_mutation_spec.rb Updates mutation spec to send/expect subFlow parameter values
spec/requests/graphql/mutation/namespace/projects/flows/create_mutation_spec.rb Updates mutation spec to send/expect subFlow parameter values
spec/models/sub_flow_spec.rb New model spec for SubFlow associations/validation
spec/models/sub_flow_setting_spec.rb New model spec for SubFlowSetting associations/validation
spec/models/node_parameter_spec.rb Replaces function_value expectations with sub_flow
spec/models/node_function_spec.rb Removes value_of_node_parameter association expectations
spec/factories/sub_flows.rb Adds factory for SubFlow
spec/factories/sub_flow_settings.rb Adds factory for SubFlowSetting
spec/factories/node_parameters.rb Removes function_value factory attribute
spec/factories/node_functions.rb Removes value_of_node_parameter factory attribute
docs/graphql/union/nodeparametervalue.md Documents FlowSubFlow as a possible union type
docs/graphql/object/nodeparameter.md Documents new cast field on NodeParameter
docs/graphql/object/nodefunctionidwrapper.md Removes docs for deprecated NodeFunctionIdWrapper
docs/graphql/object/flowsubflowsetting.md Adds docs for FlowSubFlowSetting
docs/graphql/object/flowsubflow.md Adds docs for FlowSubFlow
docs/graphql/object/flowsetting.md Documents new cast field on FlowSetting
docs/graphql/input_object/nodeparametervalueinput.md Replaces nodeFunctionId with subFlow input
docs/graphql/input_object/nodeparameterinput.md Documents new cast input
docs/graphql/input_object/flowsubflowsettinginput.md Adds docs for FlowSubFlowSettingInput
docs/graphql/input_object/flowsubflowinput.md Adds docs for FlowSubFlowInput
docs/graphql/input_object/flowsettinginput.md Documents new cast input on FlowSettingInput
docs/graphql/enum/errorcodeenum.md Removes FUNCTION_VALUE_NOT_FOUND from documented error codes
db/structure.sql Reflects schema changes: new tables + cast columns + removed FK/index
db/schema_migrations/20260520120000 Adds checksum entry for the new migration
db/migrate/20260520120000_add_tucana_shared_flow_sub_flows.rb Adds cast columns, creates sub_flow tables, removes old reference
app/services/namespaces/projects/flows/update_service.rb Implements cast handling and subFlow update/clear logic
app/services/error_code.rb Removes obsolete function_value_not_found error code
app/models/sub_flow.rb New SubFlow model with gRPC conversion + validation
app/models/sub_flow_setting.rb New SubFlowSetting model with gRPC conversion
app/models/node_parameter.rb Switches from function_value to sub_flow; adds cast to gRPC
app/models/node_function.rb Removes value_of_node_parameter association
app/models/flow_setting.rb Adds cast to gRPC serialization
app/graphql/types/node_parameter_value_type.rb Updates union to include FlowSubFlow and resolve SubFlow
app/graphql/types/node_parameter_type.rb Adds cast field; returns sub_flow as the parameter value
app/graphql/types/node_function_id_wrapper_type.rb Removes deprecated GraphQL type
app/graphql/types/input/node_parameter_value_input_type.rb Replaces nodeFunctionId with subFlow; updates one-of validation
app/graphql/types/input/node_parameter_input_type.rb Adds cast input
app/graphql/types/input/flow_sub_flow_setting_input_type.rb Adds input type for sub-flow settings
app/graphql/types/input/flow_sub_flow_input_type.rb Adds input type for sub-flow values
app/graphql/types/input/flow_setting_input_type.rb Adds cast input for flow settings
app/graphql/types/flow_sub_flow_type.rb Adds GraphQL object type for FlowSubFlow
app/graphql/types/flow_sub_flow_setting_type.rb Adds GraphQL object type for FlowSubFlowSetting
app/graphql/types/flow_setting_type.rb Adds cast field to FlowSetting GraphQL type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 55 to +63
def update_settings(t)
db_settings = flow.flow_settings.first(flow_input.settings.length)
flow_type_settings = flow.flow_type.flow_type_settings

flow_input.settings.each_with_index do |setting, index|
db_settings[index] ||= flow.flow_settings.build
db_settings[index].flow_setting_id = flow_type_settings[index]&.identifier
db_settings[index].object = setting.value
db_settings[index].cast = optional_input(setting, :cast)
Comment on lines 85 to +96
flow_input.nodes.each do |node_input|
current_node = all_nodes[node_index] || NodeFunction.new(flow: flow)

update_node(t, current_node, node_input)
unless current_node.save
t.rollback_and_return! ServiceResponse.error(
message: 'Invalid node',
error_code: :invalid_node_function,
details: current_node.errors
)
end

create_table :sub_flows do |t|
t.references :node_parameter, null: false, index: { unique: true },
foreign_key: { to_table: :node_parameters, on_delete: :cascade }
t.references :starting_node, null: true, foreign_key: { to_table: :node_functions, on_delete: :restrict }
Comment on lines +34 to +36
remove_reference :node_functions, :value_of_node_parameter,
null: true,
foreign_key: { to_table: :node_parameters, on_delete: :cascade }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replacing NodeFunctionIdWrapper with SubFlow

2 participants