What happens when I stop an execution in AWS Step Functions?

Viewed 5869

I was reading the API documentation an there's an action called StopExecution.

https://docs.aws.amazon.com/step-functions/latest/apireference/API_StopExecution.html

I was wondering what it does. Yes, of course, it stops the execution, but what if some task is running? Does it send a signal to stop the task like SWF does? Or just revoke the TaskToken (so the task cannot send the results back) and leave it running? Does the same happens if the task is a lambda function?

I was thinking about this because I have some long running tasks and could not find this behavior documented anywhere.

My guess: It just signals the execution as stopped and leave the task running. When the tasks calls SendTaskSuccess, it just receives an error like InvalidToken.

2 Answers

In the case of Batch job, it does stop the step and the Job Terminate with exitCode 1 and the following reason: Status reason: The Task state in AWS Step Functions execution [arn:aws:states:us-west-2:12345678912:execution:JobStateMachine:00000-c583-2050-f8b1-9d36e05f4266] which was managing this resource was aborted

Related