Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
How does Amazon SWF work?
2.1.
Amazon SWF Workflows
2.2.
Amazon SWF Workflow History
2.3.
Amazon SWF Actors
2.4.
Amazon SWF Tasks
2.5.
Amazon SWF Domains
2.6.
Amazon SWF Object Identifiers
2.7.
Amazon SWF Task Lists
2.8.
Amazon SWF Workflow Execution Closure
2.9.
Life Cycle of an Amazon SWF Workflow Execution
3.
Security in Amazon Simple Workflow Service
3.1.
Data protection in Amazon Simple Workflow Service
3.2.
Identity and Access Management in Amazon Simple Workflow Service
3.3.
Compliance Validation for Amazon Simple Workflow Service
3.4.
Resilience in Amazon Simple Workflow Service
4.
Frequently Asked Questions
4.1.
What is a workflow process?
4.2.
What are some of the benefits of using AWS SWF? Give an example of a simple workflow.
4.3.
What are the three phases of workflow?
4.4.
What is AWS airflow?
4.5.
What is workflow used for?
5.
Conclusion
Last Updated: Mar 27, 2024
Easy

Amazon Simple Workflow Service

Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

Amazon SWF (Simple Workflow Service) is anAmazon Web Services tool that helps developers track, coordinate and audit multi-machine, multi-step application jobs. A developer can access Amazon SWF through the AWS Management Console, SWF APIs, or AWS SDK.

Amazon Simple Workflow Service enables a developer to manage schedules, dependencies, load distribution, and other associations with each worker. The AWS Flow Framework feature helps a developer build an asynchronous workflow.

How does Amazon SWF work?

Amazon SWF Workflows

Using the Amazon Simple Workflow Service (Amazon SWF), you can implement asynchronous, distributed, applications as workflows. The workflow's coordination logic determines the order in which activities are performed.

A Simple Workflow Example: an E-Commerce Application

For example: The following figure shows a simple e-commerce order-processing workflow involving people and automated processes.


               Sample Workflow Overview

Image source

Amazon SWF Workflow History

The progress of every workflow execution is recorded in its workflow history, which Amazon SWF maintains. The workflow history is a complete,  detailed, and consistent record of every event since the workflow execution started.

Amazon SWF Actors

In its operations, Amazon SWF interacts with several types of programmatic actors. Actors can be deciders, workflow starters, or activity workers. These actors communicate with Amazon SWF through its API. We can create these actors in any programming language.

The diagram below depicts the Amazon SWF architecture, including Amazon SWF and its actors.


               The different entities or "actors" in an Amazon SWF workflow.

 

Image source

Amazon SWF Tasks

Amazon SWF interacts with deciders and activity workers by providing them with work assignments known as tasks. The 3 types of tasks in Amazon SWF are:

  1. Activity task – It tells an activity worker to perform its function, such as checking inventory or charging a credit card. 
  2. Lambda task – It is similar to an Activity task but executes a Lambda function instead of a traditional Amazon SWF activity. 
  3. Decision task – It contains the current workflow history.

Amazon SWF Domains

Domains provide a method of scoping Amazon SWF resources within our AWS account. All the workflow components, such as workflow and activity types, must be specified to be in a domain. It is feasible to have more than one workflow in a domain; however, workflows in different domains cannot interact with each other.

Amazon SWF Object Identifiers

The following list describes how Amazon SWF objects are uniquely identified, such as workflow executions.

  1. Workflow Type – A registered workflow type is identified by its name, domain, and version. 
  2. Activity Type – A registered activity type is identified by its name, domain, and version. 
  3. Decision Tasks and Activity Tasks – A unique task token identifies each decision task and activity task. The task token is generated by Amazon SWF and is returned with other information about the task in the response from PollForDecisionTask or PollForActivityTask. 
  4. Workflow Execution – A single execution of a workflow is identified by the domain, workflow ID, and run ID.

Amazon SWF Task Lists

Task lists provide a method of organizing the different tasks associated with a workflow. We can think of task lists as similar to dynamic queues.

Amazon SWF Workflow Execution Closure

As soon as we begin a workflow execution, it is open. An open workflow execution could be closed, failed, canceled, or timed out. It could be terminated or could also be continued as a new execution. A workflow implementation could be closed by the decider, the person administering the workflow, or Amazon SWF.

Life Cycle of an Amazon SWF Workflow Execution

Amazon SWF interacts with actors by allocating appropriate tasks, either decision tasks or activity tasks, from the beginning of a workflow execution to its completion. The diagram below depicts the life cycle of an order-processing workflow execution from the perspective of components that act on it.

Image source

Read more, Amazon Hirepro

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Security in Amazon Simple Workflow Service

Data protection in Amazon Simple Workflow Service

The AWS responsibility model applies to Amazon Simple Workflow Service data protection. As described in this model, AWS is accountable for protecting the global infrastructure that runs all of the AWS Cloud.

Identity and Access Management in Amazon Simple Workflow Service

Access to AWS Step Functions needs credentials that AWS can use to authenticate our requests. Those credentials must have approvals to access AWS resources, such as retrieving event data from other AWS resources. We can use AWS IAM and Step Functions to help secure our resources by controlling who can access them:

  1. Authentication
  2. Access Control

Compliance Validation for Amazon Simple Workflow Service

Third-party auditors assess the compliance and security of Amazon Simple Workflow Service as part of multiple AWS compliance programs. These include FedRAMP, SOC, PCI, HIPAA, and others. Our compliance responsibility when using Amazon SWF is determined by the sensitivity of our data, our company's compliance goals, and applicable laws and regulations. 

Resilience in Amazon Simple Workflow Service

The AWS global infrastructure is built around AWS Regions and Availability Zones. AWS Regions provide multiple physically separated and isolated Availability Zones, which are connected with low-latency, high-throughput, and highly redundant networking. With Availability Zones, you can operate and design applications and databases that automatically failover between zones without interruption. Availability Zones are more highly available, fault-tolerant, and scalable than traditional single or multiple data center infrastructures.

Frequently Asked Questions

What is a workflow process?

"Workflow process" refers to a sequence of activities or tasks that must be completed parallelly or in series to achieve a business outcome.

What are some of the benefits of using AWS SWF? Give an example of a simple workflow.

Some benefits of using Amazon SWF are that it is scalable, reliable, simple, and logical. 

Here is an example of a workflow involving various people: A freelancer creates an invoice and sends it to their client. The client transmits the invoice to their finance department. The finance department authorizes the invoice and processes the payment.

What are the three phases of workflow?

Each workflow component can be described by three parameters: input, transformation, and output.

What is AWS airflow?

Airflow is an open-source tool utilized to programmatically schedule, author, and monitor sequences of processes and tasks referred to as "workflows." 

What is workflow used for?

A workflow helps us see where to automate easy tasks such as sending work items from a particular employee to the next in a process that requires various people to complete specific tasks in a specific order. Automation makes it simple to analyze business operations, prepare for risks, see trends, and plan for expansion.

Conclusion

We hope this article helps you provide some meaningful insights on AWS Simple Workflow Services. We learned about its basic working, and definition and discussed security in the SWF services.

Check out the Amazon Interview Experience to learn about Amazon’s hiring process.

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, System Design, JavaScript, etc. Enroll in our courses, refer to the mock test and problems available, interview puzzles, and look at the interview bundle and interview experiences for placement preparations.

We hope that this blog has helped you increase your knowledge regarding AWS Step functions, and if you liked this blog, check other links. Do upvote our blog to help other ninjas grow. Happy Coding!"

Previous article
Amazon Simple Queue Service
Next article
SQS in AWS
Live masterclass