What is the AWS Flow Framework for Ruby?

The AWS Flow Framework for Ruby is a version of AWS Flow Framework designed for the Ruby programming language; it provides all of the benefits of the AWS Flow Framework while remaining true to idiomatic Ruby programming practices. Since the AWS Flow Framework handles the mechanics of coordinating workflow tasks and communicating with Amazon Simple Workflow Service, you can focus instead on developing the code that describes your workflow logic.

What's in this guide?#

Getting Started
Provides basic information for new users about how to set up and use the framework.
Flow Concepts
Describes the conceptual components of a flow application. Understanding these will help you to understand how Amazon SWF works and what parts of a workflow you are responsible for registering and implementing.
Basic Workflow Programming
Covers the basics of workflow programming, describing how to register domains, program activities and workflows, start task pollers, how to start a workflow execution, and how to set options.
Advanced Topics
Covers advanced workflow programming topics, such as setting task priority, programming workflow patterns, error handling, asynchronous programming, retrying workflows and troubleshooting.
Working with Other AWS Products
Describes how to use the AWS Flow Framework for Ruby in conjunction with other AWS services, such as CloudWatch, AWS OpsWorks, and Amazon EBS.
Utilities
Describes the command-line utilities provided with the AWS Flow Framework for Ruby that you can use to generate application skeletons and to start workers.
Additional Resources
Lists additional documentation, code samples, forums and videos that don't fit within this documentation.
Document History
Provides a history of this documentation, including a description of changes made with each major release.
Index
Provides an index of terms that can be used to navigate the documentation by keyword.

Important Notes About the AWS Flow Framework for Ruby#

Tested Ruby runtimes#

The AWS Flow Framework for Ruby has been tested with the official Ruby 1.9 runtime, also known as YARV. Newer versions of the Ruby runtime may work, but have not been tested extensively. Older versions of the Ruby runtime are unsupported.

Using the Framework on Microsoft Windows#

Although the AWS Flow Framework for Ruby has been tested on Windows, forking does not work unless you are using Cygwin to run Ruby.

If you are not using Cygwin, you will need to set use_forking to false in your WorkerOptions when using the AWS Flow Framework for Ruby on Windows.

AWS::Flow::ActivityWorker.new(
  @domain.client, @domain, ACTIVITY_TASKLIST, klass) { { use_forking: false } }

If you are using the aws-flow-ruby command to spawn workers on Windows, make sure that the number_of_forks_per_worker parameter in the activity_workers section is set to 0. The aws-flow-utils command will generate a suitable setup for you if you use the -c local argument on Windows. For more information, see aws-flow-ruby and aws-flow-utils.

Update :version whenever you update activity or workflow options#

Once registered, any workflow or activity type is immutable. Because a workflow or activity type is identified by a combination of its name and version, whenever you modify any registration options for the type, you must also update its version in order to register it as a new type.

The AWS Management Console and the AWS SDK for Ruby have different region defaults#

The AWS Management Console defaults to the us-west-2 region, but the AWS SDK for Ruby defaults to the us-east-1 region.

Because of this, be sure to set your AWS Management Console to the same region as the one in which you registered your Amazon SWF domain using the AWS Flow Framework for Ruby, or vice-versa. Otherwise, you won't see your registered domain in the AWS Management Console.

You can set the region used by the AWS SDK for Ruby by setting the :region option in :filename:`AWS.config`. For example:

AWS.config( {
  :access_key_id => 'ACCESS_KEY_ID',
  :secret_access_key => 'SECRET_ACCESS_KEY',
  :region => 'us-west-2',
} )

Where to Find the Source Code and Samples#

The AWS Flow Framework for Ruby is an open-source project. The source code is available on GitHub at:

Code samples and recipes for the AWS Flow Framework for Ruby are also available on GitHub at:

Framework and SDK References in the Text#

All classes and methods used by the AWS Flow Framework for Ruby reside in the AWS::Flow namespace. Because of this, AWS::Flow is usually dropped from the text when referring to the framework's classes or methods. For example, the AWS::Flow::Activities class is simply referred to as the Activities class, and the AWS::Flow#workflow_client method is simply referred to as the workflow_client method.

Classes and their methods that reside within the AWS::Flow namespace follow the same rule: AWS::Flow::Activities#activity is referred to as Activities#activity in the text, and AWS::Flow::Core::Future#get is referred to as Core::Future#get.

In some cases, references are made to the underlying AWS SDK for Ruby. For references such as these, the full namespace is always used. AWS::SimpleWorkflow and AWS::SimpleWorkflow::Domain are written in full form to distinguish them from any names in the AWS::Flow namespace.