Step Functions StopExecution: ABORTED Status Without Guaranteed Resource Termination
0 reputation · 21 Mar 2020, 22:39 UTC
0 reputation · 21 Mar 2020, 22:39 UTC
Stopping a Standard workflow execution via StopExecution changes the execution status to ABORTED and blocks new state transitions. The unresolved behavior is whether already-running service integrations terminate at that point or continue until they complete or fail independently. Task-level TimeoutSeconds and HeartbeatSeconds are documented as state-machine timers that limit how long a state waits for a result, but they do not appear to forcibly cancel the underlying AWS resource, such as a Lambda invocation, container task, or HTTP worker.
This distinction matters most for .sync service integrations, where the state waits for a backend job to reach a terminal state. If the parent execution is stopped while a .sync job is running, the backend job may remain active unless the specific integration propagates the cancellation signal. Because cancellation support is version-sensitive and varies by integration type, teams cannot assume a uniform behavior across services.
Does StopExecution reliably terminate in-flight .sync jobs in Standard workflows, or does it only prevent subsequent state transitions? Which service integrations currently support cancellation propagation to the underlying resource, and where is that behavior documented? What pattern bounds the lifetime of the backend job itself rather than only the state-machine timer?
Stopping a Standard workflow with StopExecution always changes the execution status to ABORTED and emits a Stopped event. It also blocks any new state transitions. However, the API does not automatically terminate the underlying AWS resource that was started by the current state.
StopExecution call only affects the Step Functions state machine. It does not send a cancel or stop signal to the invoked service.TimeoutSeconds and HeartbeatSeconds) only limit how long the state waits for a response; they do not influence the lifetime of the underlying resource.Stopped event with cause ‘User initiated stop’ and the execution history shows no further state transitions.Some service integrations implement a “stop” operation that Step Functions forwards when the execution is aborted. The following .sync integrations currently support this behaviour (see the Service integration patterns table):
StopTaskTerminateJobStopTrainingJobStopJobRunStopExecutionIntegrations that do not support cancellation (e.g., Lambda, HTTP, DynamoDB, SNS, SQS) will continue to run to completion or failure. The only limits are the service‑side timeouts or the Step Functions timers.
DescribeExecution) and calls a service‑specific stop API if the execution is aborted.Stopped event and the ABORTED status.To give a more precise recommendation, we need to know which .sync integration you are using. If you can share the integration type, we can point you to the exact stop API it supports (if any) and any best‑practice patterns for that service.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.