Slide 1

Slide 1 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rob Sutter, Sr. Developer Advocate 29 July 2020 AWS Step Functions Orchestrating distributed business workflows

Slide 2

Slide 2 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda Orchestrating distributed business workflows • What are AWS Step Functions? • Nested workflows • Dynamic parallelism • Express Workflows • AWS Toolkit for Visual Studio Code support • AWS CodeBuild service integration • AWS SAM support • AWS CDK support • Error handling

Slide 3

Slide 3 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Who am I? Rob Sutter - [email protected] • Senior Developer Advocate - Serverless • Gopher and Scala type • Previously: • Co-founded WorkFone, a SaaS startup • Infrastructure at an e-commerce startup • Consulting, government, odd jobs here and there • The Florida State University, Management Information Systems ’05 • Twitch: /robsutter • Twitter: @rts_rob

Slide 4

Slide 4 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are AWS Step Functions?

Slide 5

Slide 5 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are AWS Step Functions? Serverless workflows that help you: • Build and update apps quickly • Improve resiliency • Write less code • Orchestrate long-running tasks • Modernize monoliths • Integrate with managed services • Handle errors and retries AWS Step Functions

Slide 6

Slide 6 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless workflows Define Visualize Monitor

Slide 7

Slide 7 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is serverless? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure

Slide 8

Slide 8 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Nested workflows

Slide 9

Slide 9 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Nested workflows • Build larger, more complex workflows out of smaller, simpler workflows • Create reusable building blocks and build faster • Swap workflow modules without customizing code • Return a string or a JSON object

Slide 10

Slide 10 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dynamic parallelism

Slide 11

Slide 11 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dynamic parallelism • “Map State” • Run identical tasks in parallel • Fanout pattern – dispatch a list of identical tasks to simplify workflows like order processing and instance management • Scatter-gather pattern – accelerate workflows such as file processing

Slide 12

Slide 12 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Express Workflows

Slide 13

Slide 13 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Express Workflows Express Workflows Standard Workflows Maximum duration 5 minutes 1 year Execution start rate Over 100,000/s Over 2,000/s State transition rate Nearly unlimited Over 4,000/s Pricing GB (memory) * s (time) Per state transition Execution history CloudWatch logs API, console, logs Execution semantics At-least-once Exactly-once Service integrations No Job-run or Callback All integrations and patterns

Slide 14

Slide 14 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Toolkit for Visual Studio Code

Slide 15

Slide 15 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Toolkit for Visual Studio Code • Create workflows with sample templates • Accelerate development with code snippets • Visualize workflows without leaving the IDE • Execute state machines in your AWS account

Slide 16

Slide 16 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeBuild service integration

Slide 17

Slide 17 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeBuild service integration • Start builds periodically or in response to events with Amazon EventBridge • Create webhooks to start builds using Amazon API Gateway • Parallel state for independent components • Map state for each branch

Slide 18

Slide 18 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS SAM support

Slide 19

Slide 19 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Serverless Application Model (AWS SAM) • AWS::Serverless::StateMachine component • Use DefinitionURI and DefinitionSubstitutions to create workflows from separate files • Apply AWS SAM policy templates to workflows • AWS SAM event sources

Slide 20

Slide 20 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CDK support

Slide 21

Slide 21 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Cloud Development Kit (CDK) • Constructs for generating Step Functions • Customize, share, reuse • Use familiar programming languages and tools • Deploy infrastructure and runtime code together

Slide 22

Slide 22 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Error handling

Slide 23

Slide 23 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Retriers • Task, Parallel, and Map States • Switch/case statement on ErrorEquals value • IntervalSeconds is the number of seconds before first retry • MaxAttempts is the number of retries (may be 0) • BackoffRate is a multiplier

Slide 24

Slide 24 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Catchers • Task, Parallel, and Map States • Also known as Fallback States • Scanned in array order when there is an error and no Retrier or all retries have failed • Switch/case statement on ErrorEquals value • ResultPath for storing error • Next defines the next state

Slide 25

Slide 25 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Closing

Slide 26

Slide 26 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Review Orchestrating distributed business workflows • What are AWS Step Functions? • Nested workflows • Dynamic parallelism • Express Workflows • AWS Toolkit for Visual Studio Code support • AWS CodeBuild service integration • AWS SAM support • AWS CDK support • Error handling

Slide 27

Slide 27 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Additional resources AWS Step Functions resources page • aws.amazon.com/step-functions/resources/ AWS Step Functions video series • rbsttr.tv/sfn AWS Serverless YouTube channel • youtube.com/c/AWSServerless

Slide 28

Slide 28 text

© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! Twitter: @rts_rob Twitch: /robsutter