Getting Started
Using orvachat with n8n
Receive WhatsApp messages in n8n and send replies with the HTTP Request node.
n8n can receive WhatsApp messages from orvachat and send replies, without writing a server. You need two nodes: a Webhook node to receive, and an HTTP Request node to send.
Receive messages
- Add a Webhook node. Set HTTP Method to
POST. Copy its Production URL. - Paste that URL as the webhook URL on the Developer API page. Keep the
Messageevent on. - Activate the workflow, then press Send test event on the Developer API page. The test event shows up in n8n.
- The message text is in
{{ $json.body.event.Message.conversation }}, and the chat to reply to is in{{ $json.body.event.Info.Chat }}. See How To Receive Messages.
Only answer new messages
Your webhook also gets other events (for example ReadReceipt and the test event), and a Message event for every message you send from the phone. Don't reply to those.
- Add an IF node after the Webhook node (after the Code node, if you check the signature).
- Condition 1:
{{ $json.body.type }}is equal toMessage. - Condition 2 (AND):
{{ $json.body.event.Info.IsFromMe }}is false. - Connect the true output to the HTTP Request node below. If you don't need read ticks, turn
ReadReceiptoff on the Developer API page.
Send a reply
- Add an HTTP Request node. Method
POST, URLhttps://orvachat.com/api/v1/chat/send/text. - Authentication: Generic Credential Type → Header Auth. Name
Authorization, ValueBearer YOUR_API_KEY. - Body: JSON, for example
{ "Phone": "{{ $json.body.event.Info.Chat }}", "Body": "Thanks, we got your message" }.
Check the signature (optional, recommended)
Add a Code node after the Webhook node. It stops the workflow when the X-Webhook-Signature header is wrong.
// n8n Code node ("Run Once for Each Item")
const crypto = require("crypto");
const secret = "YOUR_SIGNING_SECRET";
const raw = JSON.stringify($json.body); // see the note below
const header = $json.headers["x-webhook-signature"] ?? "";
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(raw).digest("hex");
if (header !== expected) throw new Error("Bad signature");
return $input.item;Tip
On self-hosted n8n the Code node can only load crypto when you start n8n with NODE_FUNCTION_ALLOW_BUILTIN=crypto.
The signature is made from the exact body we send. Re-encoding $json.body usually gives the same text, but for a sure match turn on the Webhook node's Raw Body option and sign that instead.
Important
The API works only for numbers in Developer API mode. In AI Agent mode the API answers 403 and the agent replies instead. Change a number's mode in your orvachat dashboard.