The "Delay" logic allows you to introduce a pause or wait time between workflow actions. It helps you control the timing of your actions and create more precise and efficient workflows. By using the "Delay" logic, you can introduce delays of a specific duration, ensuring that actions occur at the desired time intervals. This can be useful for various scenarios, such as scheduling automated tasks, coordinating actions with external systems, or simulating real-time processes.
Types of delays
Delay for
This type of delay introduces a fixed pause in your workflow, specified in units of time (such as seconds, minutes, hours, or days). It's beneficial when a certain amount of time must pass before the next action can or should occur.
When to use: Use "Delay for" when you need to pause the workflow for a set duration. This is especially useful when the exact amount of time to wait is known beforehand.
Delay until
This delay pauses the workflow until a specified date and time. It's ideal for workflows that are dependent on real-world events or specific calendar times.
When to use: Choose "Delay until" when you want to pause the workflow until a specific future point in time. This is useful when the workflow needs to resume at a particular moment, rather than after a certain duration.
Steps to implement a "Delay for" logic in your workflow
- Add Delay: Click on the ‘+’ icon in your Keragon canvas to initiate the addition of a new step to your workflow, then select "logic" from the drop down and select the "Delay" component.
- Choose the “Delay for” action: Click on the newly created Delay step and open the “Action” dropdown. Select the “Delay for” option.
- Configure the duration amount and time unit: Type the amount of time you want to delay for in the “Amount” input and choose the appropriate time unit in the “Unit” dropdown. For example, to delay for 20 minutes you should type 20 in the “Amount” input and select minutes from the “Unit” dropdown.
- Continue with your workflow setup: Click "Save” and proceed adding the action that should happen after the delay step.
Steps to implement a "Delay until" logic in your workflow
- Add Delay: Click on the ‘+’ icon in your Keragon canvas to initiate the addition of a new step to your workflow, then select "logic" from the drop down and select the "Delay" component.
- Choose the “Delay until” action: Click on the newly created Delay step and open the “Action” dropdown. Select the “Delay until” option.
- Set the delay until datetime: In the “Delay until” input, you should type the date and time you want the delay to end. Alternatively, you can select an output from a previous step to be used here. You can use Keragon’s datetime helpers such as “Add or subtract datetimes” to modify the datetime as needed. Please note that the datetime must be in the ISO 8601 format.
- Choose what should happen if the date is in the past: You can optionally, configure how the workflow should behave in the case the “Delay until” date is in the past. The default behavior is for the workflow to fail. However, you choose “Continue” in the “How to handle dates in the past?” input to allow the workflow to continue even if the date is in the past.
- Continue with your workflow setup: Click "Save” and proceed adding the action that should happen after the delay step.
Output
The "Delay" logic will produce an output which contains the amount of time we waited for.
Notes
- If you delete a workflow that contains one or more delays that are in progress then those delays will be cancelled and the subsequent actions won’t happen.
- If you unpublish a workflow that contains one or more delays that are in progress then those delays will be executed normally and will continue once the delay amount has been reached.
- If you edit a delay amount in a workflow that contains one or more delays that are in progress then any subsequent workflow runs will use the updated amount. All existing runs will keep using the old one.