SOLVED

Are webhooks synchronous?

Go to solution
Grégoire_Miche2
Level 10

Are webhooks synchronous?

When calling a webhook in a smart campaign flow, is Marketo waiting for the webhook response before monving to the next flow step or is it moving to the next flow step immediately after calling the webhook, without waiting ?

-Greg

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Are webhooks synchronous?

AFAIK webhook execution is synchronous.  But that may not be your underlying question, because a data value update as the result of a webhook is asynchronous (it will happen outside of the rest of the flow).

View solution in original post

13 REPLIES 13
SanfordWhiteman
Level 10 - Community Moderator

Re: Are webhooks synchronous?

AFAIK webhook execution is synchronous.  But that may not be your underlying question, because a data value update as the result of a webhook is asynchronous (it will happen outside of the rest of the flow).

Jep_Castelein2
Level 10

Re: Are webhooks synchronous?

If you use the webhook's Response Mapping to save data back to a field in Marketo, that will by synchronous.

Example: In my test system I have a webhook that fixes the case for first name and last name, so if someone fills out a form with "joe" as first name, the webhook will write back "Joe" to the first name field. As a test, I put a 2nd flow step immediately after the Webhook to copy {{lead.First Name}} to another field. That Change Data Value does indeed copy "Joe" to the other field (not "joe"), so the webhook data value change has been processed synchronously.

Anonymous
Not applicable

Re: Are webhooks synchronous?

Will just adding a delay of 2 minutes after web hook not be sufficient?

Direct Data field updates done by the webhook should have been done by that

time?

Or there is something I am missing to consider?

Rajesh

SanfordWhiteman
Level 10 - Community Moderator

Re: Are webhooks synchronous?

If it is asynchronous, as we observed when building out a complex webhook scenario in August, then 2 minutes is just a guess.  I don't like to guess.  Once you have put something in a queue instead of processing it synchronously, then 2m isn't any more guaranteed than 1m or 10m (unless there is an explicit maximum time after which it must succeed or fail).

If it's synchronous, you don't need a wait step at all.

SanfordWhiteman
Level 10 - Community Moderator

Re: Are webhooks synchronous?

We found the direct opposite in extensive testing (w/in the last 2 months).  The sole reason we built out a secondary Data Value Changed trigger was that an immediate field modification could not be trusted -- certainly, we intended to be able to work with the data immediately.  If this has been changed, that would be great.

Grégoire_Miche2
Level 10

Re: Are webhooks synchronous?

Thx Sanford,

Yes, my question was exactly about the data value update as a result of the webhook.

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Are webhooks synchronous?

Yeah, it's annoying.  But it's consistent with other contexts in which we insert/update.

Grégoire_Miche2
Level 10

Re: Are webhooks synchronous?

So here is the idea :

-Greg

Kenny_Elkington
Marketo Employee

Re: Are webhooks synchronous?

There are very good reasons why the data updates are not made synchronously.  It's not possible to generalize the response time of an arbitrary server, so the execution time of a given webhook is unpredictable, and can cause enormous campaign queue backlogs if we made the data value changes synchronous.  The best alternative would be either to use the Webhook is called trigger, or a Data Value Changes trigger with a source type of Webhook.