Wait with Step Function

Dharmendra S Negi
3 min readMay 23, 2023

--

AWS Step Functions have become a powerful tool for managing and organising complex activities in the world of serverless computing. The flexibility of Step Functions to include wait functionality is one of the primary characteristics that contribute to this versatility.

In this article, we’ll look at how Step Function wait functionality works and how it can transform your serverless architecture.

Wait States ?

Wait states, which are essential parts of AWS Step Functions, let you add pauses and delays to your workflows. You can manage the timing of state transitions, wait for certain requirements to be satisfied, or provide temporal dependencies between operations by using wait states. Wait states give you the flexibility to accomplish these goals whether you need to add a temporal delay, watch for an outside event, or synchronise parallel activities.

Wait State Configuration:

Basic SM Input with time stamp

Note- Iac is in serverless framework , but things should be almost similar with other Iac as well

A duration or absolute timestamp must be specified in order to implement a basic wait state. You may carefully regulate the gap between states by setting the duration in seconds.

However, you can plan tasks to run at precise times by using absolute timestamps.

Also, you can select the value from the input which makes it dynamic. For given input:

Select value of waitTime

With the help of this fundamental setup, you may build workflows that behave in a time-bound manner or add delays to account for other dependencies.

Conclusion

AWS Step Functions, with their powerful wait functionality, offer an incredible range of possibilities when it comes to orchestrating serverless workflows. By incorporating wait states into your Step Function state machines, you can introduce delays, schedule tasks, and synchronize activities, enabling you to build strong and efficient serverless architectures. Understanding the various aspects of wait functionality empowers you to leverage its capabilities effectively, ultimately delivering more robust and responsive workflows in your serverless applications.

--

--

Dharmendra S Negi
Dharmendra S Negi

Written by Dharmendra S Negi

Senior Serverless Developer at Serverless Guru.

No responses yet