WhatsApp official API in Pipedream: HTTP trigger

Connect Pipedream to the official WhatsApp API via CRPRO Hub: the HTTP trigger, raw body for the signature, instant $.respond and a Node.js step.

Pipedream has an HTTP trigger that generates a URL for your workflow and Node.js code steps, which makes it a CRPRO Hub webhook receiver with little effort. The difficulty is the signature: checking the HMAC needs the raw body, and in Pipedream that takes a special URL parameter. This article shows the route to send, the route to receive with verification, and the doubts the documentation does not settle that you need to test.

What the HTTP trigger hands to the workflow

Short answer: a unique URL, usually on m.pipedream.net, and the event with body, headers, method, path, query, url and client_ip. The JSON body becomes a JavaScript object, and header names arrive lowercase.

According to the documentation, selecting the HTTP trigger makes Pipedream create a unique endpoint for the workflow, reachable over HTTPS, although it also accepts HTTP. steps.trigger.event.body holds the parsed body, and steps.trigger.event.headers the headers with lowercase names, like x-hub-signature-256. This matters because the Hub headers are X-Hub-Timestamp, X-Hub-Delivery-Id, X-Hub-Signature-Version and X-Hub-Signature-256, and the code must read them by lowercase names. The Hub requires HTTPS, does not follow redirects and expects a 2xx within 10 seconds.

How to send a message with a Node.js step

Short answer: a code step with axios, which Pipedream's documentation uses in its examples, POSTs to /api/v1/channels/{id}/messages with Authorization: Bearer and Idempotency-Key. The Hub answers 202.

  • Create the API key in the Hub dashboard with the messages:send scope (authentication). The value is shown only once.
  • Store the key in Pipedream environment variables and read it with process.env, as the documentation indicates, instead of putting it in code.
  • Every Node.js step is a defineComponent with a run({ steps, $ }) method. Props defined in props are read with this.name.
  • Data leaves the step through return or $.export, and must be JSON-serializable.
  • The Idempotency-Key is mandatory. Use something stable per message, such as the received event's message_id, or the workflow execution id if the step is fired by another trigger.
import axios from "axios"; export default defineComponent({ props: { telefone: { type: "string", label: "Telefone (codigo do pais, so digitos)" }, texto: { type: "string", label: "Texto" }, }, async run({ steps, $ }) { const r = await axios({ method: "post", url: "https://crprohub.com/api/v1/channels/" + process.env.CRPRO_CANAL_ID + "/messages", headers: { Authorization: "Bearer " + process.env.CRPRO_API_KEY, "Idempotency-Key": "pd-" + steps.trigger.context.id, // unico por execucao do workflow }, data: { to: this.telefone, type: "text", text: { body: this.texto } }, }); return r.data; // { data: { message_id, status: "accepted" } } }, });
Pipedream's documentation describes steps.trigger.context.id as an identifier unique to each workflow execution, but it changes on an automatic retry (the trace_id stays the same). If you need a key that survives retries, derive it from data in the trigger itself. The same key with the same body returns the original response; with a different body, the Hub answers 409 IDEMPOTENCY_KEY_REUSED.

The Hub limits are 60 messages per minute per channel and 120 requests per minute per organization and credential. The body fields are in the quickstart.

Receiving with verification: the raw body in Pipedream

Short answer: append ?pipedream_upload_body=1 to the URL registered in the Hub. Pipedream then saves the raw body to a file and exposes, in steps.trigger.event.body.raw_body_url, a signed URL that expires in 30 minutes. Download that file in the step and compute the HMAC over it.

The documentation describes this mechanism: with the parameter in the URL, or with the x-pd-upload-body: 1 header, the raw body is stored and the event carries raw_body_url. Without the parameter, bodies over 512 KB get a 413 error. The download can use the Send HTTP Request action, for payloads up to 6 MB, or be saved to /tmp. The Hub signs timestamp.delivery_id.body with HMAC SHA-256, so the raw body is indispensable; re-serializing body would change the result.

curl -X POST https://crprohub.com/api/v1/webhooks \ -H "Authorization: Bearer hub_pk_EXEMPLO_NAO_REAL" \ -H "Content-Type: application/json" \ -d '{"name":"Pipedream","url":"https://SEU_ID.m.pipedream.net?pipedream_upload_body=1","event_types":["message.received"]}'
The Hub's webhook registration preserves the URL's query string: the URL is validated (HTTPS, public host, up to 2048 characters, port 443, no username or password) and stored as given. Still, run POST /api/v1/webhooks/{id}/test after registering; if the event arrives with raw_body_url, it works. Otherwise, use a receiver of your own to validate the signature.
import axios from "axios"; import { createHmac, timingSafeEqual } from "node:crypto"; export default defineComponent({ async run({ steps, $ }) { const h = steps.trigger.event.headers; // nomes em minusculas const evento = steps.trigger.event.body; // 1. Baixa o corpo cru (a URL assinada expira em 30 minutos) e confere a assinatura. const cru = (await axios.get(evento.raw_body_url, { responseType: "text", transformResponse: (d) => d, // nao interpretar o JSON })).data; const assinado = h["x-hub-timestamp"] + "." + h["x-hub-delivery-id"] + "." + cru; const esperado = createHmac("sha256", process.env.CRPRO_WEBHOOK_SECRET).update(assinado).digest("hex"); const recebido = (h["x-hub-signature-256"] || "").replace("sha256=", ""); const valida = /^[0-9a-f]{64}$/.test(recebido) && timingSafeEqual(Buffer.from(recebido, "hex"), Buffer.from(esperado, "hex")); if (!valida) { await $.respond({ immediate: true, status: 401, body: "assinatura invalida" }); return; } await $.respond({ immediate: true, status: 200, body: "ok" }); // o Hub espera 2xx em ate 10 s // 2. Responde ao cliente pela API do Hub. const msg = JSON.parse(cru); if (msg.event !== "message.received" || !msg.data.text) return; const r = await axios({ method: "post", url: "https://crprohub.com/api/v1/channels/" + msg.channel_id + "/messages", headers: { Authorization: "Bearer " + process.env.CRPRO_API_KEY, "Idempotency-Key": "resp-" + msg.data.message_id, }, data: { to: msg.data.from, type: "text", text: { body: "Recebemos sua mensagem." } }, validateStatus: () => true, // nao lancar em 4xx/5xx: devolvemos o status }); $.export("status_do_hub", r.status); // 202 = aceita return r.data; }, });{ "id": "6f1f0f6a-3b2c-4d1e-9a8b-0c1d2e3f4a5b", "event": "message.received", "channel_id": "9f6a9c1e-2f3d-4a5b-8c7d-1e2f3a4b5c6d", "occurred_at": "2026-08-21T12:00:00.000Z", "data": { "message_id": "wamid.EXEMPLO123", "from": "5521999999999", "type": "text", "text": "Oi, ainda tem em estoque?" } }

Since the Hub only considers a delivery complete with a 2xx within 10 seconds, the step answers right away with $.respond and immediate: true and keeps working. The documentation says that by default the response goes out at the end of the workflow; with immediate: true, it goes out midway and later steps continue.

Response, errors and retries

Short answer: always answer explicitly. The documentation describes two behaviors: without an explicit response the endpoint returns 200 with "Success!", and when the workflow should answer with $.respond and that never runs, the endpoint returns 400 with "No $.respond called in workflow". Wrapping the call in try/finally makes sure it runs.

SituationWhat the Hub seesEffect
Invalid signature, immediate 401401Counts as a failure and retries
$.respond never executed400Counts as a failure
Immediate 200 response200Delivery complete
Consecutive failures20 in a rowThe Hub pauses the endpoint

On failure, the Hub repeats a delivery up to nine times over about four days; after 20 consecutive failures it pauses the endpoint, and reactivation is a PATCH on /api/v1/webhooks/{id} with {"status":"active"}. Events during the pause generate no delivery; recover them with GET /api/v1/channels/{id}/messages and direction=inbound. The body id stays the same on retry and replay: store handled ids in persistent storage. Full diagnosis and the signature rules are on the webhooks page.

When Pipedream pays off

Short answer: when you want a quickly assembled flow, with code steps and other ready integrations, and accept depending on the platform. If signature verification is mandatory and the query string test fails, prefer a receiver of your own.

The strengths are clear: a ready URL, environment variables for secrets, Node.js steps with npm and an immediate response. So are the points of attention: the signature depends on a special URL parameter, the raw body download has a 30-minute deadline, and the execution history is Pipedream's. Compare with the other tools in this series, like the Make and Zapier articles, to choose where to host the logic.

Frequently asked questions

Does Pipedream have a ready-made CRPRO Hub integration?

This research found none and claims none. The connection uses the HTTP trigger to receive and a Node.js step with axios, or the HTTP request action, to send.

How do I get the raw body to check the signature?

By appending ?pipedream_upload_body=1 to the URL (or the x-pd-upload-body: 1 header). The event then carries raw_body_url, a signed URL that expires in 30 minutes. Test whether the Hub preserves the query on registration.

Why did the workflow return 400 to the Hub?

Probably because the trigger expected a $.respond that was not executed, and the documentation says the endpoint then returns 400 "No $.respond called in workflow". Use try/finally.

Do headers arrive with capital letters?

No. The documentation indicates lowercase names in steps.trigger.event.headers, like x-hub-signature-256.

Fontes

Documentação oficial da Meta, conferida em 31 de outubro de 2026.