Basic workflow concepts in Amazon SWF - Amazon Simple Workflow Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Basic workflow concepts in Amazon SWF

Note

The concepts in this chapter provide an overview of the Amazon Simple Workflow Service and describe its major features. If you are looking for examples, see Working with Amazon SWF APIs.

Using the Amazon Simple Workflow Service (Amazon SWF), you can implement distributed, asynchronous applications as workflows. Workflows coordinate and manage the execution of activities that can be run asynchronously across multiple computing devices and that can feature both sequential and parallel processing.

When designing a workflow, you analyze your application to identify its component tasks. In Amazon SWF, these tasks are represented by activities. The order in which activities are performed is determined by the workflow's coordination logic.

Example workflow for an e-commerce application

The following figure shows an e-commerce order-processing workflow involving both people and automated processes:

Illustrative e-commerce example workflow

The e-commerce application workflow starts when a customer places an order, and includes four tasks:

  1. Verify the order.

  2. If the order is valid, charge the customer.

  3. If the payment is made, ship the order.

  4. If the order is shipped, save the order details.

The tasks in this workflow are sequential: an order must be verified before a credit card can be charged; a credit card must be charged successfully before an order can be shipped; and an order must be shipped before it can be recorded. Even so, because Amazon SWF supports distributed processes, these tasks can be carried out in different locations. If the tasks are programmatic in nature, they can also be written in different programming languages or using different tools.

In addition to sequential processing of tasks, Amazon SWF also supports workflows with parallel processing of tasks. Parallel tasks are performed at the same time, and may be carried out independently by different applications or human workers. Your workflow makes decisions about how to proceed once one or more of the parallel tasks have been completed.