fix: pass workflow inputs to success and failure actions - #2796
fix: pass workflow inputs to success and failure actions#2796harshit078 wants to merge 38 commits into
Conversation
🦋 Changeset detectedLatest commit: 3192f86 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.
|
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. |
|
|
||
| ## 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
There was a problem hiding this comment.
I think I got confused on my end a bit but I agree, I assumed that step was included along with success and failure. I read the docs but couldnt open the slack archive as account was not there in that community and I have made changes to only keep to success and failure and revamped my verbiage in arrazo rules and also spec-parmaters context.ts
There was a problem hiding this comment.
Here is my question to the community, in case you were not able to join =>
Hi All,
I have a question regarding the recent parameter updates in Arazzo 1.1.
Could you please clarify this behavior for me?
Should step level parameters without in be merged into Success/Failure Action Objects?
workflows:
- workflowId: someWorkflow
steps:
- stepId: someStep
operationId: create
parameters:
- name: sort
in: query
value: '-name'
- name: endDate
value: '2026-08-08'
onSuccess:
- name: successFlow
workflowId: successActionWorkflowId
type: goto
parameters:
- name: startDate
value: '2026-01-01'
Will the successActionWorkflowId workflow have two input parameters (startDate and endDate), or only one (startDate) ?
Thank you.
I will add more details here after the reply.
There was a problem hiding this comment.
@harshit078
Here is the replay from the community, please review and apply to your PR:
No, this should be a deliberate and selective process. When defining the parameters within a Success/Failure action that references a workflow, you are deliberately specifying what should be mapped into the workflow inputs based on the referenced workflowId .
While these could overlap with some or all of the parameters at the step level, there is no expectation that an implicit merge of parameters should happen.
| 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?
There was a problem hiding this comment.
yes I agree, I'll remove it. it is redundant to have it.
| ...basicCTX, | ||
| $workflows: { | ||
| 'get-bird-workflow': { steps: {}, inputs: {} }, | ||
| 'success-action-workflow': { steps: {}, inputs: {} }, |
There was a problem hiding this comment.
I will clarify this with the Arazzo community, but in my opinion, only inputs defined by the workflow JSON Schema should be passed to the workflow.
In practice, this would mean that when parameters without in are passed to a workflow, only those defined in workflow.inputs JSON schema would be available in the workflow runtime context through $inputs.
Currently all of inputs are passed, and this was the behavior before changes in this PR.
There was a problem hiding this comment.
Ok, lets wait till then !
There was a problem hiding this comment.
Hi @DmitryAnansky , any update from the community ?
There was a problem hiding this comment.
Hey @DmitryAnansky , any update so far ?
There was a problem hiding this comment.
Yes, we got the replay:
...the expectation is that all step parameters will be passed to the workflow and thus MUST be mappable to the workflow inputs JSON Schema.
Performance Benchmark (Lower is Faster)
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 3192f86. Configure here.
|
|
||
| Woohoo! Your API description is valid. 🎉 | ||
| ❌ Validation failed with 1 error. | ||
| run `redocly lint --generate-ignore-file` to add all problems to the ignore file. |
There was a problem hiding this comment.
Valid e2e fixture now fails lint
Medium Severity
The Arazzo 1.1 “valid description” fixture still defines parameters on a retry failure action without a workflowId. The new rule correctly flags that, but the snapshot was updated to expect failure instead of fixing the example, so the valid-description e2e no longer represents a valid document.
Reviewed by Cursor Bugbot for commit 3192f86. Configure here.
| arazzo1_1Rules: { | ||
| 'criteria-unique': 'off', | ||
| 'no-criteria-xpath': 'off', | ||
| 'spec-parameters-in-by-context': 'error', |
There was a problem hiding this comment.
Wrong minimal rule severity for 1.1
Medium Severity
In the minimal preset, spec-parameters-in-by-context is off for Arazzo 1.0 but error for Arazzo 1.1. Minimal configs are meant to stay lenient, and the rule docs advertise a default of off, so enabling it as error only under arazzo1_1Rules looks unintentional.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3192f86. Configure 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
Changes Arazzo validation defaults and Respect workflow execution when branching via actions; existing Arazzo files with invalid parameter usage may newly fail lint or behave differently at runtime.
Overview
Adds Arazzo 1.1 support for
parameterson success and failure actions, wired through Respect so those values become inputs on the target workflow when agotoaction references aworkflowId.Introduces the
spec-parameters-in-by-contextlint rule (documented and registered in preset configs): inline parameters must includeinon workflows and on steps that do not useworkflowId; actionparametersare only allowed when the action has aworkflowId, and action parameters use a dedicated schema/type withoutin(enforced bystruct).parameters-uniquenow also applies to action parameter lists.E2E lint for a sample Arazzo file now fails when
onFailuredefinesparameterswithoutworkflowId.Reviewed by Cursor Bugbot for commit 3192f86. Bugbot is set up for automated code reviews on this repo. Configure here.