Skip to content

fix(respect): referenced workflow execution flow inconsistency#2966

Open
DmitryAnansky wants to merge 1 commit into
mainfrom
fix/respect-referenced-workflow-execution-inconsistency
Open

fix(respect): referenced workflow execution flow inconsistency#2966
DmitryAnansky wants to merge 1 commit into
mainfrom
fix/respect-referenced-workflow-execution-inconsistency

Conversation

@DmitryAnansky

@DmitryAnansky DmitryAnansky commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

Fixed respect to stop parent workflow execution when a step that references another workflow fails. Previously, the next steps of the parent workflow were still executed after the referenced workflow failed.

Reference

Closes: #2963

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Medium Risk
Changes core workflow control flow for nested workflows; behavior shifts for specs that relied on continuing after a failed child, though that was the reported bug.

Overview
Respect now treats a referenced child workflow like a failed API step: when the nested run has failing steps, runStep runs onFailure actions and can shouldEnd the parent instead of always continuing.

After runWorkflow returns, calculateTotals detects child failure. On failure, failure handlers run (including goto); if none apply, execution ends with shouldEnd: true. onSuccess runs only when the child did not fail.

Unit coverage asserts the parent stops when the child has failed checks; workflow-step tests mock successful child runs. E2E max-steps adds onFailure on the nested-workflow step so failure recovery matches the new flow.

Reviewed by Cursor Bugbot for commit cb2139a. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cb2139a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/respect-core Patch
@redocly/cli Patch
@redocly/openapi-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.96% (🎯 69%) 8683 / 12066
🔵 Statements 71.64% (🎯 69%) 9034 / 12609
🔵 Functions 76.63% (🎯 73%) 1719 / 2243
🔵 Branches 63.46% (🎯 61%) 5851 / 9219
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/respect-core/src/modules/flow-runner/run-step.ts 89.62% 79.36% 100% 89.31% 146-152, 175, 183-185, 195-201, 367-375, 379, 404, 407, 431
Generated in workflow #10853 for commit cb2139a by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
cli-latest ▓ 1.02x ± 0.01 ▓ 1.00x ± 0 ▓ 1.01x ± 0.01
cli-next ▓ 1.00x (Fastest) ▓ 1.00x (Fastest) ▓ 1.00x (Fastest)

@DmitryAnansky DmitryAnansky added the snapshot Create experimental release PR label Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1784905704 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1784905704

⚠️ Note: This is a development build and may contain unstable features.

@DmitryAnansky
DmitryAnansky marked this pull request as ready for review July 24, 2026 15:49
@DmitryAnansky
DmitryAnansky requested review from a team as code owners July 24, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect doesn't stop workflow execution on failed sub-workflows

1 participant