Skip to content

Conversation

@hornm-knime
Copy link
Contributor

…bined workflow

... and improved handling of failing segments executed with combined executor.

AP-25344 (Properly handle failing tools in combined tools workflow)

…bined workflow

... and improved handling of failing segments executed with combined
executor.

AP-25344 (Properly handle failing tools in combined tools workflow)
Copilot AI review requested due to automatic review settings December 18, 2025 11:06
@hornm-knime hornm-knime requested a review from a team as a code owner December 18, 2025 11:06
Copy link

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 improves error handling in the CombinedExecutor by adding an option to remove failed workflow segments from the combined workflow, and ensures node messages are always collected when execution fails.

  • Added removeFailedSegments configuration option to CombinedExecutor.Builder
  • Refactored execution result creation to handle success and failure cases separately
  • Enhanced WorkflowToolCell to properly handle null results when segments fail
  • Updated documentation to clarify message collection behavior

Reviewed changes

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

File Description
WorkflowSegmentExecutor.java Updated javadoc to clarify that messages are always collected on execution failure
CombinedExecutor.java Added removeFailedSegments option and split result creation into success/failure paths with proper cleanup
WorkflowToolCell.java Added null safety checks for failed execution results and extracted view node ID logic
WorkflowToolCellTest.java Added comprehensive test for failing tool execution scenarios with and without segment removal

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

metadataBuilder.withInPort(pm.name(), pm.description());
}
var outPortMetadata = new Port[component.getNrOutPorts() - 1];
var outPortMetadata = new Port[outputs == null ? 0 : component.getNrOutPorts() - 1];
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The ternary expression is computing array size but component could be null (as checked on line 585). Consider using a guard condition to return early if outputs is null, as component.getNrOutPorts() would throw NullPointerException if component is null.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the component can never be null here (see null check and early return on top)

Copy link
Contributor

@AtR1an AtR1an left a comment

Choose a reason for hiding this comment

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

LGTM

metadataBuilder.withInPort(pm.name(), pm.description());
}
var outPortMetadata = new Port[component.getNrOutPorts() - 1];
var outPortMetadata = new Port[outputs == null ? 0 : component.getNrOutPorts() - 1];
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link

Copilot AI commented Dec 18, 2025

@AtR1an I've opened a new pull request, #24, to work on those changes. Once the pull request is ready, I'll request review from you.

@sonarqubecloud
Copy link

@hornm-knime hornm-knime merged commit a2a51ce into master Dec 18, 2025
2 of 3 checks passed
@hornm-knime hornm-knime deleted the todo/AP-25344-properly-handle-failing-tools-i branch December 18, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants