Multiple Webhook Response

Hello!
Maybe somebody here has a good answer to this. I couldn’t find any documentation. I have a webhook, that then has a router and follows the 2 routes without a filter. On the first route it has a webhook response with a 200 and a json body and then the 2nd route has more operations and at the end another webhook response also 200 with json body.

Which response is being sent and when?

  1. Is the webhook response being sent as soon as it runs? or is it being send after the complete run is finished? I suspect that the first response is NOT being sent, instead when the run finishes it sends the latest response.
  2. Can somebody think of a way to respond inmediately with the first webhook response? (the response needs to happen very quickly, cant afford to wait for the entire run to finish.

Thanks!
Andres

Hi Andres - welcome .

If I make the assumption that if everything is correct then the scenario with multiple steps will run without an issue. How about putting a filter to handle errors (if there is a problem the router redirects to an appropriate error response). Otherwise if everything is in order will the scenario run without an issue? If this is the case can you bring the webhook response forward in the scenario so it displays then the legwork can happen after the Webhook response? Make is really fast - by the time the response has been sent, the rest of the work might well be complete (depending on what it has to do). Would that work?

1 Like

Thanks @IainM for the quick response. The scenario works great, just wanted to know which of the 2 webhook response modules was the one actually responding to the initial call.
I just eliminated the second one for the time being. Will keep testing and let you know how this works when 2 webhook response modules are present.
On the other hand, make is fast i agree, however some of the http posts done in the middle do take a couple seconds to respond, so at the end seems like the wenbook response is only sending the response back when all the module finishes not when the actual wenhook response module excecutes.
Makes sense?

1 Like

Hi @pradilla ,

A router executes sequentially.

Routes are processed sequentially, not in parallel. A bundle is not sent to the next route until it has been completely processed by the previous route.

This means that the next branch will start processing from the moment the current branch is finished processing.

So, if you have a webhook response in your first and second branches, the webhook response in the first branch will always be executed first. This will also return as first a response to the request.

Sending a response to the same request a second time will never work. The way HTTP sessions work is that they end when a response is retrieved.

Glenn - Callinetic

3 Likes