fix: pass workflow inputs to success and failure actions#2796
fix: pass workflow inputs to success and failure actions#2796harshit078 wants to merge 28 commits into
Conversation
🦋 Changeset detectedLatest commit: a58b507 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
Thanks @harshit078 for contribution! Please, fix the issue reported by bugbot. I left comment as well. Additionally, please add docs for a new rule. |
|
Hey @AlbinaBlazhko17 , I have pushed a fix addressing both cursor and your comment along with addition of docs for |
|
|
||
| export const SpecParametersInByContext: Arazzo1Rule = () => { | ||
| return { | ||
| Step: { |
There was a problem hiding this comment.
Please, add to this rule Workflowvisitor, because you miss, that Workflow also accepts parameters per arazzo.ts:179.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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.
|
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 = { |
There was a problem hiding this comment.
Add please spacing between Parameters, actionParameter and actionParameters.
|
Hi @harshit078! Almost done, left minor comments, otherwise looks good.
|
|
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 ? |
|
Hi @harshit078! You fixed first batch of errors. Let's fix the second:
|
|
Hey @AlbinaBlazhko17 , thank you for helping me out. The PR is good to go on the check side. |
| '@redocly/cli': minor | ||
| --- | ||
|
|
||
| Added the `spec-parameters-in-by-context` Arazzo rule, which validates that a parameter's `in` field is specified when the parent workflow, step, success action, or failure action does not reference a `workflowId`. Extended success and failure action objects to accept a `parameters` property that maps to workflow inputs. |
There was a problem hiding this comment.
Please make two separate changelog files:
- one with the: "Extended success and failure action objects to accept a
parametersproperty that maps to workflow inputs." - other with the rule updates: "Added the
spec-parameters-in-by-contextArazzo rule, which validates that a parameter'sinfield is specified when the parent workflow, step, success action, or failure action does not reference aworkflowId. "
|
|
||
| ## Design principles | ||
|
|
||
| The Arazzo specification states that when a step, success action, or failure action specifies a `workflowId`, all parameters map to the referenced workflow's inputs and the `in` field MUST NOT be specified. |
There was a problem hiding this comment.
@harshit078
Please correct me if I’m wrong, but this statement seems to be inaccurate.
The Arazzo specification only mentions this for Success Action Object and Failure Action Object but not for the step.
A list of parameters that MUST be passed to a workflow as referenced by workflowId. If a Reusable Object is provided, it MUST link to a parameter defined in the [components/parameters](https://spec.openapis.org/arazzo/latest.html#components-object) of the current Arazzo document. The list MUST NOT include duplicate parameters. The `in` field MUST NOT be used.
There was a problem hiding this comment.
There was a problem hiding this comment.
I’d also like to clarify whether step-level parameters that don’t include an in field should be merged into the success and failure action objects.
Here is my question for the community => https://open-api.slack.com/archives/C022K8VD7AP/p1780496931264819
| ## Design principles | ||
|
|
||
| The Arazzo specification states that when a step, success action, or failure action specifies a `workflowId`, all parameters map to the referenced workflow's inputs and the `in` field MUST NOT be specified. | ||
| In every other case (for example, when a step specifies an `operationId`, `operationPath`, or `x-operation`, or for parameters defined at the workflow level), the `in` field MUST be specified on each parameter. |
There was a problem hiding this comment.
The location of the parameter. Possible values are "path", "query", "querystring", "header", or "cookie". When the step, success action, or failure action in context specifies a workflowId, then all parameters map to workflow inputs. In all other scenarios (e.g., a step specifies an operationId), the in field MUST be specified.
As in is not REQUERED, it seems to be more like => when in is not specified - then those parameters will be mapped to the workflow input when workflowId used.
| operationId: createTicket | ||
| onSuccess: | ||
| - name: end-with-params | ||
| type: end |
There was a problem hiding this comment.
It seems like parameters also won't make sense when action type is end.
What do you think?
| value: { | ||
| oneOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }], | ||
| }, | ||
| 'x-allowReserved': { type: 'boolean' }, |
There was a problem hiding this comment.
Why do we need x-allowReserved here?

What/Why/How?
spec-parameters-in-by-contextArazzo ruleparametersproperty in interface of workflow for success and failure action objects.Reference
#2735
Testing
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Stricter default/spec rulesets can newly fail Arazzo lint on existing descriptions, and Respect workflow goto behavior changes when actions pass parameters.
Overview
Adds Arazzo
spec-parameters-in-by-contextso parameterinis required for workflow/step operation parameters and forbidden when the parent usesworkflowId; success/failure actions may only defineparameterswhen they reference aworkflowId. The model gainsActionParameter/ActionParametersononSuccess/onFailure,parameters-uniquecovers those lists, and Respectrun-stepmerges actionparametersinto the target workflow’sinputs(same helper as step → child workflow). Docs, changeset, and preset wiring (errorinspec/all/recommended-strict,warninrecommended) mean stricter Arazzo lint may surface new issues on existing files.Reviewed by Cursor Bugbot for commit 41b8546. Bugbot is set up for automated code reviews on this repo. Configure here.