How to create a bot router with 3 subbots February 13, 2023 19:48 Updated Index: Creating an example bot from the Brazilian branch Creating a sample EUA branch bot Creating the main subbot Creating the bot router Configuring the services on the bot router Testing the bot router Understanding redirection between bots Testing the subbots (they should be tested in isolation) To exemplify how to create a bot router and subbots architecture in Blip, we will implement the example discussed in the article Bot and subbot hierarchy. IMPORTANT: This is an extensive tutorial, please read the previous theoretical article carefully and make sure you understand all the concepts and the example before continuing. Creating an example bot from the Brazilian branch 1.1 - Access the Blip portal and click Create chatbot 1.2 - Choose the option Create from scratch 1.3 - Give a name to your bot (for example Filial Brasil) 1.4 - Access the Builder module 1.5 - Click on Settings 1.6 - In the right side menu, choose Versions> Import Flow 1.7 - Download and import the file filialbrasil.json 1.8 - Click Publish flow to make the bot available Creating a sample EUA branch bot 2.1 - Access the Blip portal and click Create chatbot 2.2 - Choose the option Create from scratch 2.3 - Give your bot a name (for example Filial EUA) 2.4 - Access the Builder module 2.5 - Click on Settings 2.6 - In the right side menu, choose Versions> Import Flow 2.7 - Download and import the file filialeua.json 2.8 - Click Publish flow to make the bot available Creating the main subbot 3.1 - Access the Blip portal and click Create chatbot 3.2 - Choose the option Create from scratch 3.3 - Give your bot a name (for example BotPrincipal) 3.4 - Access the Builder module 3.5 - Click on Settings 3.6 - In the right side menu, choose the option Versions> Import Flow 3.7 - Download and import the botprincipal.json file 3.8 - Click Publish flow to make the bot available Creating the bot router 4.1 - Access the Blip portal and click the Create router button 4.2 - Give a name to the bot router (for example Filial Irlanda) 4.3 - Publish the bot to the desired channels Configuring the services on the bot router 5.1 - Access the bot router on the portal 5.2 - Click on the Services module 5.3 - Add the BotPrincipal main bot by defining a name for the service (for example BotPrincipal). Remember to mark it as the main subbot 5.4 - Add the Filial Brasil subbot by defining a name for the service (for example FilialBrasil) 5.5 - Add the Filial EUA subbot by defining a name for the service (for example Filial EUA) Testing the bot router 6.1 - Access the bot router on the portal 6.2 - Click the button to test your bot 6.3 - Send a message and choose which language you want to speak. You will notice that one of the subbots will respond, according to the choice made Understanding redirection between bots 7.1 - Access BotPrincipal and click on Builder 7.2 - Double-click the Welcome block. Note that this is a simple block that sends a question to the user about which language they prefer. The exit conditions of this block are also very simple and only check the user's choice to send it to two different blocks: Redirects Filial Brasil and Redirects Filial EUA 7.3 - Double click on the blocks Redirects Filial Brasil and Redirects Filial EUA. Access the action tab of these blocks and notice that they use a Redirect action for one of the two services defined in the bot router 7.4 - Access the Filial Brasil and Filial EUA subbots and access the Builder module 7.5 - Realize that the two bots work in exactly the same way, the only difference is that the content of one is Portuguese while the content of the other is English. Access the Filial Brasil, for example and double-click on the Welcome block. The contents of this block inform the client that the bot speaks in Portuguese and asks the user if he wants to return to BotPrincipal. The exit conditions of this block are also very simple and basically analyze the user's choice. If he clicks Yes the user is sent to the block Return to the main bot, if he clicks no the user goes back to the block Welcome 7.6 - Access the Return to main bot block now and click on the Actions tab. Note that the only action in this block is a redirect to the BotPrincipal service 7.7 - Review steps 7.5 and 7.6 for the Filial EUA bot Testing the subbots (they should be tested in isolation) To test or change something in a subbot do the tests in a localized way in each bot. 8.1 - Access the bot you want to test / change 8.2 - Make the desired changes / tests If you have any questions use our forum http://forum.blip.ai. For more information, visit the discussion on the subject in our community or the videos on our channel. 😊 Related articles Undestanding bot and subbot hierarchy (or architecture) How does redirection between subbots work? Sending WhatsApp Active Messages on Blip Desk Audience file configuration - Bulk notification sending Setting up Session Expiration and Timeout