SlideShare uma empresa Scribd logo
1 de 55
©2017,	Amazon	Web	Services,	Inc.	or	its	affiliates.	All	rights	reserved
Pop-up Loft
Serverless Apps with
AWS Step Functions
Trevor Roberts Jr – Solutions Architect
λλ
λ
DBMS
λ
λ
λ
λ
λ
λ λ
λ
λ
Queue
Modern
Serverless
app
Modern
Serverless
app
“I want to sequence functions”
“I want to select functions based on data”
“I want to retry functions”
“I want try/catch/finally”
Functions into apps
“I have code that runs for hours”
“I want to run functions in parallel”
Coordination by method call
λ λ
λ
λ
λ
λ
λ
Coordination by function chaining
λ
λ
λ
λ
λλ
λ
Coordination by database
λλ
λ
λ
λλ
λ
Coordination by queues
λ
λ
λ
λ λλ
λ
Coordination must-haves
• Scales out
• Doesn’t lose state
• Deals with errors/timeouts
• Easy to build & operate
• Auditable
“State Machine”(noun)
1. A concept used by CompSci
profs for torturing
undergrads, full of arcane
math.
2. A practical way to build and
manage modern Serverless
Cloud apps.
Dictionary
Application Lifecycle in AWS Step Functions
Visualize in the
Console
Define in JSON Monitor
Executions
Define in JSON and Then Visualize in the Console
{
”Comment”: “Hello World Example",
"StartAt” : "HelloWorld”,
"States” : {
"HelloWorld” : {
"Type” : "Task",
"Resource” :
"arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTI
ON_NAME”,
"End” : true
}
}
}
Execute One or One Million
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Start
End
HelloWorld
Monitor Executions from the Console
Seven State Types
Task A single unit of work
Choice Adds branching logic
Parallel Fork and join the data across tasks
Wait Delay for a specified time
Fail Stops an execution and marks it as a failure
Succeed Stops an execution successfully
Pass Passes its input to its output
Build Visual Workflows from State Types
Task
Choice
Fail
Parallel
How it works – API-level
Create State Machine – input is a machine spec
in a JSON DSL
Run Machine – input JSON blob, returns
Execution ID
List Executions
Describe Execution
Stop Execution
Integrate with other AWS services
• Create state machines and Activities with AWS
CloudFormation
• Call AWS Step Functions with Amazon API Gateway
• Start state machines in response to events, or on a
schedule, with CloudWatch Events
• Monitor state machine executions with Amazon CloudWatch
• Log API calls with AWS CloudTrail
Serverless Human Approval Tasks
https://aws.amazon.com/blogs/compute/
implementing-serverless-manual-approval-steps-in-aws-step-functions-and-amazon-api-gateway/
Image Recognition and Processing Backend
Task
Choice
Fail
Parallel
https://github.com/awslabs/lambda-refarch-imagerecognition
EBS Snapshot Management
State Machine State Machine
create-snapshot
complete event
copy-snapshot
complete event
Primary Region DR Region
Parallel State
Choice
Tag Snapshot
Count Snapshots
CopyToDRRegion
Success
State
Delete
Snapshots
Choice
Tag SnapshotCopy
Count Snapshots
Pass State
Delete
Snapshots
Notification
Topic
Errors Sent
to SNS
Notification
Topic
Errors Sent
to SNS
https://github.com/awslabs/aws-step-functions-ebs-snapshot-mgmt
1. Tag
2. Count
3. Copy to DR region
4. Delete Expired
Whenever a new EBS
snapshot completes:
State Machines
invoked by Amazon
CloudWatch Events
“I want to sequence functions”
AWS	Step	Functions,	we	can	easily	change	and	iterate	on	
the	application	workflow	of	our	food	delivery	service	in	
order	to	optimize	operations	and	continually	improve	
delivery	times.	AWS	Step	Functions	lets	us	dynamically	
scale	the	steps	in	our	food	delivery	algorithm	so	we	can	
manage	spikes	in	customer	orders	and	meet	demand.			
Mathias	Nitzsche,	CTO,	foodpanda
“
var Twit = require('twit');
var T = new Twit(require('botfiles/config.js'));
exports.handler = function myBot(event, context, callback) {
var list = event.inputList;
var textToTweet = list.shift();
var output = { inputList: list }
T.post('statuses/update',
{ status: textToTweet }, function(err, reply) {
if (err) {
console.log('error:', err); context.fail();
} else {
console.log('tweet:', reply); callback(null, output);
}
});
};
“I want to select functions based on data”
“With AWS Step Functions, it was easy to build a multi-step product
updating system to ensure our database and website always have the
latest price and availability information.
AWS Step Functions let us replace a manual updating process with an
automated series of steps, including built-in retry conditions and error
handling, so we can reliably scale before a big show, and keep pace
with rapidly changing fashions.”
Jared Browarnik, CTO, TheTake
“
"ChoiceState": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$.productSource",
"StringEquals": "screen-scrape",
"Next": "ScreenScrapeState"
},{
"Variable": "$.productSource",
"StringEquals": "vendor-a",
"Next": "VendorA"
},{
"Variable": "$.productSource",
"StringEquals": "vendor-b",
"Next": "VendorB"
},
{
"Variable": "$.productSource",
"StringEquals": "vendor-c",
"Next":"VendorC"
},{
"Variable": "$.productSource",
"StringEquals": "updateProduct",
"Next":"UpdateProduct"
}
],
"Default": "ScreenScrapeState”
}
“I want to retry functions”
We get transient errors from a RESTful
service we depend on, once every four
or five times we call it. But if we keep
retrying, it eventually works.
“
{
"Comment": "Call out to a RESTful service",
"StartAt": "Call out",
"States": {
"Call out": {
"Type": "Task",
"Resource":
"arn:aws:lambda:eu-central-1:123456789012:function:RestCallout",
"Retry": [
{ "ErrorEquals": [ "HandledError" ], "MaxAttempts": 10 }
],
"End": true
}
}
}
“I want to run functions in parallel”
We want to send the captured image to
three OCR providers and take the result
with the highest confidence value.“
"Send for OCR": {
"Type": "Parallel",
"Next": "Pick result",
"Branches": [
{
"StartAt": "Prep1",
"States": {
"Prep1": {
"Type": "Pass",
"Result": { "inputList": [ "OCR Provider 1" ] },
"Next": "Go1"
},
"Go1": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1:123456789012:function:StatesBot",
"End": true
}
}
Where does transient application
state live?
In the machine, in JSON texts
passing from state to state.A:
Q:
Input processing
{
"title": "Numbers to add",
"numbers": [ 3, 4 ]
}
{
"Type": "Task",
"InputPath": "$.numbers",
"Resource": "arn:aws:lambda…"
…
[ 3, 4 ]
Raw input:
State spec:
Task input:
Input processing
Q: InputPath not provided?
A: State gets raw input as-is.
Q: InputPath is null?
A: State gets an empty JSON object: {}
Q: InputPath produces plural output?
A: State gets it wrapped in a JSON array.
Result placement
{
"title": "Numbers to add",
"numbers": [ 3, 4 ]
}
{
"Type": "Task",
"InputPath": "$.numbers",
"ResultPath": "$.sum”,
…
Raw input:
State spec:
Output: {
"title": "Numbers to add",
"numbers": [ 3, 4 ],
”sum": 7
}
Result placement
Q: ResultPath not provided?
A: Input discarded, raw output used.
Q: ResultPath is null?
A: State input is state output.
Q: ResultPath produces plural output?
A: Not allowed, validator won’t accept.
“I want try/catch/finally”
AWS Step Functions makes it simple to coordinate information
from many different infrastructure systems using easy to design
workflows and create a more intelligent monitoring system for our
Platform as a Service (PaaS).
With AWS Step Functions, we can reliably automate monitoring
decisions and actions in order to reduce human intervention by
over 60%, which improves infrastructure operation productivity and
customer application availability on our platform.
Pedro Pimenta, VP R&D, OutSystems
“
13 AWS Lambda Task States
6 Choice States
1 Fail State
“I want try/catch/finally”
"Access Media": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-central-1:123456789012:function:FindMedia",
"TimeoutSeconds": 2,
"Next": "Graceful Exit",
"Retry": [
{
"ErrorEquals": [ "States.Timeout" ],
"IntervalSeconds": 2, "MaxAttempts": 2, "BackoffRate": 1.5
}
],
"Catch": [
{ "ErrorEquals": [ "States.ALL" ], "Next": "Clean Up" }
]
},
“I have code that runs for hours”
We need to gather data from our
production line, in units of 8-hour shifts.
“
More APIs
Register Activity Task - Returns ARN
Poll For task (by ARN)
Report Success
Report Failure
Report Heartbeat
"NextShift": {
"Type": "Wait",
"TimestampPath": "$.ShiftStart",
"Next": "Gather Plant Data"
},
"Gather Plant Data": {
"Type": "Task",
"Resource":
"arn:aws:states:ap-northeast-1:123456789012:activity:PlWatch",
"TimeoutSeconds": 30000,
"HeartBeatSeconds": 120,
"Next": "Clean up"
}
“I want to sequence functions”
“I want to select functions based on data”
“I want to retry functions”
“I want try/catch/finally”
Is this you?
“I have code that runs for hours”
“I want to run functions in parallel”
(Demo)
https://states-language.net/spec.html
2.5¢
How much?
per thousand
state transitions
4,000 free
transitions/month
Free tier:
©2017,	Amazon	Web	Services,	Inc.	or	its	affiliates.	All	rights	reserved
Pop-up Loft
Thank You

Mais conteúdo relacionado

Mais procurados

Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsAmazon Web Services
 
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step FunctionsServerless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step FunctionsForrest Brazeal
 
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017Amazon Web Services
 
Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Amazon Web Services
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Amazon Web Services
 
Authoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAuthoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAmazon Web Services
 
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornWorkshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornAmazon Web Services
 
Unlocking Agility with the AWS Serverless Application Model (SAM)
Unlocking Agility with the AWS Serverless Application Model (SAM)Unlocking Agility with the AWS Serverless Application Model (SAM)
Unlocking Agility with the AWS Serverless Application Model (SAM)Amazon Web Services
 
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringRaleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringAmazon Web Services
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless ApplicationsAmazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMharprits10
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpAmazon Web Services
 
The present and future of Serverless observability
The present and future of Serverless observabilityThe present and future of Serverless observability
The present and future of Serverless observabilityYan Cui
 
Building Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureBuilding Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureAmazon Web Services
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingAmazon Web Services
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Amazon Web Services
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftAmazon Web Services
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Amazon Web Services
 
Building Business Workflows with AWS Step Functions
Building Business Workflows with AWS Step FunctionsBuilding Business Workflows with AWS Step Functions
Building Business Workflows with AWS Step FunctionsAmazon Web Services
 

Mais procurados (20)

Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applications
 
Serverless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step FunctionsServerless Workflows on AWS - A Journey from SWF to Step Functions
Serverless Workflows on AWS - A Journey from SWF to Step Functions
 
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
 
Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017Building Serverless Web Applications - DevDay Austin 2017
Building Serverless Web Applications - DevDay Austin 2017
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
 
Authoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAMAuthoring and Deploying Serverless Applications with AWS SAM
Authoring and Deploying Serverless Applications with AWS SAM
 
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornWorkshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
 
Unlocking Agility with the AWS Serverless Application Model (SAM)
Unlocking Agility with the AWS Serverless Application Model (SAM)Unlocking Agility with the AWS Serverless Application Model (SAM)
Unlocking Agility with the AWS Serverless Application Model (SAM)
 
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoringRaleigh DevDay 2017: Distributed serverless stack tracing and monitoring
Raleigh DevDay 2017: Distributed serverless stack tracing and monitoring
 
Building Advanced Serverless Applications
Building Advanced Serverless ApplicationsBuilding Advanced Serverless Applications
Building Advanced Serverless Applications
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Beginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAMBeginning Serverless Applications with AWS SAM
Beginning Serverless Applications with AWS SAM
 
Serverless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet UpServerless-AWS SAM CLI Session: Developer Meet Up
Serverless-AWS SAM CLI Session: Developer Meet Up
 
The present and future of Serverless observability
The present and future of Serverless observabilityThe present and future of Serverless observability
The present and future of Serverless observability
 
Building Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS InfrastructureBuilding Automated Control Systems for Your AWS Infrastructure
Building Automated Control Systems for Your AWS Infrastructure
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
Building Advanced Serverless Workflows with AWS Step Functions | AWS Floor28
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY Loft
 
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
Building CICD Pipelines for Serverless Applications - DevDay Los Angeles 2017
 
Building Business Workflows with AWS Step Functions
Building Business Workflows with AWS Step FunctionsBuilding Business Workflows with AWS Step Functions
Building Business Workflows with AWS Step Functions
 

Semelhante a Serverless Apps with AWS Step Functions

SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsAmazon Web Services
 
NEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step FunctionsNEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step FunctionsAmazon Web Services
 
NEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step FunctionsNEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step FunctionsAmazon Web Services
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step FunctionsAmazon Web Services
 
Announcing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar SeriesAnnouncing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar SeriesAmazon Web Services
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션Amazon Web Services Korea
 
Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Amazon Web Services
 
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...Amazon Web Services
 
使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務Amazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAmazon Web Services
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessSheenBrisals
 
AWS Step Functions 実践
AWS Step Functions 実践AWS Step Functions 実践
AWS Step Functions 実践Shuji Kikuchi
 
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAmazon Web Services
 
AWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdfAWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdfAmazon Web Services
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaAmazon Web Services
 
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Amazon Web Services
 
Design and Implement a Serverless Media-Processing Workflow
Design and Implement a Serverless Media-Processing Workflow Design and Implement a Serverless Media-Processing Workflow
Design and Implement a Serverless Media-Processing Workflow Amazon Web Services
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
 
Delightful steps to becoming a functioning user of Step Functions
Delightful steps to becoming a functioning user of Step FunctionsDelightful steps to becoming a functioning user of Step Functions
Delightful steps to becoming a functioning user of Step FunctionsYan Cui
 

Semelhante a Serverless Apps with AWS Step Functions (20)

SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step Functions
 
NEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step FunctionsNEW LAUNCH! Serverless Apps with AWS Step Functions
NEW LAUNCH! Serverless Apps with AWS Step Functions
 
NEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step FunctionsNEW LAUNCH! Building Distributed Applications with AWS Step Functions
NEW LAUNCH! Building Distributed Applications with AWS Step Functions
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step Functions
 
Announcing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar SeriesAnnouncing AWS Step Functions - December 2016 Monthly Webinar Series
Announcing AWS Step Functions - December 2016 Monthly Webinar Series
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
 
Introduction to AWS Step Functions:
Introduction to AWS Step Functions: Introduction to AWS Step Functions:
Introduction to AWS Step Functions:
 
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
Designing and Implementing a Serverless Media Processing Workflow Using AWS S...
 
使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With Serverless
 
AWS Step Functions 実践
AWS Step Functions 実践AWS Step Functions 実践
AWS Step Functions 実践
 
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
 
AWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdfAWS Step Functions - Dev lounge Express Edition.pdf
AWS Step Functions - Dev lounge Express Edition.pdf
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
Design and Implement a Serverless Media-Processing Workflow - SRV328 - Atlant...
 
Design and Implement a Serverless Media-Processing Workflow
Design and Implement a Serverless Media-Processing Workflow Design and Implement a Serverless Media-Processing Workflow
Design and Implement a Serverless Media-Processing Workflow
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Delightful steps to becoming a functioning user of Step Functions
Delightful steps to becoming a functioning user of Step FunctionsDelightful steps to becoming a functioning user of Step Functions
Delightful steps to becoming a functioning user of Step Functions
 

Último

Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyPooja Nehwal
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 

Último (20)

Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 

Serverless Apps with AWS Step Functions

  • 1. ©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved Pop-up Loft Serverless Apps with AWS Step Functions Trevor Roberts Jr – Solutions Architect
  • 4. “I want to sequence functions” “I want to select functions based on data” “I want to retry functions” “I want try/catch/finally” Functions into apps “I have code that runs for hours” “I want to run functions in parallel”
  • 5.
  • 6. Coordination by method call λ λ λ λ λ λ λ
  • 7. Coordination by function chaining λ λ λ λ λλ λ
  • 10. Coordination must-haves • Scales out • Doesn’t lose state • Deals with errors/timeouts • Easy to build & operate • Auditable
  • 11.
  • 12. “State Machine”(noun) 1. A concept used by CompSci profs for torturing undergrads, full of arcane math. 2. A practical way to build and manage modern Serverless Cloud apps. Dictionary
  • 13. Application Lifecycle in AWS Step Functions Visualize in the Console Define in JSON Monitor Executions
  • 14. Define in JSON and Then Visualize in the Console { ”Comment”: “Hello World Example", "StartAt” : "HelloWorld”, "States” : { "HelloWorld” : { "Type” : "Task", "Resource” : "arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTI ON_NAME”, "End” : true } } }
  • 15. Execute One or One Million Start End HelloWorld Start End HelloWorld Start End HelloWorld Start End HelloWorld Start End HelloWorld Start End HelloWorld Start End HelloWorld Start End HelloWorld
  • 16. Monitor Executions from the Console
  • 17. Seven State Types Task A single unit of work Choice Adds branching logic Parallel Fork and join the data across tasks Wait Delay for a specified time Fail Stops an execution and marks it as a failure Succeed Stops an execution successfully Pass Passes its input to its output
  • 18. Build Visual Workflows from State Types Task Choice Fail Parallel
  • 19.
  • 20. How it works – API-level Create State Machine – input is a machine spec in a JSON DSL Run Machine – input JSON blob, returns Execution ID List Executions Describe Execution Stop Execution
  • 21. Integrate with other AWS services • Create state machines and Activities with AWS CloudFormation • Call AWS Step Functions with Amazon API Gateway • Start state machines in response to events, or on a schedule, with CloudWatch Events • Monitor state machine executions with Amazon CloudWatch • Log API calls with AWS CloudTrail
  • 22. Serverless Human Approval Tasks https://aws.amazon.com/blogs/compute/ implementing-serverless-manual-approval-steps-in-aws-step-functions-and-amazon-api-gateway/
  • 23. Image Recognition and Processing Backend Task Choice Fail Parallel https://github.com/awslabs/lambda-refarch-imagerecognition
  • 24. EBS Snapshot Management State Machine State Machine create-snapshot complete event copy-snapshot complete event Primary Region DR Region Parallel State Choice Tag Snapshot Count Snapshots CopyToDRRegion Success State Delete Snapshots Choice Tag SnapshotCopy Count Snapshots Pass State Delete Snapshots Notification Topic Errors Sent to SNS Notification Topic Errors Sent to SNS https://github.com/awslabs/aws-step-functions-ebs-snapshot-mgmt 1. Tag 2. Count 3. Copy to DR region 4. Delete Expired Whenever a new EBS snapshot completes: State Machines invoked by Amazon CloudWatch Events
  • 25. “I want to sequence functions” AWS Step Functions, we can easily change and iterate on the application workflow of our food delivery service in order to optimize operations and continually improve delivery times. AWS Step Functions lets us dynamically scale the steps in our food delivery algorithm so we can manage spikes in customer orders and meet demand. Mathias Nitzsche, CTO, foodpanda “
  • 26.
  • 27.
  • 28. var Twit = require('twit'); var T = new Twit(require('botfiles/config.js')); exports.handler = function myBot(event, context, callback) { var list = event.inputList; var textToTweet = list.shift(); var output = { inputList: list } T.post('statuses/update', { status: textToTweet }, function(err, reply) { if (err) { console.log('error:', err); context.fail(); } else { console.log('tweet:', reply); callback(null, output); } }); };
  • 29. “I want to select functions based on data” “With AWS Step Functions, it was easy to build a multi-step product updating system to ensure our database and website always have the latest price and availability information. AWS Step Functions let us replace a manual updating process with an automated series of steps, including built-in retry conditions and error handling, so we can reliably scale before a big show, and keep pace with rapidly changing fashions.” Jared Browarnik, CTO, TheTake “
  • 30.
  • 31. "ChoiceState": { "Type" : "Choice", "Choices": [ { "Variable": "$.productSource", "StringEquals": "screen-scrape", "Next": "ScreenScrapeState" },{ "Variable": "$.productSource", "StringEquals": "vendor-a", "Next": "VendorA" },{ "Variable": "$.productSource", "StringEquals": "vendor-b", "Next": "VendorB" }, { "Variable": "$.productSource", "StringEquals": "vendor-c", "Next":"VendorC" },{ "Variable": "$.productSource", "StringEquals": "updateProduct", "Next":"UpdateProduct" } ], "Default": "ScreenScrapeState” }
  • 32. “I want to retry functions” We get transient errors from a RESTful service we depend on, once every four or five times we call it. But if we keep retrying, it eventually works. “
  • 33. { "Comment": "Call out to a RESTful service", "StartAt": "Call out", "States": { "Call out": { "Type": "Task", "Resource": "arn:aws:lambda:eu-central-1:123456789012:function:RestCallout", "Retry": [ { "ErrorEquals": [ "HandledError" ], "MaxAttempts": 10 } ], "End": true } } }
  • 34. “I want to run functions in parallel” We want to send the captured image to three OCR providers and take the result with the highest confidence value.“
  • 35.
  • 36. "Send for OCR": { "Type": "Parallel", "Next": "Pick result", "Branches": [ { "StartAt": "Prep1", "States": { "Prep1": { "Type": "Pass", "Result": { "inputList": [ "OCR Provider 1" ] }, "Next": "Go1" }, "Go1": { "Type": "Task", "Resource": "arn:aws:lambda:eu-central-1:123456789012:function:StatesBot", "End": true } }
  • 37. Where does transient application state live? In the machine, in JSON texts passing from state to state.A: Q:
  • 38. Input processing { "title": "Numbers to add", "numbers": [ 3, 4 ] } { "Type": "Task", "InputPath": "$.numbers", "Resource": "arn:aws:lambda…" … [ 3, 4 ] Raw input: State spec: Task input:
  • 39. Input processing Q: InputPath not provided? A: State gets raw input as-is. Q: InputPath is null? A: State gets an empty JSON object: {} Q: InputPath produces plural output? A: State gets it wrapped in a JSON array.
  • 40. Result placement { "title": "Numbers to add", "numbers": [ 3, 4 ] } { "Type": "Task", "InputPath": "$.numbers", "ResultPath": "$.sum”, … Raw input: State spec: Output: { "title": "Numbers to add", "numbers": [ 3, 4 ], ”sum": 7 }
  • 41. Result placement Q: ResultPath not provided? A: Input discarded, raw output used. Q: ResultPath is null? A: State input is state output. Q: ResultPath produces plural output? A: Not allowed, validator won’t accept.
  • 42. “I want try/catch/finally” AWS Step Functions makes it simple to coordinate information from many different infrastructure systems using easy to design workflows and create a more intelligent monitoring system for our Platform as a Service (PaaS). With AWS Step Functions, we can reliably automate monitoring decisions and actions in order to reduce human intervention by over 60%, which improves infrastructure operation productivity and customer application availability on our platform. Pedro Pimenta, VP R&D, OutSystems “
  • 43. 13 AWS Lambda Task States 6 Choice States 1 Fail State “I want try/catch/finally”
  • 44.
  • 45. "Access Media": { "Type": "Task", "Resource": "arn:aws:lambda:eu-central-1:123456789012:function:FindMedia", "TimeoutSeconds": 2, "Next": "Graceful Exit", "Retry": [ { "ErrorEquals": [ "States.Timeout" ], "IntervalSeconds": 2, "MaxAttempts": 2, "BackoffRate": 1.5 } ], "Catch": [ { "ErrorEquals": [ "States.ALL" ], "Next": "Clean Up" } ] },
  • 46. “I have code that runs for hours” We need to gather data from our production line, in units of 8-hour shifts. “
  • 47. More APIs Register Activity Task - Returns ARN Poll For task (by ARN) Report Success Report Failure Report Heartbeat
  • 48. "NextShift": { "Type": "Wait", "TimestampPath": "$.ShiftStart", "Next": "Gather Plant Data" }, "Gather Plant Data": { "Type": "Task", "Resource": "arn:aws:states:ap-northeast-1:123456789012:activity:PlWatch", "TimeoutSeconds": 30000, "HeartBeatSeconds": 120, "Next": "Clean up" }
  • 49. “I want to sequence functions” “I want to select functions based on data” “I want to retry functions” “I want try/catch/finally” Is this you? “I have code that runs for hours” “I want to run functions in parallel”
  • 51.
  • 53.
  • 54. 2.5¢ How much? per thousand state transitions 4,000 free transitions/month Free tier: