SlideShare a Scribd company logo
AWS Lambda functions can only run for a
maximum of five minutes.
This must be distinctly understood, or
nothing wonderful can come of the story
you are about to hear.
FORREST BRAZEAL
Cloud Services team lead at Infor
AWS automation tooling
Blog: forrestbrazeal.com
Twitter: @forrestbrazeal
SERVERLESS WORKFLOWS IN AWS
A JOURNEY FROM SWF TO STEP
FUNCTIONS
FORREST BRAZEAL
THE PROBLEM (MAY 2016)
Enterprise apps with many moving parts
Deployment orchestration becomes tricky
Need a workflow system
WHAT DOES A
WORKFLOW SYSTEM DO?
Coordinates worker processes
Manages state
Responds to interrupts
Is highly available, elastic, and all that good stuff
WHY SERVERLESS
FOR THIS USE CASE?
Lots of downtime
Need to scale wide
Internal tooling, need low cost/maintenance
It’s cool! (Famous last words)
How do you manage a
long-running process
using
short-lived, stateless functions?
THE BIG QUESTION
IDEA 1: PURE LAMBDA
GHASTLY!
BUT WAIT A MINUTE
AWS has had a workflow service, Amazon SWF, for several
years.
Could we use it?
WE NEED TO TALK ABOUT SWF
(not so) “Simple Workflow Service”
You write a decider program that orchestrates your workflow
You write activity worker programs to handle tasks
SWF is the glue
TRADITIONAL SWF
ARCHITECTURE
IDEA 2: SWF + LAMBDA
Put the “decider” program on Lambda
Find some way to invoke it repeatedly over the life of the
workflow
Advantages
• SWF manages the workflow
• More maintainable than Possibility 1
• Still technically “serverless”!
Disadvantages
• Let’s see …
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step Functions
THIS (WAS) MY
ARCHITECTURE
AWS even made a video about it!
SERVERLESS SWF PAIN POINTS
☹ Latency
☹ Cost
☹ Retries
☹ Debugging
☹ State
Serverless Workflows on AWS - A Journey from SWF to Step Functions
“Serverless for serverless’
sake”
AWS STEP FUNCTIONS (SFN)
Announced at re:Invent 2016
A “serverless-native” workflow solution
State machine as a service
THE FIRST RULE OF
STEP FUNCTIONS CLUB
Your Lambda functions don’t talk about Step Functions Club!
They just accept input and output – SFN does the
orchestration
“Amazon States Language” template defines the state
machine in JSON
SFN IN ACTION:
DYNAMIC BACKOFF
You pay here
Not here!
DYNAMIC BACKOFF
DYNAMIC BACKOFF
In Lambda function for “BackoffTaskState”
From this …
…to this!
STEP FUNCTIONS
WISHLIST
CloudFormation support ✔
> 32kb state size
Updates
Signals
Child state machines
Dynamic parallel states
STATE MACHINE
VERSIONING
SWF WORKFLOW RESULTS
SFN WORKFLOW RESULTS
IN CONCLUSION
Recognize when your serverless reach exceeds your grasp
Your use cases make the tooling better
Go build an awesome workflow with AWS Step Functions!
RESOURCES
More details about our SFN use case and results:
https://forrestbrazeal.com/2016/12/29/serverless-workflows-on-aws-my-journey-
from-swf-to-step-functions/
AWS “This Is My Architecture” video about the SWF/Lambda solution:
https://youtu.be/rKeS3RpMEOw
Infor’s re:Invent session about deployment automation:
https://www.youtube.com/watch?v=Epx_32c3c6s
FORREST BRAZEAL
@forrestbrazeal

More Related Content

PDF
Android architecture components with cloud firestore
PPTX
OpsNow를 활용한 AWS Cloud 비용 최적화 전략
PDF
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
PPTX
Building Event-Driven Systems with Apache Kafka
PDF
Black Belt Online Seminar AWS Amazon RDS
PDF
20200826 AWS Black Belt Online Seminar AWS CloudFormation
PDF
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Android architecture components with cloud firestore
OpsNow를 활용한 AWS Cloud 비용 최적화 전략
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
Building Event-Driven Systems with Apache Kafka
Black Belt Online Seminar AWS Amazon RDS
20200826 AWS Black Belt Online Seminar AWS CloudFormation
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...

What's hot (20)

PPTX
AWS WAF のマネージドルールって結局どれを選べばいいの?
PPTX
画像ベース異常検知Amazon Lookout for Visionを使ってみよう
PDF
はじめてのDynamoDBスキーマ設計
PDF
20200811 AWS Black Belt Online Seminar CloudEndure
PPTX
Toi uu hoa he thong 30 trieu nguoi dung
PDF
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
PDF
AWS Black Belt Online Seminar 2017 AWS OpsWorks
PDF
Amazon SageMaker で始める機械学習
PDF
How Prometheus Store the Data
PDF
Demystifying OAuth 2.0
PDF
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
PDF
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
PPTX
Application Load Balancer
PPTX
Unique ID generation in distributed systems
PDF
Monitoring - 入門監視
PDF
AWS Lambda를 기반으로한 실시간 빅테이터 처리하기
PPTX
Vault - Secret and Key Management
PDF
Amazon SageMaker 推論エンドポイントを利用したアプリケーション開発
PDF
AZ-204 : Implement Azure security
PDF
Kubernetes on Azure ~Azureで便利にKubernetesを利用する~
AWS WAF のマネージドルールって結局どれを選べばいいの?
画像ベース異常検知Amazon Lookout for Visionを使ってみよう
はじめてのDynamoDBスキーマ設計
20200811 AWS Black Belt Online Seminar CloudEndure
Toi uu hoa he thong 30 trieu nguoi dung
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
AWS Black Belt Online Seminar 2017 AWS OpsWorks
Amazon SageMaker で始める機械学習
How Prometheus Store the Data
Demystifying OAuth 2.0
Kinesis + Elasticsearchでつくるさいきょうのログ分析基盤
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Application Load Balancer
Unique ID generation in distributed systems
Monitoring - 入門監視
AWS Lambda를 기반으로한 실시간 빅테이터 처리하기
Vault - Secret and Key Management
Amazon SageMaker 推論エンドポイントを利用したアプリケーション開発
AZ-204 : Implement Azure security
Kubernetes on Azure ~Azureで便利にKubernetesを利用する~
Ad

Similar to Serverless Workflows on AWS - A Journey from SWF to Step Functions (20)

PPTX
Primeros pasos en desarrollo serverless
PDF
Serverless architectures-with-aws-lambda
PPTX
awslambda-240508203904-07xsds253491.pptx
PPTX
AWS Serverless patterns & best-practices in AWS
PPTX
The good, the bad, the ugly side of step functions
PDF
AWSomeDay Zurich 2018 - How to go serverless
PDF
Serverless on AWS: Architectural Patterns and Best Practices
PPTX
Going serverless with aws lambda
PDF
Introduction to Serverless with AWS Lambda
PDF
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
PPTX
The Future of Enterprise Applications is Serverless
PDF
FaaS or not to FaaS AWS Community Day Hamburg 2019 Bannes Kazulkin
PDF
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
PDF
Serverless Architecture on AWS
PDF
Serverless use cases with AWS Lambda - More Serverless Event
PDF
Getting Started with AWS Lambda & Serverless Cloud
PDF
Introduction to Serverless Computing - OOP Munich
PDF
Serverless computing
PPTX
Introduction To AWS & AWS Lambda
PDF
The Best Practices and Hard Lessons Learned of Serverless Applications
Primeros pasos en desarrollo serverless
Serverless architectures-with-aws-lambda
awslambda-240508203904-07xsds253491.pptx
AWS Serverless patterns & best-practices in AWS
The good, the bad, the ugly side of step functions
AWSomeDay Zurich 2018 - How to go serverless
Serverless on AWS: Architectural Patterns and Best Practices
Going serverless with aws lambda
Introduction to Serverless with AWS Lambda
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
The Future of Enterprise Applications is Serverless
FaaS or not to FaaS AWS Community Day Hamburg 2019 Bannes Kazulkin
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
Serverless Architecture on AWS
Serverless use cases with AWS Lambda - More Serverless Event
Getting Started with AWS Lambda & Serverless Cloud
Introduction to Serverless Computing - OOP Munich
Serverless computing
Introduction To AWS & AWS Lambda
The Best Practices and Hard Lessons Learned of Serverless Applications
Ad

Recently uploaded (20)

PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Introduction to Artificial Intelligence
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
AI in Product Development-omnex systems
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Transform Your Business with a Software ERP System
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
ai tools demonstartion for schools and inter college
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
Softaken Excel to vCard Converter Software.pdf
Introduction to Artificial Intelligence
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
AI in Product Development-omnex systems
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Transform Your Business with a Software ERP System
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms I-SECS-1021-03
Digital Strategies for Manufacturing Companies
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PTS Company Brochure 2025 (1).pdf.......
Navsoft: AI-Powered Business Solutions & Custom Software Development
How to Migrate SBCGlobal Email to Yahoo Easily
Upgrade and Innovation Strategies for SAP ERP Customers

Serverless Workflows on AWS - A Journey from SWF to Step Functions

Editor's Notes

  • #21: Latency. CloudWatch rules cannot run more frequently than once a minute, and SWF scheduling delays made it advisable to invoke the decider even less frequently than that. This situation created significant latency between workflow actions, leading to inflated workflow times that were especially noticeable for workflows involving lots of short tasks. Cost. Having to run the decider on a two-minute loop throughout the life of the workflow somewhat negated the cost advantages we hoped to get from using Lambda instead of EC2 in the first place, especially as our number of workflows scaled up. Runtime State. Every time the Lambda decider function ran, it had to figure out where it was in the workflow process. SWF is supposed to make stateless execution easy, and it provides the complete deployment workflow history as a JSON blob when handing tasks to the decider, but the blob quickly becomes unmanageably large and filled with superfluous data. To keep track of what was going on in the workflows, we resorted to maintaining ephemeral state in a DynamoDB table, adding more latency and cost. Retries/Error Handling. SWF, I regret to say, has bugs. Sometimes SWF completely fails to schedule a task, or does it so late that the workflow’s task timeout expires. Finding and catching these errors required even more state maintained outside of SWF. Debugging. The SWF console’s workflow event views are difficult to read, oddly paginated and don’t provide much information, leading to a rabbit trail of log searches anytime something went wrong. Code Maintainability. The combination of multiple state sources and ramifying failure scenarios, not to mention the central “hack” of running the SWF decider in a loop, led to a mess of one-off fixes and hacky workarounds in our codebase.