Knowing These Secrets Will Turn Your Long-Running Workflows Into Something Amazing

Knowing These Secrets Will Turn Your Long-Running Workflows Into Something Amazing

In this article, we will take a look at how to create long-running workflows using AWS Step Functions and the Ballerina language. AWS Step Functions allow us to define state machines that can have tasks such as executing a Lambda function, inserting a message to a queue using AWS Simple Queue Service (SQS), messaging with AWS Simple Notification Service (SNS), and more.

Introduction

In this article, we will take a look at how to create long-running workflows using AWS Step Functions and the Ballerina language. AWS Step Functions allow us to define state machines that can have tasks such as executing a Lambda function, inserting a message to a queue using AWS Simple Queue Service (SQS), messaging with AWS Simple Notification Service (SNS), and more. This also encourages reusability by allowing existing services or functions to be composed. You can have rules for defining functionality such as error handling, automatic retry, and parallel processing.

But arguably the most important feature of creating workflows with Step Functions is the ability to control its execution with external input. We can pause, continue, or stop the workflows whenever we want. This is especially important when we need to have human interactions with the workflow. Here, we will look at a case study, where we generate a workflow that has steps that expect human interaction to complete its execution.

Case Study: Leave Approval System

This scenario is based on a system that tracks employees’ leave requests and routes the requests to their leads for approval. The lead will be sent an email with the subordinate’s request information, such as the date and their name, and he will click a link to approve or deny the leave request. This decision will be noted by the system, and an email with the decision will be sent to the employee who made the initial request.

Figure 1 shows the overall architecture of the system. 

Figure 1: Leave Approval System Architecture

ballerinalang serverless workflows stepfunctions aws programming ballerina amazon

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How To Unite AWS KMS with Serverless Application Model (SAM)

AWS KMS is a Key Management Service that let you create Cryptographic keys that you can use to encrypt and decrypt data and also other keys. You can read more about it here.

Serverless CI/CD on the AWS Cloud

To set up a serverless CI/CD pipeline in your AWS environments, there are several key services that you need to use. Find out more here.

AWS Serverless Kubernetes Infrastructure with Amazon EKS on AWS Fargate

AWS Serverless Kubernetes Infrastructure with Amazon EKS on AWS Fargate. Take a closer look at AWS Fargate, and find out how it can be used to create a serverless Kubernetes infrastructure that supports your application on EKS.

Setup —Serverless Machine Learning Inference with AWS Lambda + Amazon EFS

A step-by-step tutorial to set up ML inferences with AWS Lambda using its newly released integration with Amazon Elastic File System.

Amazon Web Services (AWS) - Serverless Architecture

Amazon Web Services (AWS) - Serverless Architecture. When I first started learning about AWS I thought of it as dark wizardry. Every time I touched the topic there was so much to learn that I immediately stopped, not knowing how to proceed.