Amazon has introduced steps functions in AWS lambda in 2016. I think, now it's more convenient to use steps function as it's really easy to use them. You can build a state machine with two lambda functions as:
- to produces a quote
- turns a quote into an order
You can easily do that as below:
Here you can have first state for produces a quote and another to turns into order
{
Comment: "Produce a quote and turns into an order",
StartAt: "ProduceQuote",
States: {
ProduceQuote: {
"Type": Task,
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:ProduceQuote",
"next": TurnsToOrder
}
TurnsToOrder: {
Type: Task,
Resource: "arn:aws:lambda:us-east-1:123456789012:function:ProduceQuote",
end: true
}
}
}
Steps functions makes it really easy to write multiple lambda functions and run in sequence or in parallel.
You can get more information about lambda steps functions here:
Steps Functions