- Step Functions coordinate multiple AWS services into serverless workflows using State Machines.
- A state machine is an abstract model which decides how one state moves to another based on a series of conditions. Think of a state machine like a flow chart.
- Step functions automatically triggers and tracks each step, and retries when there are errors, so your application executes in order and as expected, every time.
- Amazon States Language is how you define all your states and is written in JSON.
- There are two types of State Machines Available
1 Standard - General purpose, long workloads.
2 Express - Streaming data, short workloads.
- Use Cases for Step Functions
1 Manage a batch job, Fargate or ECS containter.
2 Sequential batch processing.
3 Creating a pipline to transcode media files.
4 Transferring data records, by performing operations on each record queued up via SQS.
5 Sequence steps of ML workflows.
6 Coordinate Extract, Transform and Load (ETL) Jobs.
- The type of Step Functions States
1 Pass State Passes its input to its output, without performing work (dummy/mock). Pass states are useful when constructing and debugging state machines.
2 Task State represents a single unit of work performed by a state machine.
1 Lambda - triggers a lambda function.
2 Activity - the work is performed by a worker that can be hosted on anywhere eg. EC2, ECS, mobile phones supported AWS services pass parameters to the API of an AWS service.
3 Choices State adds branching logic to a state machine.
4 Wait State delays the state machine from continuing for a specified time.
5 Succeed State stops an execution successfully.
6 Fail State stops the execution of the state machine and marks it as a failure.
7 Parallel State can be used to create parallel branches of execution in your state machine. The state machine does not move forward until both states complete.
8 Map state can be used to run a set of steps for each element of an input array.