n8n
Header auth, trigger webhook verificat sau polling programat.
- Credential „Header Auth”: Authorization / Bearer mf_live_….
- Instant: nodul „Webhook” cu raw body activat, apoi un nod „Code” cu verifyMformSignature, apoi „IF”.
- Polling: „Schedule Trigger” + „HTTP Request” cu paginarea n8n pe next_cursor.
const crypto = require("crypto");
const raw = $input.first().binary?.data ? Buffer.from($input.first().binary.data.data, "base64").toString("utf8") : JSON.stringify($json.body);
const header = $json.headers["mform-signature"];
// verifyMformSignature: see /docs/api/webhooks
if (!verifyMformSignature(raw, header, $env.MFORM_WEBHOOK_SECRET)) throw new Error("bad signature");
return [{ json: JSON.parse(raw) }];