N00b question to best practice about handling different message types and flows

(mario menti) #1

Hi all,
I’ve just started looking at FlowXO as primarily a way to embed our content/ existing chatbot in a webchat interface, and it’s looking very promising. I have webhooks set up to receive data from our API, as well as posting user responses back to our API, and am just wondering if in the scenario below I am implementing this in the best way:

  • our API sends 3 different types of data/messages to FlowXO: a question with buttons, a question expecting open text, and a message that doesn’t expect a response from the user
  • at the moment I have 3 separate flows set up in FlowXO, with different webhook URLs, so from our API I am posting to a different webhook depending on the data we send

This appears to work ok, but I’m just wondering if there is a better way of doing this, just using one flow and webhook URL, and handling the different scenarios inside a single flow?

Thanks!
Mario.

(Daniel Beckett) #2

Hi @mario

I think you’re already using your flows in the only way that works. When you setup the webhook trigger you send the data that you need to use during setup so that it can continue to be captured as an output whenever the flow is triggered again.

I’m assuming that all three of your webhooks send different sets of data and such each one would need its own trigger.

(mario menti) #3

Thanks Daniel!

I’m not really sending completely different data, it’s more of a subset, so the main issue I see isnt so much with the data I send to the webhooks, but that I want FlowXO to render a different type of message for each of them. In slightly simplified form, what I’m sending to the webhooks is something like this:

  1. text and buttons --> this should render a question with the choice options
  2. text --> this should render a question that expects a free-text response
  3. text --> this should render a message that is for info only, and expects no response

So 2 and 3 are actually identical in terms of the data I send, and both 2/3 are a subset of 1, but the difference is in what I want FlowXO to do with that data. Having 3 separate flows with their own webhook URLs works, just wondering if that was definitely the best way.

(Daniel Beckett) #4

If all of the data is available in each webhook then technically you could use one flow with some creative Filters.

There’s a tutorial for Using Filters in Flow XO that has some additional information if you’re interested.

(mario menti) #5

Perfect, thanks - yes, in my case Filters do the trick, and make things a bit more streamlined. Thanks for the pointer!