Manage Business Logic with Wait Step
Some business processes need to be executed over a long period and wait between execution of specific Steps. The Wait Step exists exactly for this purpose -- it enables Process Authors to pause execution until a certain timestamp.
Introduction
Some business processes naturally require a pause between steps, from milliseconds, minutes, hours, days, or even months. This is common when workflows need to wait for external events, compliance windows, system updates, or other real-world conditions.
In Unmeshed, a Wait Task allows you to seamlessly pause the execution of a process until a specific future time. It's a powerful tool that helps you design workflows that operate through automation over extended periods—without requiring your DevOps teams to rewrite logic or manage external schedulers.
What is a Wait Step in Unmeshed?
The Wait Step in Unmeshed is a built-in task that enables Process Authors to pause workflow execution until a certain timestamp. This functionality is essential for:
- Time-sensitive workflows that need to align with real-world business processes
- System synchronization where backend services need time to index or process data
- Compliance and regulatory requirements that mandate waiting periods
- Resource optimization by scheduling tasks during off-peak hours
How Wait Task Works
Let's say you have a particular process definition with two REST API calls that serve different purposes:
- Create a customer account
- Fetch available promotions based on the account
You can insert a Wait Task between the two calls to allow backend indexing (for example, 3 seconds) and ensure the second call returns accurate and up-to-date data.

Built-in Wait Task Configuration

With Unmeshed, you simply drag and drop the Wait Task between two REST calls. The wait time involves business logic and the step is configured using JavaScript code. When execution of the Wait Task begins, the code is used to determine the wait duration.
(steps, context) => {
// Use start date as reference
const startDate = new Date(steps.__self.start);
return {
"waitUntil" : startDate.setTime(startDate.getTime() + 3000),
}
}
Tip: In our reference system,
steps.__self
refers to the current step itself, allowing you to access properties like the start time of the current Wait Task execution.
There is a predefined field called waitUntil
for which you must return an epoch millisecond value for the time until which you want to wait. This gives very precise control over when the next step runs, effectively:
- Eliminates manual process executions and reduces operational overhead
- Reduces reliance on external cron dependencies or schedules by handling scheduling internally
- Provides full visibility at every stage of the workflow execution
Dynamic Application Using Built-in Wait Task
Additionally, you can hard code a particular time (or important event) in the future, such as:
- January 1st next year for annual processes
- End of a financial quarter for reporting workflows
- Start of a trading window for financial operations
- Specific compliance deadlines for regulatory processes
You can configure the process to wait until that set time is triggered and then continue to run the next step.
Real-World Applications
In the real world, business processes rarely happen instantly. A Wait Task in Unmeshed automates delays seamlessly and empowers you to design resilient, time-sensitive workflows that stay aligned with real-world processes—without complicating your architecture.
Whether you're building:
- Approval flows with mandatory review periods
- Financial settlement processes with clearing timeframes
- Complex integrations requiring sequential data processing
- Compliance workflows with required waiting periods
The Wait Step helps you orchestrate time just as easily as you orchestrate APIs.
Conclusion
The Wait Task in Unmeshed provides a powerful solution for managing time-dependent business logic within your workflow orchestration. By offering precise control over execution timing through JavaScript configuration and epoch millisecond precision, it enables you to build sophisticated, real-world aligned processes without the complexity of external scheduling systems.
👉 Ready to try it out? Get started with Unmeshed or check out Azure Marketplace.