Introduction To… AWS Step Functions I

Are Step Functions something to do with my FitBit?

No, and that is probably a good thing given that my Fitbit has been hidden away in a drawer for most of lockdown!

Step functions are used in AWS. The steps orchestrate the sequence of events such as Lambda functions.

How Step Functions work

The image below represents a workflow, but there are a few keywords you should understand first:

State Machine: this is the workflow.

Task: this is a unit of work that is completed by another AWS service.

Each step of the above workflow is a state.

When to use Step Functions

The example that I am using Step Functions for right now is to delay an alert for an upcoming appointment. An appointment is set in the future, so the first “step” is a delay (or wait) step. Once the date of the appointment arrives, the first step is completed, and the next step triggers the Lambda.

There are countless other ways to use Step Functions. For example, for an automated security incident response. You can read more about the use cases in the AWS documentation (https://aws.amazon.com/step-functions/use-cases/).

How to try Step Functions out for yourself

Now if you want to try out these tools for yourself, log in to the AWS Console. In the search bar type in Step Functions.

This is where the functions are contained. If this is your first time creating one, this box will most likely be empty. Do not worry – I will help you create one.

  • Click the “Create state machine” button
  • Select the “use template” option
  • Browse these options
  • Select “Hello World”
  • The diagram will represent what the JSON on the left contains

You may notice that output of each step is hardcoded. This means that no matter what you change the input to be, the output will remain the same.

  • Go ahead and see. Start the execution.

You will see a screen which asks you to add your own input. Feel free to keep this the same or add your own JSON snippet.

  • Select continue.

You are back looking at the same diagram as before though the colours have changed. This demonstrates that the step functions have been deployed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: