Ir al contenido
Start free

Connect your external agent

Esta página aún no está disponible en tu idioma.

An external agent is anything outside Wabery that stays online and writes customer replies: n8n, Make, Zapier, your app, or your own AI runtime.

It receives a webhook, decides what to say, and sends the reply through Wabery:

Wabery webhook → your logic or AI → POST /v1/messages

In onboarding, choose I already have a backend, then pick your tool.

Need Wabery to provide and host the chatbot instead? Use the hosted-agent guide.

  1. Create a public HTTPS endpoint in your workflow tool and paste it into Wabery. Saving it creates a signing secret, switches the project to external routing, and sends a message.received setup event.
  2. Confirm the endpoint returns a 2xx response for the setup event. It has payload.test: true and synthetic channel and conversation IDs, so acknowledge it without calling the Messages API.
  3. Create the reply-ready wab_live_ project key in onboarding. Keep it secret. The same key works in the shared sandbox and on connected WhatsApp channels.
  4. Join the shared WhatsApp sandbox and send a customer-style message.
  5. Reply by mapping payload.channel_id and payload.conversation_id from the incoming live event into this request:
POST https://api.wabery.com/v1/messages
Authorization: Bearer wab_live_...
Content-Type: application/json
{
"channel_id": "channel_...",
"conversation_id": "conv_...",
"text": "Your generated reply"
}
  1. Start with a Webhook node. Set HTTP Method to POST and Respond to Immediately.

  2. Under Options, add Only Run If and use this expression:

    {{ $json.body.payload.test !== true }}

    Wabery’s setup event still receives 200, but n8n does not run the reply workflow with its synthetic IDs.

  3. Publish the workflow and copy its Production URL, not the temporary Test URL. Paste it into Wabery and choose Save and test webhook. See n8n’s current Webhook node documentation.

  4. Put your routing, data lookup, or AI nodes after the Webhook node.

  5. Finish with an HTTP Request node:

    • Method: POST
    • URL: https://api.wabery.com/v1/messages
    • Authentication: Generic Credential Type
    • Generic Auth Type: Bearer Auth
    • Bearer Token: paste the raw wab_live_... key. Do not add quotes or type Bearer; n8n adds that prefix.
    • Send Body: on
    • Body Content Type: JSON
    • Specify Body: Using Fields Below
  6. Add these JSON body fields. n8n puts the Wabery event under body; explicit Webhook-node references keep working after an AI or logic node changes the current item:

    Name Value
    channel_id {{ $('Webhook').item.json.body.payload.channel_id }}
    conversation_id {{ $('Webhook').item.json.body.payload.conversation_id }}
    text Map your final reply, commonly {{ $json.output }} for an AI Agent node.

    If you rename the Webhook node, use its new name in both ID expressions.

  7. Publish the workflow, then send a real message through the Wabery sandbox to prove the complete reply loop.

The finished shape is Webhook → your logic / AI → HTTP Request.

Do not switch to a real number until the onboarding checklist shows all six tasks complete. The final sandbox task proves both directions: Wabery delivered the inbound event, and your selected platform returned a reply through the Messages API. When it passes, connect the client’s number under Channels.