How to create a Facebook Messenger chatbot

Image of an author
Sylwia Kocur
9 min read
updated: Aug 19, 2026

This guide shows you how to create a Facebook Messenger chatbot in two ways:

  • Use AI Agent in Text for the current, recommended experience. It can answer questions using your knowledge sources and customer context, follow your instructions, use Skills, and transfer conversations to your team.
  • Keep using the previous ChatBot.com workflow if you already manage a ChatBot.com chatbot with the Visual Builder and AI Assist.

For a new setup, start with AI Agent in Text. If you already use the previous ChatBot.com Visual Builder and AI Assist workflow, follow the second part of this guide.

Start with the recommended Messenger chatbot setup

Create an AI Agent in Text, connect your Facebook Pages, and manage automated and human conversations from one Inbox. Try Text for free.

Start with the recommended Messenger chatbot setup

Create an AI Agent in Text, connect your Facebook Pages, and manage automated and human conversations from one Inbox. Try Text for free.

How to create a Messenger chatbot with AI Agent in TextLink icon

Before you begin, make sure you have:

  • A Text account and an Owner or Admin role. Only Owners and Admins can edit AI Agent settings or turn the AI Agent on and off.
  • The login details for your Facebook account.
  • Admin access to every Facebook Page you want to connect. The Pages must be added to your Facebook profile or business account.

Step 1: Set up AI Agent in TextLink icon

  1. In Text, go to Team and open AI agents.
  2. Select the AI Agent you want to use for Messenger conversations.
  3. Customize its profile and instructions, then add the knowledge sources and Skills it needs.
  4. Make sure the AI Agent belongs to the chatting team that should receive Messenger conversations.
  5. Go to Team > Teams, open that chatting team, and set Chat assignment to Automatic. Manual chat assignment does not work with an AI Agent.
  6. When the setup is ready, set the AI Agent to Accept chats.

Learn more about profiles, knowledge, instructions, languages, and Skills in AI agents.

Step 2: Connect Messenger to TextLink icon

  1. In Text, go to Settings > Messenger.

  2. Select Continue with Facebook, then log in with your Facebook credentials.

  3. In the Meta setup wizard:

    • Select the Facebook Pages you want to connect.
    • Choose your Business account.
    • Review and accept the required permissions.
    • Select Save.
  4. Back in Text, select Connect next to each Page from which you want to receive messages.

Text Messenger settings showing Facebook Pages and Connect buttons used to receive messages in the Text Inbox.

Messenger messages from connected Pages can now appear in the Text Inbox. For connection management, including disconnecting or removing a Page, see Connecting Messenger to Text.

Step 3: Route Messenger chats to the AI Agent’s teamLink icon

If the AI Agent’s chatting team is your Fallback team, Messenger conversations that do not match another rule will already go there. To send Messenger conversations—or conversations from a specific Facebook Page—to another team, create a Chat routing rule:

  1. Go to Settings > Chat routing.
  2. Select New routing rule.
  3. Add the Customer’s channel condition, choose Messenger, and select the Facebook Page when you want the rule to apply to one Page only.
  4. Set the action to Route to team, then select the chatting team that contains your AI Agent.
  5. Enter a name in Describe rule and select Create rule.

Text Chat routing rule with Messenger and a Facebook Page as conditions, routing conversations to the Tech support team.

Chat routing rules run from top to bottom, and the first matching rule is applied. Put specific Page rules above broader Messenger rules. This feature is available on the Growth and Enterprise plans. See Chat routing rules for the complete setup.

Step 4: Test the Messenger connectionLink icon

  1. Go to Settings > Messenger.
  2. Select Open next to the connected Facebook Page.
  3. Open the Messenger link or scan the QR code, then send a test message.
  4. In Text, confirm that the conversation appears in the Inbox and that the AI Agent responds as expected.

If messages do not arrive or replies fail, use How to troubleshoot Messenger: common issues and fixes.

Step 5: Set up human handoffLink icon

  1. Go to Team > AI agents and select your AI Agent.

  2. Open Skills, then select Transfer to human.

  3. Choose one of the transfer options:

    • Automatic transfers the chat to the first available teammate in the same team.
    • Transfer to a specific team sends the chat to the team you select. This option appears when your Text account has more than one team.
  4. Optional: enable Create a ticket. If no teammate is available within 30 seconds, the AI Agent can create a support ticket instead.

  5. Save your changes.

Transfer to human Skill settings in Text with automatic transfer and ticket creation enabled.

Transfers can occur when the AI Agent cannot answer or when a customer asks for a human. Preview shows when a transfer would be triggered, but it does not perform the transfer, so complete the final check through the connected Messenger Page.

How to connect Messenger with the previous ChatBot.com workflowLink icon

The following instructions are for the previous ChatBot.com Visual Builder and AI Assist workflow. Use them when you want to connect an existing ChatBot.com chatbot directly to a Facebook Page.

Connect your chatbot to a Facebook page with a few clicks. This will make it easier for your followers and potential customers to connect with you regardless of the time of day.

Start your free ChatBot.com trial to connect the bot to your Facebook page!
Start your free ChatBot.com trial to connect the bot to your Facebook page!

The bot will ensure your customers are always cared for, and you can review their chats in the Archives. You can stay on top of the cases resolved by the bot by adding your users to Segments and collecting their information in the All leads section in the Visitors section.

Good to knowLink icon

  • The integration does not support the typing indicator, delay, and welcome interaction, so you must remember to put the User input block at the beginning.

    Check what Keywords/Machine Learning phrases you have in the User input block at the start of your bot flow - you need to use them correctly for the bot to start the chat later. You can also create an attribute with the Any validation type.

  • If you previously integrated bots into Facebook Messenger, you might need to use the Edit settings option first to ensure the correct page is selected.

  • Facebook allows only 3 buttons in the Button bot response type. So, if you have more than 3 options and you’d like to use the button response, use the Gallery response, where you can add more than one card within one bot response.

  • The Get started button informs users about the possibility of connecting with your chatbot. We recommend turning it on because it improves the conversation flow. Every user who clicks on this button will see your welcome message. 

    If you turn the Get started button off, the welcome interaction will be triggered only if a user types in the input that matches this interaction. In other cases, the bot may display the fallback message. It’ll be repeated until the user’s query matches the phrases included in your bot flow. In this case, you can’t get full control over your chatbot’s behavior and experience.

Connect ChatBot.com with MessengerLink icon

You can connect your bot to the Facebook page in the bot builder view.

Before you start the integration process, ensure your page is not added to the Meta Business Suite. You won’t see the page on the pages list available to connect if the page is added to the Suite.
Before you start the integration process, ensure your page is not added to the Meta Business Suite. You won’t see the page on the pages list available to connect if the page is added to the Suite.
  1. Go to your bot and open the Integrations panel. Choose Messenger from the list.

ChatBot Visual Builder with the Add integration panel open and the Messenger Connect action highlighted

  1. Continue with your logged-in account. Choose the Opt in to current Pages only option (1) and select the page from the list (2). Continue.

Meta setup window for ChatBot with Opt in to current Pages only and a Facebook Page selected

  1. Review and ensure all permissions are granted. Save.

Meta access review for ChatBot.com showing the requested Facebook Page permissions and Save button

  1. The selected page will be displayed in the integration configurator. Click the Connect button.

ChatBot Messenger integration panel showing a selected Facebook Page and the Connect button.

  1. Decide whether to turn the Get started button on or off. Add a Welcome greeting that will show in the Messenger window. Click the Add integration button.

    We recommend turning the Get started button on.

ChatBot Messenger settings with the Get started button enabled, a Welcome greeting field, and Add integration.

  1. The integration will appear on the integrations list.

How to disable the Messenger integrationLink icon

When you finish the integration process, it is active by default on the list. You can disable it by sliding the toggle to the off position in the Integrations panel. When the integration is inactive, the slider is gray.

ChatBot Integrations panel showing an active Messenger integration toggle.

Switch the toggle back on to enable the bot on your Facebook page again.

How to delete the Messenger integrationLink icon

To delete the integration, go to the Integrations panel and click on the Facebook integration. Click the Delete integration button at the bottom. Confirm your choice.

ChatBot Messenger integration settings with the Delete integration action.

Deleting the integration erases the bot from the Facebook page entirely. If you’d like to enable the bot again, you must start the integration process from the start.
Deleting the integration erases the bot from the Facebook page entirely. If you’d like to enable the bot again, you must start the integration process from the start.

Integrating ChatBot.com with LiveChat and MessengerLink icon

To Integrate ChatBot.com with both LiveChat and Messenger, you need to add the Facebook Messenger integration on the LiveChat side first. Only after that can you add ChatBot.com to LiveChat.

If you’ve already integrated ChatBot.com with Messenger and want to add the LiveChat integration, you need to disconnect ChatBot.com from Messenger first. Then, integrate LiveChat with Messenger. Lastly, connect ChatBot.com with LiveChat by following this tutorial.

FAQLink icon

  • While integrating ChatBot.com with Messenger, I can’t see any of my fan pages on the list. What should I do? - Log out of Facebook in your ChatBot.com app. Log in again, and click on the Edit Settings button. Your fan pages should appear on the list.

  • How can I verify whether ChatBot.com is connected to my Facebook page?

    1. Go to your page Settings.
    2. Go to the Page setup section.
    3. View the Advanced Messaging section.
    4. The ChatBot.com app should be at the top of the site.

    If you integrate ChatBot.com with LiveChat and Messenger, LiveChat should be displayed on that list instead of ChatBot.com.

  • Why doesn’t my bot function properly after integrating ChatBot.com with Facebook Messenger? - You probably turned the Get started button off. If you do that, a chat session starts when a user sends a message, and not when they click on the Get started button. Then, if a user asks a question that isn’t covered in the story, the bot will display the fallback message, and that’s not a bug.

    How you can change that:

    • If you’re using ChatBot.com, Messenger, and LiveChat together, enable the pre-chat form.
    • If you’re using the ChatBot.com and Messenger integration, enable the Get started button.

    How can you enable the Get started button in Facebook Messenger?

    • If you’re using the ChatBot.com and Facebook Messenger integration, you can turn on the Get started button in the Integrations section here.
    • If you’re using ChatBot.com, LiveChat, and Messenger together, you have to do it via the API call described here.

Read more:

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

Ready for more than a chatbot?
Try AI Agent in Text.

AI Agent trains on your data, resolves issues across live chat and help desk, and takes real actions in your business systems.

14-day free trial No credit card required