Wait
Function: Wait
This action allows you to pause the execution of your workflow for a specified period. It's useful when you need to introduce a delay between steps, perhaps to wait for an external system to process information, or to schedule follow-up actions.
Input
- Milliseconds: A whole number representing the duration, in milliseconds, that the workflow should pause. (1000 milliseconds = 1 second). This input is required.
Output
This action does not produce any direct output. Its effect is to introduce a delay in the workflow's execution.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Wait" action in your applications:
Example 1: Delaying a Follow-up Email
Imagine you send an initial email to a new customer, and you want to send a follow-up email one hour later, but only if they haven't taken a specific action.
- Inputs:
- Milliseconds:
3600000(This is 1 hour, as 1000 ms = 1 second, 60 seconds = 1 minute, 60 minutes = 1 hour, so 1000 * 60 * 60 = 3,600,000)
- Milliseconds:
- Result: The workflow pauses for exactly one hour after the initial email is sent. After the pause, it can then check if the customer has taken action and send the follow-up if needed.
Example 2: Allowing an External System to Process Data
You've just sent data to an external payment gateway, and it typically takes a few seconds for them to process the transaction and update their status. You want to wait before querying their system for the updated status.
- Inputs:
- Milliseconds:
10000(This is 10 seconds)
- Milliseconds:
- Result: The workflow pauses for 10 seconds, giving the external payment gateway sufficient time to process the transaction before your application attempts to retrieve the updated status.
Example 3: Staggering Notifications to Avoid Overload
You need to send a series of notifications to different user groups, but you want to avoid sending them all at once to prevent system overload or to space out the communication.
- Inputs:
- Milliseconds:
5000(This is 5 seconds)
- Milliseconds:
- Result: After sending a notification to the first group, the workflow pauses for 5 seconds before proceeding to send the notification to the next group, ensuring a staggered delivery.