Integration Builder (Wait, Delay, Timeout)

Not Yet Reviewed

Is there a command inside the Integration Builder to wait for n secs then execute the next command?

I already tried setTimeout, setInterval and I got the error message is not defined.



Date Votes

Please sign in to leave a comment.

  • Hi Aris,

    I will talk to our development team and find out is there is a JavaScript version of sleep() that is available to use.

    However, in the meantime I'd like to understand why you might want to do this. In a previous life, I spent a lot of time working in test automation and the use of fixed length waits was a sure fire way to create race conditions and brittle scripts. 

    Are you making an update to another system / API and want to make sure your updates are processed before you proceed with the next step? If so, there might be some options available to you.

    For example, if making an update via a web service, you could add a step that will wait until you get a response from that web service (e.g. 200 ok) before moving on.

    I'll get you an answer to your question but I think there might be a better way to solve your problem.


    Iain Rose

    xMatters Product Management

  • I received a request from another team and their escalation requirements is a little bit complicated.

    I am making a custom escalation that is not possible with group escalations. They gave me 3 groups (primary, backup and L2 managers). They want to have different escalation paths for different priority (high/medium/low). In order for me to achieve this for only 3 groups, i need to create a condition in the integration builder depending on priority. I also need to create a condition after a certain time check status of xMatters, submit/http post to another form (override escalation delays, no responses, different message layout and send only to email), check status of ticket, etc.

    Right now, i'm stuck with the delay part.

    I already requested for a group enhancement but I'm not sure on how long it will take.


  • Hi Aris,

    One suggestion that KAkey made recently for a similar type of situation was to wait until you get the Terminated status event on the initiating event.  From there you can kickoff subsequent events (post to another form) based on the information you can retrieve about the status of the event that just terminated.

    Hope that helps,

    Jordan Olin

    xMatters Consulting

  • Hi Jordan, I'm not sure on how to do this "wait until you get the Terminated status event on the initiating event"


    I believe the Integration Builder is not ready for delay function. The devs may have hardcoded in the script that it will terminate after n secs.
    I have improvised the delay (script below) but after n secs, the Integration Builder will terminate the Event resulting a Canceled error in the Activity Stream.

    function wait(msecs)
    var start = new Date().getTime();
    var current = start
    while(current - start < msecs)
    cur = new Date().getTime();

  • Hi Aris,

    What I was suggesting was to create an Integration Builder Outbound script based on a Status Callback.

    Within the Status Callback, you look for the Terminated status... something like this...

    // See if the status represents event activation
    if( String(callback.status).startsWith("terminated") ) {

      // Do your RESTful lookups of the details of the event



  • FWIW: The Integration Platform that the Integration Builder scripts runs on is focused on servicing millions of requests, where the focus is on web service translation and content enrichment which should be relatively quick operations. As such it protects itself from long running requests where I believe "n" is 60... as in the script needs to complete within "60 seconds" or the Integration Platform terminates it assuming it is in a bad state.

    Using our webhooks (aka "callbacks"... we recently renamed this to call a rose a rose) allows for cross event behaviors where the status of an event or a response can be used to transition to another event, as Jordan suggests.

    Good luck!


Didn't find what you were looking for?

New post