How to add delay in celigo flows

How to add delay in celigo flows

Category : Uncategorized

As we all know, the Celigo flow executes step by step. Once it completes a step flow moves to the next step and will start to execute it. However, in some scenarios, we may need to delay the execution of these steps. Javascript hooks will give an error if you try to add delays. So, It’s not possible to add delay logic in celigo itself. We can achieve this by triggering Netsuite scripts from celigo.

Code : 

            var date = new Date();

            date.setMilliseconds(date.getMilliseconds() + 30000); //delay for 30 seconds

            while(new Date() < date){


The above piece of code will help you to add a delay to the script.

You can add the amount of delay you need in milliseconds. In the above sample, the delay is for 30 seconds (30000 milliseconds)

You can write a Restlet script with the above piece of code, and use it as a suitescript hook wherever needed. When the script is called, celigo will wait for the script to complete its execution before moving to the next step. Thus, we can delay the flow execution.

NB: Adding delay in Celigo flow can be achieved only if we are using NS as either source/destination

Use-cases example:

  1. We have an external system where first we need to upload some data and as a second step, we need to trigger its processing. But this external system needs a few seconds to itself to arrange the uploaded data before starting processing. Here, we need to delay the celigo execution point by a few seconds before the process trigger step. 
  1. Realtime Inventory Sync – While creating an SO, we need to send the new available quantity of the item used in SO to Shopify. To achieve this usually we use a user event script that sends inventory details of each item used in SO through a webhook to celigo. When we have multiple items, the celigo webhook will be called repeatedly.  This will cause an error in celigo. To avoid such issues, you can add this delay logic before the webhook call.