Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Variable Aggregator Node supports parallel branching #8677

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ def _run(self) -> NodeRunResult:
for selector in node_data.variables:
variable = self.graph_runtime_state.variable_pool.get_any(selector)
if variable is not None:
outputs = {"output": variable}

inputs = {".".join(selector[1:]): variable}
break
if "output" not in outputs:
outputs["output"] = []
if isinstance(variable, list):
outputs["output"].extend(variable)
elif isinstance(variable, str):
outputs["output"].append(variable)
inputs[".".join(selector[1:])] = variable
Comment on lines +24 to +30
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you pls explain the purpose of this codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the parallel branch calls the knowledge recall and then aggregates, the variable is a list, and the parameter aggregation variable after the ordinary if else node is a str.

Copy link
Collaborator

Choose a reason for hiding this comment

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

When the parallel branch calls the knowledge recall and then aggregates, the variable is a list, and the parameter aggregation variable after the ordinary if else node is a str.

Could you explain the problem you’re encountering? I'd like to understand the context and intent.
If possible, pls create an issue and link it to this PR.

else:
for group in node_data.advanced_settings.groups:
for selector in group.variables:
Expand All @@ -33,7 +36,6 @@ def _run(self) -> NodeRunResult:
if variable is not None:
outputs[group.group_name] = {"output": variable}
inputs[".".join(selector[1:])] = variable
break

return NodeRunResult(status=WorkflowNodeExecutionStatus.SUCCEEDED, outputs=outputs, inputs=inputs)

Expand Down