Skip to content
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

Waits on Activity and not ActivityTask #2

Open
bedwards opened this issue Aug 5, 2021 · 1 comment
Open

Waits on Activity and not ActivityTask #2

bedwards opened this issue Aug 5, 2021 · 1 comment

Comments

@bedwards
Copy link

bedwards commented Aug 5, 2021

"Resource": "${wait_for_async_action_activity_arn}",

If I understand correctly the "wait" step is waiting on the Activity and not the ActivityTask. The inner state machine and lambda respond with send-success with the taskToken as a parameter. But that information seems to be lost in the wait step of the outer state machine.

A consequence would be that if I want to invoke the outer state machine multiple times in parallel, then a send-success for any taskToken would make all the outer state machines exit (or a random choice.) Either of those behaviors would cause havoc.

@marcin-sucharski
Copy link

This is described in the blog post: https://medium.com/semantive/part-1-asynchronous-actions-within-aws-step-functions-without-servers-f58e030a0e8b

Relevant part:

It is important to use the input from the GetActivityTask response and not the one passed to Lambda due to the fact that in the result of the GetActivityTask call we may get the Task Token for the Activity in any execution of any State Machine that uses this Activity.

In essence, the "Start asynchronous action" Task in outer State Machine is only for technical purposes and when interpreting execution flow you should look only into "Wait for asynchronous action" input and output.

Anyway, IIUC, in the meantime AWS implemented something similar as part of AWS Step Functions (Callback with Task Token and Nested Workflows) so it is preferred way to implement nested State Machines now.

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

No branches or pull requests

2 participants