Using JS Function in Wabo.ai Bot Builder

Wabo.ai allows advanced users to enhance bot behavior by injecting custom JavaScript functions within any node. This feature gives you the flexibility to manipulate data, control flow, or perform complex operations dynamically inside your bot conversations.


🛠 When to Use the JS Function Action

  • To perform custom logic before or after a message

  • To manipulate user inputs or flow variables

  • To fetch or format data dynamically

  • To make flow execution smarter and context-aware


✅ Step-by-Step Guide to Use JS Function in a Bot Node

1. Go to the Bot Builder Module

  • Open Wabo.ai and navigate to the Bot Builder from the left-hand menu.

2. Create or Manage a Bot

  • Select an existing bot or create a new one.

3. Access Flow Builder

  • Go to the Flow Builder section within the selected bot.

4. Choose a Node for JS Logic

  • Select or create the specific node where you want to add JavaScript logic.

5. Open Node Actions

  • Hover over the node to see various icons.

  • Click on the Action (⚙️) icon.

6. Select JS Function

  • In the action card that appears, click on JS Function.

7. Enter Your JavaScript Code

  • A text area will appear where you can input your JavaScript code.

  • Write your logic inside this box. For example:

if (userInput === 'yes') {
  flow.next = 'FollowUpNode';
} else {
  flow.next = 'ExitNode';
}

8. Save the Function

  • After writing your code, click Save to apply the JS logic to the node.


💡 Pro Tips

  • Use JS functions only if you're comfortable with scripting.

  • Always test your flow after adding custom code to ensure it behaves as expected.

  • Keep logic simple and readable for easier debugging.


Was this article helpful?