Now you can see your first node in the workspace, how about on your testing chatbot? In this section, we will teach you to create another type of node: Global Node. Global node allows you to trigger the same node at any point of your conversation flow.
Once added to Channel, Global Node is often used as a "door" to kickstart a conversation. For example, it is used extensively on the "Get Started" button or the "Persistent Menu" buttons of Facebook Messenger.
Without a Global Node, no one can ever kick-start your conversation tree.
You should also be able to trigger the first node on your testing chatbot in two ways: by clicking the Get Started button or the Main Menu button.
Create 1st Global Node: Main Menu
Enter your Bot Builder.
- Select "+" on right top corner of workspace.
- Select "+ Global Node".
Head to the "Node Inspector" and name your global node.
Usually we would put Global at the end of the global node to identify it from the tree node with the same name. Since we are going to create a persistent menu button Main Menu to trigger our first node, name the global node "Main Menu Global".
Create a Trigger
- Scroll down to "Trigger" and click "+ New Trigger".
- A new window of Trigger Builder will be opened. You can first name your trigger.
- Under Resource Template, select "Keywords / Payload" from the dropdown.
- Type the payload and then click "Enter" to confirm. The payload is "MAIN_MENU" in this example.
- Finally, you can "Save" the trigger settings and close the pop-up window.
Toggle on Redirect
Scroll down to "Redirect" and toggle it on (it will turn green).
Select the tree and node you want to redirect your users to whenever they click on this global node and usually it's the tree and you are editing right now. So for tree, select "Restaurant Info Tree"; for node, select your first node "User clicks Get Started".
Sometimes we could also redirect users from one tree to another tree. It is applicable when you have multiple trees in your channel.
- Click "Save" at the bottom to save the node.
Create 2nd Global Node: Get Started
- Repeat the same steps from 1 to 12 to create another global node: "Get Started Global".
The payload for this global node is "Get_STARTED" in this example.
Add Tree to Channel
- Head back to "Channel". Enter your Facebook channel. Click "Edit" to enter into the testing channel.
- On the left tab, click "Tree Settings". Click "+ New Tree" under "Default".
- Select the tree from the dropdown, and select the global nodes. Remember to "Save" the tree settings.
Set up Persistent Menu
Now you have to add the menu button "Main Menu" on the Persistent Menu.
- In "Channel" -> "Platform", please make sure you have "Get Started" setup.
- Scroll down to Persistent Menu and click "+ Button".
- Fill in the Title and Payload, this payload should match with the payload you have created for the global node. Remember to Save the persistent menu settings.
Sometimes the persistent menu will be cached and it needs a little time to refresh. One trick to refresh conversation is to delete the whole conversation manually and you should be able to see the changes immediately. Try killing the app if you still can't see the new changes.