Introduction to Cloud Based Workflow Management Service – Amazon SWF

Amazon Simple Workflow (Amazon SWF) is a cloud-based workflow management service. It is a workflow service for realizing scalable and fault-tolerant application construction. This service makes it possible to build highly fault-tolerant applications distributed over multiple systems (cloud system or on-premises system). Amazon SWF is a service that controls the flow of synchronous and asynchronous tasks (logical application steps). With this service, users can concentrate on business and applications, not infrastructure.

By using Simple Workflow, it can be used not only for existing business processes (such as order processing and addition of new employees) but also processing complex decision-making processes for complex multi-tier applications. It can handle various kinds of workflows more easily.

Benefits of Amazon SWF Service

  • Easy to Use – Amazon SWF uses a common programming language, SDK is also prepared by AWS, so it is easy to operate.
  • Easy Addition / Deletion of Workflow – The loose coupling model is adopted in Amazon SWF. Since each workflow is independent and flexible, each workflow does not affect the work of the entire application even if a change occurs in the workflow as it builds the application. As a result, adding or deleting workflows can be done easily, and it is possible to respond promptly.
  • On-Premise Cooperation is Possible – In the workflow, since the AWS environment and the on-premises environment can be linked, it is possible to realize a workflow via people in the middle of the workflow.

Characters in Amazon SWF

Starter – Starter is responsible for creating work items and issuing them to the workflow system. Also, one can issue work items in parallel from multiple starters. In addition to input data from the starter, the work item has information called ‘event history’. It is almost empty right after the start, but as the flow goes forward, the history such as what kind of processing has gone through and what the result was like is added.

Worker – It performs actual processing at each stage of the flow. Also, the process that the worker executes is called activity. Depending on the activity in charge, there may be multiple types of workers. There may be more than one kind of worker of the same kind.

Decider – It has the role of deciding which activity should be executed next according to the state of each work item (event history etc.). Decider can handle parallel processing by multiple nodes. In each case, the SWF inquires the decider ‘What to do next?’ and schedules the next processing of the work item according to the result.

Other Important Concepts in SWF

SWF is part of the workflow. Workflow is organized by decider. In some cases, multiple workflows may share the same activity. The concept that plays a role of bundling related elements (activity + workflow) is called Domain in SWF. Also, the scheduling of DecisionTask and ActivityTask is done in a queue-like place called TaskList. Each task is queued in TaskList and it is allocated to each decider and worker. Although it is an application method, it is also possible to control the routing of work items by preparing multiple Task Lists.

What does Simple Workflow do for us?

  • Save workflow and metadata about each part
  • Save the task for the worker and queue until the worker needs it
  • Assign task to worker
  • Route information between workflow execution and related workers
  • You can track the progress of the worker in the task and set the timeout
  • Maintain workflow state redundantly

Simple Workflow API Foundation

One can also create workflows, workers, and deciders with several Simple Workflow APIs.

AWS Management Console support

AWS Management Console fully supports Amazon Simple Workflow.