Synchronous Express Workflows can now be triggered with Amazon API Gateway’s REST APIs, allowing you to build interactive applications and orchestrate high-volume, short-duration microservices.
AWS Step Functions allows you to build resilient serverless workflows by composing AWS services such as AWS Lambda, Amazon API Gateway, Amazon DynamoDB, and more. Synchronous Express Workflows are ideal to build high-volume, short duration, synchronous workflows such as the orchestration of microservices behind Amazon API Gateway. Now you can trigger a Synchronous Express Workflow with Amazon API Gateway’s REST APIs and take advantage of request transformations, request/response validation, and custom domain names. Express Workflows ensures that the steps in your workflow are followed reliably, information is passed between steps, and errors are handled automatically.
xxxxxxxxxx
{
"Comment": "This state machine returns an employee entry from DynamoDB",
"StartAt": "Read From DynamoDB",
"States": {
"Read From DynamoDB": {
"Type": "Task",
"Resource": "arn:aws:states:::dynamodb:getItem",
"Parameters": {
"TableName": "StepFunctionsSample-SynchronousExpressWorkflowAKIAIOSFODNN7EXAMPLE-DynamoDBTable-ANPAJ2UCCR6DPCEXAMPLE",
"Key": {
"EmployeeId": {"S.$": "$.employee"}
}
},
"Retry": [
{
"ErrorEquals": [
"DynamoDB.AmazonDynamoDBException"
],
"IntervalSeconds": 3,
"MaxAttempts": 2,
"BackoffRate": 1.5
}
],
"Next": "Is Get Successful"
},
"Is Get Successful": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.Item",
"IsPresent": true,
"Next": "Succeed Execution"
}
],
"Default": "Fail Execution"
},
"Succeed Execution": {
"Type": "Pass",
"Parameters" : {
"employee.$": "$.Item.EmployeeId.S",
"jobTitle.$": "$.Item.JobTitle.S"
},
"End": true
},
"Fail Execution": {
"Type": "Fail",
"Error": "EmployeeDoesNotExist"
}
}
}