-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stepfunctions: resultwriter on jsonata distributed maps fails deployments #33396
Comments
After analyzing the code and issue, here's what I found:
We need to ensure that when JSONata is enabled, the ResultWriter generates the correct field name. From the documentation, when using JSONata: [1] The Arguments and Output fields only support JSONata [2] The InputPath, Parameters, ResultSelector, ResultPath, OutputPath fields only support JSONPath Specifically, it states:
This means that when you opt-in to using JSONata in your Step Functions workflow: [3]
Confirmed this is a bug CDK should fix while workarounds are available. Short-term workaround: Use JsonPath instead of JSONata for now when using ResultWriter with DistributedMap. |
I'm escalating the team for inputs. |
Thanks Pahud for the detailed information and thanks @nywhere for reporting this issue. After deep dive, I think this is a valid issue and we should raise the priority to |
…#33423) ### Issue # (if applicable) Closes #33403 and #33374 and #33396. ### Reason for this change There are three issues here: 1. For summary, the first issue is basically that assign property cannot be accessed with using Map.jsonata(...) but available if we directly create map through new Map(...) using JSONATA query language. 2. For summary, the second issue is that JSONATA main PR added the outputs and assign property in the CatchProps interface for AddCatch functionality. But I don't think it's being used in the actual `addCatch` call https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts#L398. 3. Result writer and item reader class do not support using JSONATA. Deployment will fails due to if SFN is set to use JSONATA, it expects `Arguments` in the ASL instead of `Parameters`. ### Description of changes Fix both issues by fixing the interface inheritance and added the props to `AddCatch` method. Support `JSONATA` as the query language. ### Description of how you validated changes Added integ test and unit test to make sure that ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
### Issue # (if applicable) Closes #33403 and #33374 and #33396. ### Reason for this change There are three issues here: 1. For summary, the first issue is basically that assign property cannot be accessed with using Map.jsonata(...) but available if we directly create map through new Map(...) using JSONATA query language. 2. For summary, the second issue is that JSONATA main PR added the outputs and assign property in the CatchProps interface for AddCatch functionality. But I don't think it's being used in the actual `addCatch` call https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions/lib/states/state.ts#L398. 3. Result writer and item reader class do not support using JSONATA. Deployment will fails due to if SFN is set to use JSONATA, it expects `Arguments` in the ASL instead of `Parameters`. ### Description of changes Fix both issues by fixing the interface inheritance and added the props to `AddCatch` method. Support `JSONATA` as the query language. ### Description of how you validated changes Added integ test and unit test to make sure that ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Closing this issue as a PR to fix this is merged. Pending next release. |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
The following is working with DistributedMaps and JsonPath language:
With JSONata synth is ok, but the deployment fails with:
Resource handler returned message: "Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: These fields are required: [Arguments] at /States/Stages/ItemProcessor/States/Stage/ResultWriter'
Meanwhile step function UI designer does add "Arguments":
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
ResultWriter should still work with JSONata language
Current Behavior
ResultWriter only works with JsonPath language.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.178.1 (build ae342cb)
Framework Version
No response
Node.js Version
v18.16.0
OS
OSX 15.3
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: