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.

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.

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:
- Activity task – It tells an activity worker to perform its function, such as checking inventory or charging a credit card.
- Lambda task – It is similar to an Activity task but executes a Lambda function instead of a traditional Amazon SWF activity.
- 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.
- Workflow Type – A registered workflow type is identified by its name, domain, and version.
- Activity Type – A registered activity type is identified by its name, domain, and version.
- 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.
- 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.

Read more, Amazon Hirepro