Reputation: 5085
I have a state machine (AWS Step function). I invoke it from java code either to start or stop. How do I pause a state machine and resume it back.
Upvotes: 2
Views: 7981
Reputation: 2522
To pause the state machine you can add a manual approval step with API Gateway and call a GetActivityTask when you're ready to unpause. See more details in this tutorial https://aws.amazon.com/blogs/compute/implementing-serverless-manual-approval-steps-in-aws-step-functions-and-amazon-api-gateway/
Alternatively, if the java code where you need to pause the step function sends logs to CloudWatch and unpause is not required to be done immediately after your code complete (can wait 5 minutes), you can trigger the lambda steps to proceed after some event in the logs. For more details see https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-cloudwatch-events-target.html
Upvotes: 3