Skip to main content

WhatsApp Meta Integration

To make it easy for your customers to interact with your automation processes and get instant responses using WhatsApp, the messaging platform they already use daily, Automind Agentflow provides seamless integration with WhatsApp through Meta's Business API. This enables customers to start conversations with your automation agent directly within WhatsApp.

The Automind Agentflow platform provides WhatsApp integration via Meta's direct integration, offering robust messaging capabilities and business-grade features.

Important: The Welcome flow will be triggered at the user's first conversation with the bot; the initial user message that starts the conversation will be processed normally.

Prerequisites

Before integrating your Automind Agentflow with WhatsApp via Meta, ensure you have:

  • A built and published Automind Agentflow bot
  • A Meta Developer account with appropriate permissions
  • A WhatsApp Business account
  • For on-premise deployments, ensure access to/from the necessary messaging endpoints:
DirectionEndpoint
Outboundgraph.facebook.com
InboundYour Automind Agentflow domain

Step 1: Create Meta Developer Application

Note: The Meta UI may appear slightly different depending on which version you are using.

Tip: If you already have a Meta app configured for WhatsApp, skip this step and go to Step 2.

Create New Meta App

  1. Access Meta for Developers

  2. Start App Creation

    • On the toolbar, click My Apps
    • Your Apps page will appear
    • Click the Create App button
  3. Configure App Details

    • The Create an app wizard will appear
    • Enter your App name and contact email address
    • This email will be used by Meta to contact you about your app
  4. Select App Configuration

    • Click Next to proceed
    • Select Other as the use case and click Next
    • Choose Business as the app type and click Next
  5. Finalize App Creation

    • Select your Business portfolio from the dropdown
    • Click Create app to finalize the creation
  6. Security Verification

    • For security reasons, re-enter your password when prompted
    • Click Submit to verify your identity

Configure WhatsApp Integration

  1. Add WhatsApp Product

    • Find the WhatsApp product in your app dashboard
    • Click Set up to begin WhatsApp configuration
    • The WhatsApp Quickstart page will appear
  2. Generate Initial Access Token

    • Click Start using the API to test message sending
    • Click the Generate access token button
    • Follow on-screen instructions to grant the app access to manage your WhatsApp account
  3. Test Message Functionality

    • Select your test phone number in the From field
    • Enter a recipient phone number in the To field
    • Ensure the number is correct as it will be added to your list of test recipients
    • Click Send message to test the integration

Note: When ready for production, you'll need to use your registered business phone number to send messages to users.

Note: Test phone numbers are limited to 5 recipients. Production phone numbers don't have this limitation.

Step 2: Generate Permanent Token for Your App

To generate a permanent access token, you must create a system user with appropriate permissions in Business Manager.

Create System User

  1. Access Business Settings

  2. Add New System User

    • In the System users page, click the Add button
    • Enter a descriptive name for the system user
    • Select Admin from the System user role dropdown
    • Click Create system user

Assign Assets and Generate Token

  1. Assign App Assets

    • Click the actions icon (three dots) in the top-right corner
    • Select Assign assets
    • Choose your Meta app and grant Full Control permissions
  2. Assign WhatsApp Account

    • Click on WhatsApp accounts tab
    • Select your WhatsApp Business account
    • Grant Full Control permissions to manage the WhatsApp account
    • Click Assign assets
  3. Generate Permanent Token

    • Click Done to save asset assignments
    • Click the Generate token button in the top-right corner
  4. Configure Token Settings

    • Select your app from the dropdown and click Next
    • Choose Never for token expiration and click Next
    • Select the two WhatsApp permissions:
      • WhatsApp Business Management
      • WhatsApp Business Messaging
    • Click Generate Token
  5. Save Access Token

    • Copy the generated permanent access token
    • Store it securely as you'll need it for Automind Agentflow configuration
    • Click Done to complete the process

Important: You can only view the token once. Each new system user requires a newly generated token.

Step 3: Create WhatsApp Channel in Automind Agentflow

Configure Channel Settings

  1. Access Channel Creation

    • Log into your Automind Agentflow Portal
    • Navigate to Channels from the sidebar menu
    • Click the New button to start creating a new channel
  2. Configure Basic Information

    • Enter a descriptive Name for your WhatsApp channel
    • Provide a Description explaining the channel's purpose
    • Select your Agent from the dropdown menu
    • Choose WhatsApp from the Platform dropdown
    • Click Next to proceed
  3. Configure WhatsApp Specific Settings

    • WhatsApp Secret: Enter your Meta app secret
      • To retrieve this: Go to Meta for Developers
      • Select your app and navigate to Basic Settings
      • Click Show next to App secret
      • Enter your Facebook password when prompted
      • Copy the revealed App secret
    • Phone Number Id:
    • Token: Enter the permanent token generated in Step 2
    • API Version: Enter your Meta app's API version (format: v##.#, e.g., v15.0)
    • Click Next to continue
  4. Complete Channel Setup

    • Copy the Callback URL displayed on the final page for webhook configuration
    • Click Create Channel to finalize the setup
    • The channel will be created and activated

Available Context Parameters

After successful channel activation, Automind Agentflow provides these user context parameters:

  • [[ChatUser]].ChannelId = "meta-whatsapp"
  • [[ChatUser]].UserId - Stores the user's phone number
  • [[ChatUser]].ChannelBotIdentifier - Stores the bot number through which messages arrive
  • [[HelpdeskClient]].PhoneNumber - Stores the user's phone number for live chat sessions
  1. Save Configuration
    • Click Save & Close to save the WhatsApp channel configuration

Step 4: Enable Webhooks

Webhooks are essential for receiving messages and events from WhatsApp users in your Automind Agentflow.

Configure Webhook Settings

  1. Access WhatsApp Configuration

  2. Set Webhook URL and Token

    • In the Webhook section:
      • Callback URL: Enter the Automind Agentflow Callback URL from Step 3
      • Verify Token: Enter the Webhook Verify Token generated in Step 3
    • Click Verify and save
  3. Subscribe to Webhook Events

    • After verification, webhook fields will appear
    • Subscribe to the following essential events:
      • messages - Receive user messages
      • message_template_status_update - Track message template status

Finalize Integration

Once webhook configuration is complete, your Automind Agentflow integration with WhatsApp via Meta is ready to use.

Note: The Meta app remains in Development Mode until published. API functionality only works for admins, developers, and testers until the app is made public.

Next Steps:

  • Submit your Meta app for review
  • After successful review, make the app public for production use

Step 5: Associate Multiple Phone Numbers (Optional)

Note: Support for multiple phone numbers requires Automind Agentflow v8.3 or higher.

If your organization needs to operate multiple WhatsApp numbers with the same automation agent:

  1. Add Additional Numbers

    • Go to WhatsApp Manager
    • Increase limits for your WhatsApp account
    • Add new phone numbers as needed
  2. Configure Number-Specific Workflows

    • Each phone number can have distinct conversation flows
    • Use [[ChatUser]].ChannelBotIdentifier to route conversations appropriately

For detailed information about phone number limits, see Meta's Phone Number Limits documentation.

Step 6: Start Using Your Automind Agentflow

Access the Agent

  1. Direct Testing

    • In Automind Agentflow Portal, go to Bot Settings > Channels
    • Click the WhatsApp channel icon to open a direct chat
    • Start testing your automation workflows
  2. User Interaction

    • Users can find your WhatsApp Business number
    • They can start conversations directly in WhatsApp
    • The agent will respond based on configured automation workflows

Conversation Management

  • Automatic Welcome: When users initiate conversations, the Welcome flow triggers automatically
  • Multiple Numbers: If using multiple phone numbers, each generates unique conversation IDs
  • Context Preservation: User context and conversation history are maintained across interactions

Note: When users send messages to multiple phone numbers associated with the same bot, different conversation IDs are generated for each number, ensuring proper conversation tracking.

Voice Message Support

Automind Agentflow supports voice message processing through Microsoft Cognitive Services and ElevenLabs integration.

How Voice Messages Work

  1. Receive Audio

    • When users send voice messages via WhatsApp:
      • Audio is processed using configured speech services
      • Language recognition uses the user's language setting ([[ChatUser]].Language)
      • Message type is logged as 'Audio Recording' in conversation history
  2. Process Audio

    • Voice messages are converted to text using Microsoft Cognitive Services or ElevenLabs
    • Converted text is used to predict the next automation step
    • Processing supports all languages available in Azure Speech Service
  3. Respond

    • By default, the agent responds to voice messages with text
    • Optionally, configure voice responses for enhanced user experience

Enable Voice Message Support

For Automind Agentflow v8.10 and higher:

  1. Configure Speech Provider

    • In channel configuration, enable Support voice messages
    • Select speech provider (Azure or ElevenLabs)
    • Enter required API credentials:
      • Azure: Speech API key and region
      • ElevenLabs: API key
  2. Configure Voice Responses (Optional)

    • Toggle Reply with voice messages to enable voice responses
    • Add language and voice combinations:
      • Select bot language from dropdown
      • Choose human-like neural or standard voice
      • Save each configuration
  3. Save and Publish

    • Save voice configuration settings
    • Publish channel if not already published
    • Save bot configuration

Note: ElevenLabs speech provider is available in Automind Agentflow v9.0 and higher.

Features and Capabilities

Your Automind Agentflow on WhatsApp supports:

  • Rich Messaging: Text, images, documents, and voice messages
  • Interactive Elements: Quick replies, buttons, and structured responses
  • File Handling: Document sharing and processing capabilities
  • Voice Processing: Speech-to-text and text-to-speech functionality
  • Multi-Number Support: Multiple phone numbers with the same agent
  • Context Awareness: User information and conversation history
  • Automated Workflows: Execute complex automation processes via chat

Troubleshooting

Common Issues

  1. Webhook Verification Fails

    • Verify the callback URL is correctly entered in Meta configuration
    • Ensure the verify token matches exactly
    • Check that your Automind Agentflow instance is accessible from Meta's servers
  2. Messages Not Received

    • Confirm webhook events are properly subscribed
    • Verify the WhatsApp channel is published in Automind Agentflow
    • Check that the permanent token has appropriate permissions
  3. Token Expiration Issues

    • Ensure you selected "Never" for token expiration
    • Verify the system user has full control over both app and WhatsApp account
    • Regenerate token if necessary
  4. Multiple Phone Number Conflicts

    • Enable phone number validation in Automind Agentflow
    • Ensure each number is properly configured in WhatsApp Manager
    • Verify that [[ChatUser]].ChannelBotIdentifier is being used correctly

Best Practices

  • Testing: Thoroughly test in development mode before submitting for review
  • Compliance: Ensure your use case complies with WhatsApp Business policies
  • User Experience: Design clear conversation flows and helpful responses
  • Monitoring: Regularly check conversation logs and user feedback
  • Security: Keep API tokens and secrets secure and rotate them periodically