Skip to content

feat: implement workflow connectivity validation to ensure all nodes are reachable from start#809

Merged
hanorik merged 2 commits into
google:wolo/workflowsfrom
hanorik:connect_validator
May 15, 2026
Merged

feat: implement workflow connectivity validation to ensure all nodes are reachable from start#809
hanorik merged 2 commits into
google:wolo/workflowsfrom
hanorik:connect_validator

Conversation

@hanorik
Copy link
Copy Markdown
Contributor

@hanorik hanorik commented May 8, 2026

This PR introduces validation to ensure that all nodes in a workflow graph are reachable from the Start node. This prevents orphaned nodes that can never be executed, ensuring the graph is fully connected and valid.

Key Changes:

  • validation.go: Added logic to traverse the workflow graph and verify that every registered node has at least one path leading to it from the start.
  • workflow.go: Integrated the connectivity check into the workflow initialization/validation process.
  • Tests: Added unit tests in validation_test.go to cover valid connected graphs and invalid disconnected graphs.

@hanorik hanorik requested review from anFatum and wolo-lab May 8, 2026 11:09
@hanorik hanorik force-pushed the connect_validator branch 2 times, most recently from 839de78 to 26d4538 Compare May 8, 2026 11:36
Comment thread workflow/validation.go Outdated
@hanorik hanorik force-pushed the connect_validator branch from 26d4538 to 5c985c8 Compare May 11, 2026 13:16
@hanorik hanorik requested a review from wolo-lab May 11, 2026 13:17
@hanorik hanorik force-pushed the connect_validator branch from 5c985c8 to c50c144 Compare May 11, 2026 17:45
Copy link
Copy Markdown

@wolo-lab wolo-lab left a comment

Choose a reason for hiding this comment

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

be careful while merging with 808

Comment thread workflow/validation.go Outdated
@hanorik hanorik force-pushed the connect_validator branch from c50c144 to 3a6b38a Compare May 15, 2026 14:30
@hanorik hanorik force-pushed the connect_validator branch from 6fa036f to 81411a2 Compare May 15, 2026 14:39
@hanorik hanorik merged commit da5fba5 into google:wolo/workflows May 15, 2026
1 check passed
wolo-lab added a commit that referenced this pull request May 16, 2026
…mpt/goimports

CI lint job started failing after PR #809 introduced unformatted
slice literals in validation_test.go and an unordered import group
in graph_test.go. gofumpt and goimports flag both. Fix is purely
formatting — no behaviour change.
wolo-lab pushed a commit that referenced this pull request May 18, 2026
wolo-lab added a commit that referenced this pull request May 18, 2026
…mpt/goimports

CI lint job started failing after PR #809 introduced unformatted
slice literals in validation_test.go and an unordered import group
in graph_test.go. gofumpt and goimports flag both. Fix is purely
formatting — no behaviour change.
wolo-lab pushed a commit that referenced this pull request May 25, 2026
wolo-lab pushed a commit that referenced this pull request Jun 2, 2026
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.

3 participants