You’re currently reading Part II of the Serverless Smart Radio article. Head over to read Part I if you missed it. In Part I, we made a introduction to our Smart Radio system and the technical components that are involved.

Abstract

In this article we will talk about Step functions, first a small introduction and looking at who is using it. Then we will dive deep into the workflow of our Smart Radio system.

Introduction

Design and run workflows that stitch together services such as AWS Lambda

Step functions are orchestration layer for your functions, simply put a step function is a pipeline.

Although AWS had already a service called Simple Workflow(SWF) (which is not that simple), Amazon decided to fill the gap by developing Step Functions to help users orchestrate Lambda functions or activities.

Here is a link to get you started with Step Functions

Step Function Concepts

AWS Step Functions allows you to coordinate individual tasks by expressing your workflow as a finite state machine

Designing State Machine

JSON based design language called ASL(Amazon States Language) that can be done in the interface helps you design your state machine. No drag drop, nothing fancy. You start typing in the editor, and the state machine starts to appear on the right pane. Nice addition is that there is a intellisense when you select a Task type, the UI will suggest available Lambda functions.

States

The following list contains the possible states that you can have in a step function definition.

Do some work in your state machine (a Task state).

Provide a delay for a certain amount of time or until a specified time/date (a Wait state)

Make a choice between branches of execution (a Choice state)

Stop an execution with a failure or success (a Fail or Succeed state)

Simply pass its input to its output or inject some fixed data (a Pass state)

Begin parallel branches of execution (a Parallel state)

Tasks

A task can be either a Activity or a Lambda Function. In our system, we only use Lambda functions. If you want to learn more about Activities, click here

Executions

You can use the AWS APIs or the user interface to look for the executions