noor h
noor h

Reputation: 1545

Is it possible to make two webhook calls at the same time?

I'd like to know if I can make 2 webhook calls at the same time.

I have two cloud functions: 1) Inserting a user 2) Capture user inputs

How can I go about that using webhooks on watson assistant?

(I've already posted this question on the IBM developer forum but didn't get an answer.https://developer.ibm.com/answers/questions/520504/is-it-possible-to-make-two-webhook-calls-at-the-sa.html)

Upvotes: 1

Views: 998

Answers (1)

data_henrik
data_henrik

Reputation: 17118

Right now, there is only a form to add a single webhook to the dialog node. The reason is that each call returns values which then need to be processed by the node. Thus, you cannot make them in parallel.

If you want to make two calls for the same input data, you could do one of:

  • make a master webhook that then calls the other webhooks
  • define a sequence of actions to be processed and which is called from Watson Assistant
  • first call one webhook, then have a dependent node which is processed without user input, from that node perform the second webhook call

There are probably even more options, it depends on the call semantics and whether your webhooks are dependent on results / inputs or not.

One of my code samples uses a dispatch semantic to call other functions. It can be done within the same action as shown for simplicity, calling into other functions (using composer) or using REST calls into other webhooks.

Upvotes: 1

Related Questions