Step Functions is a fully managed long-running, serverless workflow service that provides state machines.
AWS Step Functions
AWS Step Functions is a fully managed service that makes it easy to coordinate the components of distributed applications and microservices using visual workflows. It helps you building application from individual components that each perform a discrete function, which lets you scale the applications easily.
- Step Functions is a reliable way to coordinate components and step through the functions of your application. Step Functions provides a graphical console to arrange and visualize the components of your application as a series of steps.
- Step Functions logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly.
Using Step Functions
- Workflow steps are known as states, and they can perform work via tasks.
- Step Functions automatically triggers and tracks each step, and retries when there are errors, so your application runs in order and as expected.
- A state machine can be defined using JSON-based Amazon States Language (ASL). State machines maintain states (Lambda is a shot-running stateless function) and allow longer running processes.
- Tasks are performing actions.
- Activity is a program code that interacts with Step Functions using API actions (CreateStateMachine, StartExecution, StopExecution, GetActivityTask, SendTaskSuccess, SendTaskFailure …)
- Lambda function responds to the state machine tasks.
- State: Each state in a state machine makes decisions based on inputs, perform actions, and passes output.
- Task, Choice, Success, Fail, Pass, Wait, Parallel
Step functions replace SWF (Simple Work Function) with a serverless version.
- To make a decision, SWF uses a decider program, and Step Functions use a JSON-based state machine.
- Step Functions provides the visual workflows.
- Step Functions orchestrate multiple AWS resources.
- SWF provides complete control over the workflow but increases the complexity.