-
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: associateWithParent should place id alongside existing input #31788
Comments
Hi @snowe2010 , thanks for reaching out. Although I am not very familiar with usage of
so in case where input is not specified, the issue arises with overriding the flag value. In this case, your proposal makes sense but since this could be a breaking change, I would leave it upto team to decide on this change. Requesting team to share their insights on this FR and provide comments if this is something they think should be changed or can be improved. |
Hi @snowe2010 , could you provide an example CDK app for us to reproduce this issue? How are you defining/passing the input currently? From my understanding the |
Describe the feature
The
associateWithParent
flag should add a token to the existing payload when no input specified.State input:
associateWithParent:
Use Case
There is a significant amount of extra states needed to pass the original input with the
AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID
id to a StartExecution call. This makes it difficult to keep state machines compartmentalized.Imagine I have two state machines.
State Machine
"Alpha"
which is called by hundreds of services. It takes an object with several hundred fields.State Machine
"Beta"
which callsAlpha
.With the current functionality you cannot use
associateWithParent
at all, because of the way that Paths work. You'd need to specify each and every field from the original input which would be impossible to maintain. Instead you have to modifyBeta
to have two extraPass
states. The firstPass
creates a new payload with two separate nested fields, the original input and the executionId. Then the second takes and merges these top level fields and then filters the output.Pass 1:
Pass 2:
I'm not sure why you would ever need the current functionality, which is to completely erase the existing payload and replace it with the
AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID
. It seems like it would be impossible to actually pass any data to your State Machine. I can understand wanting to filter the output and place it directly alongside the execution id. No other CDK Step Function construct works this way, where if the input is not specified then the input is entirely erased and it is very confusing when you activateassociateWithParent
and suddenly your input is erased and replaced with a token you would expect to appear alongside your input.Proposed Solution
If an
input
(TaskInput) is not specified then it should just place theAWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID
directly alongside the existing task input. The task input should not be nested below another key.Turning on
associateWithParent
should do this to the input:to
NOT this:
If a TaskInput is specified in the
input
property then that should follow the existing documentation around adding fields to the input.Other Information
No response
Acknowledgements
CDK version used
software.amazon.awscdk:aws-cdk-lib:2.158.0
Environment details (OS name and version, etc.)
macOS Sonoma 14.7
The text was updated successfully, but these errors were encountered: