Skip to main content

How to Create Flows for Your Campaigns with Webhooks Step by Step

Description: Learn how to configure campaign flows triggered by Webhooks in Atom. Connect URLs, JSON parameters, and security tokens to integrate your CRM and automate your mass sends. 🚀

🔗 How to Create Flows for Campaigns with Webhooks Step by Step

In this article we explain how to configure flows in Atom that are triggered by Webhooks. This allows you to automate the execution of WhatsApp campaigns directly from external systems, such as your CRM or ERP.

🏗️ Building the Flow with Webhooks

1. Location in Flowbuilder

Go to the left sidebar menu: Campaigns > Flows > Create Flow.

  • Select Create Flow from Scratch.

  • Choose the WhatsApp number from which the campaign will be sent.

  • Define the Webhook component as the trigger.

2. Webhook Configuration

For the Webhook to work, you should consider the following:

  • Required field: The default parameter will always be "phone".

  • Phone format: Must include the + sign and area code (e.g. +573001234567) with no spaces or hyphens.

  • Required fields: These are the essential data needed to process the sending successfully. Their content varies depending on the information fields linked to the communication template selected for the client.

3. Connection with Templates

To send a campaign, it is essential to connect the Webhook component with the Template component.

  • Go to Settings > Messaging > Templates to create one, or use the Create Template function within the Flowbuilder.

  • If the template has variables (custom fields), these will automatically become required parameters for the Webhook.


🔗 Getting Parameters and URL

Once you've designed the flow, you need the data to integrate it into your CRM or external system. You have two ways to obtain it:

  1. From the editor (Before publishing): Double-click the Webhook component and select "Show POST request". You'll see the JSON with the fields in curly braces {}.

  2. From the viewer (Active flow): In the Campaigns module, select the flow and use the "View flow" action. Within the component you will find:

    • Button 1: Copy the Webhook URL.

    • Button 2: Copy the fields in JSON format.

Example of JSON structure:

JSON

{

"empresa": "Data to send",

"first_name": "Data to send",

"nombre_agente": "Data to send",

"phone": "Data to send"

}


🧪 Testing with Postman

Before putting the campaign into production, simulate the execution by following these steps:

  1. URL: Copy the URL from the Webhooks submodule in Campaigns.

  2. Headers:

    • Content-Type: application/json

    • Authorization: Bearer [Your_API_Token] (Get the token in My Company > Security Settings).

  3. Body: Select raw format and enter the JSON with test data. All values must be enclosed in double quotes.


📊 Common Response Codes

Scenario

Code

Response Body

Successful send

200

{"message":"Webhook executed successfully"}

Token does not exist

401

No authorization token found.

Incorrect token

404

Cannot find a company with uuidToken = xxxxx

Missing parameter

500

{"message": "The parameter xxxx is required"}

Simulation active

500

{"message":"The contact is currently simulating a flow."}


🔄 Return Data via HTTP Request

If in addition to receiving data you want the flow to send information back to your system when it finishes:

  1. Insert the HTTP Request component with POST method.

  2. Enter your system's URL.

  3. Enable the Body toggle and write the JSON.

  4. Use the "/" (forward slash) key to dynamically insert the information fields captured during the conversation (e.g. the identification the customer wrote in the chat).

If you want more information, check out the following article: HTTP Request Component


⚠️ Important Considerations

Authentication: The use of Webhooks requires the API Token obligatorily. If you generate a new one, remember to update it in all your active integrations.

Attention Priority: If the Webhook tries to trigger but the customer already has an active conversation with an advisor, execution will be automatically suspended to avoid interfering with human support.


Connect your systems and let automation do the rest! 🚀

Webhooks are the master key to triggering campaigns from your CRM intelligently. Always make sure to test your connections in Postman, validate that the phone number has the correct international format (+ code) and keep your API Token safe. Ready to send! ✅

Did this answer your question?