AWS SDK for Java
Developer Guide

Amazon SWF Basics

These are general patterns for working with Amazon SWF using the AWS SDK for Java. It is meant primarily for reference. For a more complete introductory tutorial, see Building a Simple Amazon SWF Application.


Basic Amazon SWF applications will require the following dependencies, which are included with the AWS SDK for Java:

  • aws-java-sdk-1.11.*.jar

  • commons-logging-1.1.*.jar

  • httpclient-4.3.*.jar

  • httpcore-4.3.*.jar

  • jackson-annotations-2.5.*.jar

  • jackson-core-2.5.*.jar

  • jackson-databind-2.5.*.jar

  • joda-time-2.8.*.jar


the version numbers of these packages will differ depending on the version of the SDK that you have, but the versions that are supplied with the SDK have been tested for compatibility, and are the ones you should use.

AWS Flow Framework for Java applications require additonal setup, and additional dependencies. See the AWS Flow Framework for Java Developer Guide for more information about using the framework.


In general, you can use the following imports for code development:


It's a good practice to import only the classes you require, however. You will likely end up specifying particular classes in the workspace:

import; import; import; import;

If you are using the AWS Flow Framework for Java, you will import classes from the workspace. For example:

import; import;


The AWS Flow Framework for Java has additional requirements beyond those of the base AWS SDK for Java. For more information, see the AWS Flow Framework for Java Developer Guide.

Using the SWF client class

Your basic interface to Amazon SWF is through either the AmazonSimpleWorkflowClient or AmazonSimpleWorkflowAsyncClient classes. The main difference between these is that the *AsyncClient class return Future objects for concurrent (asynchronous) programming.

AmazonSimpleWorkflowClient swf = AmazonSimpleWorkflowClientBuilder.defaultClient();