Transcription of Workflow Service Amazon Simple - AWS Documentation
1 Amazon SimpleWorkflow ServiceDeveloper GuideAPI Version 2012-01-25 Amazon Simple Workflow Service Developer GuideAmazon Simple Workflow Service : Developer GuideCopyright 2018 Amazon Web services , Inc. and/or its affiliates. All rights 's trademarks and trade dress may not be used in connection with any product or Service that is not Amazon 's, in any mannerthat is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon . All other trademarks notowned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored Simple Workflow Service Developer GuideTable of ContentsWhat is Amazon SWF? .. 1 Development Options .. 1 AWS SDKs .. 1 AWS Flow Framework .. 2 HTTP Service API .. 2 Development Environments .. 3 Introduction to Amazon SWF .. 4 Concepts .. 4 Workflow Execution .. 5 Setting Up.
2 7 AWS Account and Access Keys .. 7 Endpoints.. 8 Getting Started .. 9 About the Workflow.. 9 Prerequisites .. 10 Download the Source Code .. 10 Tutorial Steps .. 10 Part 1: Using Amazon SWF with the SDK for Ruby .. 11 Include the AWS SDK for Ruby .. 11 Configuring the AWS Session .. 11 Registering an Amazon SWF Domain .. 12 Next Steps .. 13 Part 2: Implementing the Workflow.. 13 Designing the Workflow.. 13 Setting up our Workflow Code .. 14 Registering the Workflow.. 15 Polling for Decisions .. 16 Starting the Workflow Execution .. 18 Next Steps .. 19 Part 3: Implementing the Activities .. 19 Defining a Basic Activity Type .. 19 Defining GetContactActivity .. 21 Defining SubscribeTopicActivity .. 22 Defining WaitForConfirmationActivity .. 24 Defining SendResultActivity .. 26 Next Steps .. 27 Part 4: Implementing the Activities Task Poller.
3 27 Running the Workflow.. 29 Where Do I Go from Here? .. 32 Tutorials .. 33 Registering a Domain .. 33 Registering a Workflow Type .. 34 Registering an Activity Type .. 36 Starting a Workflow Execution .. 37To start a workflow execution using the console .. 37 Viewing Pending Tasks .. 39 Managing Your Workflow Executions .. 39 How Amazon SWF Works .. 43 Workflows .. 43 What is a Workflow? .. 43A Simple Workflow Example: an E-Commerce Application .. 43 Workflow Registration and Execution .. 44 See Also.. 45 Workflow History .. 45 API Version 2012-01-25iiiAmazon Simple Workflow Service Developer GuideActors .. 48 What is an Actor in Amazon SWF? .. 48 Workflow Starters .. 49 Deciders.. 49 Activity Workers .. 50 Data Exchange Between Actors .. 50 Tasks .. 50 Domains.. 51 Object Identifiers .. 52 Task Lists .. 52 Decision Task Lists.
4 52 Activity Task Lists .. 53 Task Routing .. 53 Workflow Execution Closure .. 53 Life Cycle of an Amazon SWF Workflow Execution .. 54 Workflow Execution Life Cycle .. 54 Polling for Tasks .. 58 Advanced Concepts .. 58 Versioning .. 58 Signals.. 59 Child Workflows .. 59 Markers .. 60 Tags .. 61 Implementing Exclusive Choice .. 61 Timers.. 63 Signals.. 63 Activity Task Cancellation .. 64 Markers .. 66 Tagging .. 67 Monitoring and Logging.. 68 Amazon SWF Metrics for CloudWatch .. 68 Reporting Units for Amazon SWF Metrics .. 68 API and Decision Event Metrics .. 69 Amazon SWF Metrics .. 69 Viewing Amazon SWF Metrics .. 74 Viewing Metrics.. 74 Setting Alarms .. 76 Logging Amazon SWF API Calls with CloudTrail .. 77 Amazon SWF Information in CloudTrail .. 78 Example: Amazon SWF Log File Entries .. 78 Security .. 83 Managing Access with IAM.
5 83 Basic Principles.. 83 Amazon SWF IAM Policies .. 84 API Summary .. 89 Using the AWS CLI .. 95 Working with APIs .. 96 Making HTTP Requests .. 96 HTTP Header Contents .. 96 HTTP Body Content .. 98 Sample JSON Request and Response .. 98 Calculating the HMAC-SHA Signature .. 99 List of Amazon SWF Actions .. 100 Actions Related to Activities .. 101 Actions Related to Deciders .. 101 Actions Related to Workflow Executions .. 101 Actions Related to Administration .. 101 API Version 2012-01-25ivAmazon Simple Workflow Service Developer GuideVisibility Actions .. 102 Creating a Basic Workflow.. 103 Modeling Your Workflow and Its Activities .. 103 Registering a Domain .. 103 See Also.. 104 Setting Timeout Values .. 104 Limits on Timeout Values .. 104 Workflow Execution and Decision Task Timeouts .. 104 Activity Task Timeouts .. 105 See Also.
6 105 Registering a Workflow Type .. 105 See Also.. 106 Registering an Activity Type .. 106 See Also.. 106 Lambda Tasks .. 106 About AWS Lambda .. 107 Benefits and Limitations of using Lambda Tasks .. 107 Using Lambda tasks in your workflows .. 107 Developing an Activity Worker .. 110 Polling for Activity Tasks .. 110 Performing the Activity Task .. 111 Reporting Activity Task Heartbeats .. 111 Completing or Failing an Activity Task .. 112 Launching Activity Workers .. 113 Developing Deciders .. 113 Defining Coordination Logic .. 114 Polling for Decision Tasks .. 114 Applying the Coordination Logic .. 115 Responding with Decisions .. 116 Closing a Workflow Execution .. 117 Launching Deciders.. 117 Starting Workflow Executions .. 118 Setting Task Priority .. 119 Setting Task Priority for Workflows .. 119 Setting Task Priority for Activities.
7 121 Actions that Return Task Priority Information .. 121 Handling Errors .. 122 Validation Errors .. 122 Errors in Enacting Actions or Decisions .. 122 Timeouts.. 123 Errors raised by user code .. 123 Errors related to closing a workflow execution .. 123 Limits.. 124 General Account Limits for Amazon SWF .. 124 Limits on Workflow Executions .. 124 Limits on Task Executions .. 125 Amazon SWF throttling limits .. 126 Throttling Limits for Small Regions .. 126 Throttling Limits for Medium Regions .. 128 Throttling Limits for Large Regions .. 129 Requesting a Limit Increase .. 130 Resources .. 131 Timeout Types .. 131 Timeouts in Workflow and Decision Tasks .. 131 Timeouts in Activity Tasks .. 132 Endpoints.. 134 Additional Documentation .. 134 API Version 2012-01-25vAmazon Simple Workflow Service Developer GuideAmazon Simple Workflow Service API Reference.
8 134 AWS Flow Framework Documentation .. 134 AWS SDK Documentation .. 135 AWS CLI Documentation .. 136 Web Resources .. 136 Amazon SWF Forum.. 136 Amazon SWF FAQ.. 137 Amazon SWF Videos .. 137 Amazon SWF Source Code and Samples .. 137 Ruby Flow Options .. 138 Continue to use the Ruby Flow Framework .. 138 Migrate to the Java Flow Framework .. 138 Migrate to Step Functions .. 139 Use the Amazon SWF API directly .. 139 Document History .. 140 AWS Glossary .. 142 API Version 2012-01-25viAmazon Simple Workflow Service Developer GuideDevelopment OptionsWhat is Amazon Simple WorkflowService?The Amazon Simple Workflow Service ( Amazon SWF) makes it easy to build applications that coordinatework across distributed components. In Amazon SWF, a task represents a logical unit of work that isperformed by a component of your application. Coordinating tasks across the application involvesmanaging intertask dependencies, scheduling, and concurrency in accordance with the logical flow of theapplication.
9 Amazon SWF gives you full control over implementing tasks and coordinating them withoutworrying about underlying complexities such as tracking their progress and maintaining their using Amazon SWF, you implement workers to perform tasks. These workers can run either oncloud infrastructure, such as Amazon Elastic Compute Cloud ( Amazon EC2), or on your own can create tasks that are long-running, or that may fail, time out, or require restarts or thatmay complete with varying throughput and latency. Amazon SWF stores tasks and assigns them toworkers when they are ready, tracks their progress, and maintains their state, including details ontheir completion. To coordinate tasks, you write a program that gets the latest state of each task fromAmazon SWF and uses it to initiate subsequent tasks. Amazon SWF maintains an application's executionstate durably so that the application is resilient to failures in individual components.
10 With Amazon SWF,you can implement, deploy, scale, and modify these application components SWF offers capabilities to support a variety of application requirements. It is suitable for a rangeof use cases that require coordination of tasks, including media processing, web application back-ends,business process workflows, and analytics OptionsYou have a number of options for implementing your workflow solutions with the Amazon SimpleWorkflow AWS SDKs (p. 1) AWS Flow Framework (p. 2) HTTP Service API (p. 2) Development Environments (p. 3)AWS SDKsAmazon SWF is supported by the AWS SDKs for Java, .NET, , PHP, PHP version 2, Python andRuby, providing a convenient way to use the Amazon SWF HTTP API in the programming language ofyour can develop deciders, activities, or workflow starters using the API exposed by these , you can access visibility operations through these libraries so you can develop your ownAmazon SWF monitoring and reporting download any of the AWS SDKs, go to Version 2012-01-251 Amazon Simple Workflow Service Developer GuideAWS Flow FrameworkFor detailed information about the Amazon SWF methods in each SDK, refer to the language-specificreference Documentation for the SDK you are is a list of the available AWS SDK Documentation .