REST API with Step Function Integration
Understand the integration of step functions with API Gateway.
Step functions
Workflow orchestration is an important component of large-scale applications. It’s true that we can implement complex systems fully in code. However, it makes sense to split the code into independent pieces that are connected together by a framework. Consider, for example, an e-commerce application. Whenever a user places a new order, it triggers several processes. On a high level, the payment confirmation is followed by procurement and then dispatch management.
It's possible to do all these in a sequential code flow, where one master code block invokes the individual methods, one after the other. However, such an implementation isn’t modular and is difficult to maintain and enhance. Instead, we can create individual services that are orchestrated in a workflow. Step functions help us with such orchestration.
Thus, a new order can trigger a step function, which invokes individual services. The step functions provide versatile features. It can invoke services and wait for confirmations. It can make decisions based on such responses. It can do this in sequences and loops. Step functions can create workflows that last up to a year long. That can include human interaction as well as other external dependencies.
The workflows are often not that complex. For simpler cases, we have express workflows that can live up to five minutes. Naturally, they cost less than the standard workflows. Let’s check out a simple example of express ...