How split (trigger) a flow into 2 (for two languages?

(Vlad) #1

Hi.
I want to write a bot that speaks 2 languages. To do this, I create two flows (in each language) and after the start message try to make a choice of the flow with the desired language. I’m trying to implement this with Trigger a Flow, but it does not work out for me. Please tell me how it should be (detailed example, please)

(Karen Barker) #2

Hi,

What platform are you building your bot on?

If you’re using Facebook messenger then you can create a catchall flow which webhooks to the Facebook User Profile API. Using this you can return the users locale. You can install this flow to help set the webhook up - you’ll just need to add your Facebook access token. You can then set up individual flows for each of the languages you want to support. In the catchall flow, you’ll want to use the Trigger a Flow action with Filters to ensure the correct language flow is run based on the users locale.

If you aren’t using Facebook Messenger, then you can still do this method, you’ll just need to ask the user for their preferred language in your first flow.

Alternatively you could create one flow and then duplicate each message within the flow for each of the languages you are supporting. These will need to be Filtered based on the language the user requires.

I hope this helps. :thumbsup:

1 Like
(Vlad) #3

Dear Karen,

Thank you for answer and sugestion. I trying to make bot (flow) for Telegram.
Unfortunatly I can’t install your flow (access danied). Do you can give me flow examle for Telegram bot with Trigger a Flow to split into two flows.

Best regards.

(Karen Barker) #4

Hi Vlad,

My apologies I shared the wrong link above - that has now been updated to a link that should install correctly - however that will only work on Facebook Messenger.

On Telegram you will need to create a Flow which asks the user for the preferred language and then triggers the flow for that language. There’s an example flow here which shows how to do this - I’ve included setting an attribute for the language as well so you could filter the triggers of your language flow based on that attribute and then returning customers wouldn’t need to answer this question.

(Vlad) #5

Dear Karen,

thanks for the detailed answer and a great example.
Please do not judge too harshly my meager skills, but I still can not understand how to trigger to the another right flow (English or French or Russian). Please add one more flow to this “lesson” (English, for example) which will be triggering from “Ask User for Language and Trigger specific language flow”.
And further. Can I change the language of the bot when select language?

Regards,
Vlad

(Karen Barker) #6

Hi Vlad,

Your flows for each of the languages just need to be either a Flow Trigger or a Keyword Trigger that holds the same text as the “Trigger a Flow” actions in the flow I sent ealier. So for example I use the keywords “English”, “French” and “Russian” in there, so you would have 3 separate flows each triggering on 1 of those 3 keywords.

You can only select 1 language for a bot and this cannot be changed. However, all that selecting the bot language does is automatically translate any default bot messages for you. These messages are actually the default responses for wrong answers to the Ask a Question action and you can customise these under the Advanced Options tab for this service.

(Vlad) #7

Thanks for the clarification.

I will try and maybe come back for advice. :wink:

Best regards,

Vlad