'Why does AWS StepFunctions fail in one hour?

The structure of the StateMachine to be terminated in one hour

  1. Execute a script in EC2 by Send Command (SendCommand's TimeoutSeconds is 5000sec. I have written sleep 4000 in the script.)
  2. Check the result of script execution with GetCommandInvocation.
  3. wait(5sec)
  4. judge the result of 2. by Choice, return to 2. in case of InProgress.
  5. Execute "succsess" or "Fail" depending on the result in 4. (TimeoutSeconds for StateMachine is 5000sec)

Error Details

The process repeats from 2. to 4. until the end of the process.

GetCommandInvocation TaskSucceeded just before the StateMachine is terminated has the following contents. (excerpt)

"Status": "TimedOut"
"StatusDetails": "ExecutionTimedOut"

GetCommandInvocation TaskSucceeded, just before the StateMachine is terminated, has the following contents. (excerpt)

"Status": "TimedOut"

Choice is configured to "If Status is TimedOut, then Fail is executed next", so Fail is executed next and the process is finished.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source