Skip to content

fix: pass workflow inputs to success and failure actions#2796

Open
harshit078 wants to merge 26 commits into
Redocly:mainfrom
harshit078:pass-workflow-input-to-actions
Open

fix: pass workflow inputs to success and failure actions#2796
harshit078 wants to merge 26 commits into
Redocly:mainfrom
harshit078:pass-workflow-input-to-actions

Conversation

@harshit078
Copy link
Copy Markdown
Contributor

@harshit078 harshit078 commented May 4, 2026

What/Why/How?

  • Added the spec-parameters-in-by-context Arazzo rule
  • Added parameters property in interface of workflow for success and failure action objects.

Reference

#2735

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
New default-on lint rule can fail CI on existing Arazzo specs; Respect behavior changes when using action parameters on workflow goto actions.

Overview
Adds the spec-parameters-in-by-context Arazzo lint rule and wires it into built-in rulesets (error in spec / recommended-strict / all, warn in recommended). The rule enforces when parameter in must be present vs omitted (operation/workflow-level vs workflowId steps) and rejects parameters on success/failure actions unless the action references a workflowId.

Schema & lint: Introduces ActionParameter / ActionParameters (no in) on success/failure actions in core types and Respect’s Arazzo schema; extends parameters-unique to dedupe action parameters.

Respect runtime: onSuccess / onFailure actions with workflowId can pass parameters that are resolved into the target workflow’s inputs (shared mapParametersToWorkflowInputs in run-step), with tests covering onSuccess mapping.

Docs and changeset note that stricter presets may report new lint errors on existing Arazzo files.

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

🦋 Changeset detected

Latest commit: b12d4c7

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

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

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

@harshit078 harshit078 marked this pull request as ready for review May 8, 2026 10:20
@harshit078 harshit078 requested review from a team as code owners May 8, 2026 10:20
Comment thread packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts Outdated
Comment thread packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts Outdated
@AlbinaBlazhko17
Copy link
Copy Markdown
Contributor

Thanks @harshit078 for contribution! Please, fix the issue reported by bugbot. I left comment as well. Additionally, please add docs for a new rule.

@harshit078
Copy link
Copy Markdown
Contributor Author

Hey @AlbinaBlazhko17 , I have pushed a fix addressing both cursor and your comment along with addition of docs for spec-parameters-in-by-context hence made changes in v2 docs.


export const SpecParametersInByContext: Arazzo1Rule = () => {
return {
Step: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, add to this rule Workflowvisitor, because you miss, that Workflow also accepts parameters per arazzo.ts:179.

Comment thread .changeset/swift-otters-wander.md Outdated
Comment thread packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts Outdated
Comment thread docs/@v2/rules/arazzo/spec-parameters-in-by-context.md Outdated
Comment thread docs/@v2/rules/arazzo/spec-parameters-in-by-context.md Outdated
Comment thread packages/core/src/types/arazzo.ts Outdated
Comment thread packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts Outdated
@AlbinaBlazhko17
Copy link
Copy Markdown
Contributor

@harshit078 Could you please implement the new functionality with parameters in respect-core (run-step.ts), as the new lint rule you implemented supports the new behavior? However, the workflow runner is silently skipping the new parameters. This will create ambiguous behavior and we cannot merge just rule without fully support. I left minor comments regarding rule. Thank you in advance!

Comment thread packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts
Comment thread packages/core/src/rules/arazzo/__tests__/spec-parameters-in-by-context.test.ts Outdated
Comment thread packages/core/src/types/arazzo.ts Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8b47027. Configure here.

Comment thread packages/core/src/types/arazzo.ts
Comment thread packages/core/src/types/arazzo.ts
@harshit078
Copy link
Copy Markdown
Contributor Author

Hey @AlbinaBlazhko17 , I have addressed the comments you left and created a seperate parameter interface and used that. I am not sure on how to resolve the 2 failing test though. Thanks !

type: 'array',
items: parameter,
} as const;
export const actionParameter = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add please spacing between Parameters, actionParameter and actionParameters.

Comment thread packages/core/src/rules/arazzo/parameters-unique.ts Outdated
@AlbinaBlazhko17
Copy link
Copy Markdown
Contributor

Hi @harshit078! Almost done, left minor comments, otherwise looks good.
Let me help you with the issues in CI:

  • To fix error in build and unit run npm run unit -- -u. This command will regenerate the snapshot, because you've added new types.
  • To fix error in code-style-check run npm run format. We use as a formatter Oxfmt, so please, make sure, that you installed in your IDE Oxc extension and use this formatter for our CLI repository.

@harshit078
Copy link
Copy Markdown
Contributor Author

Hi @AlbinaBlazhko17 , I have tried doing both the commands and pushed the commit for it but the tests still fails. Is there something I might be doing wrong ?

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.

2 participants