n8n
Send notifications into an n8n workflow and route them anywhere: spreadsheets, databases, chat or AI steps.
1. Add a Webhook node#
- Create a workflow and add a Webhook trigger node.
- Set HTTP Method to
POSTand choose a Path, for examplenotifyhook. - Set Authentication to Header Auth, then create a credential with name
X-NotifyHook-Tokenand a long random value. - Set Respond to Immediately.
n8n shows two URLs:
| URL | Use |
|---|---|
https://n8n.example.com/webhook-test/notifyhook | Only while you click Listen for test event in the editor. |
https://n8n.example.com/webhook/notifyhook | Production. Works once the workflow is published (or active in older n8n versions). |
2. Store the token in NotifyHook#
In Settings → Security → Secrets, add a secret named N8N_TOKEN with the same value as the n8n credential.
3. Create the rule#
- Webhook URL: the production URL.
- Custom headers:
X-NotifyHook-Token={{secrets.N8N_TOKEN}} - Source apps: whichever apps you want to automate.
{
"id": "{{event.uuid}}",
"app": "{{appName}}",
"package": "{{packageName}}",
"title": "{{title}}",
"text": "{{text}}",
"receivedAt": "{{time.iso}}"
}4. Use the data#
In the following nodes, the payload is under body:
{{ $json.body.title }}
{{ $json.body.app }}: {{ $json.body.text }}For example, add a Google Sheets → Append row node to log every bank notification, or an IF node on $json.body.package to route by app.
Click Listen for test event in n8n, temporarily change the rule's URL to the /webhook-test/ one, then use ⋮ → Test webhook in NotifyHook. Switch back to the production URL when you're done. A 404 usually means the production workflow isn't published/active, or the test listener isn't running. URL edits don't reroute existing queued deliveries; use a fresh test.
Verifying the HMAC signature (optional)#
Header Auth over HTTPS is sufficient for many setups. If you also use HMAC, enable Options → Raw Body on the Webhook node and verify the exact bytes before any side effects. n8n's raw-body representation and Code-node crypto access depend on its version and hosting configuration; don't hash JSON.stringify($json.body). A dedicated verifying receiver in front of n8n is another option.
Respond → Immediately acknowledges that n8n started the workflow, not that every later node succeeded. Monitor n8n's Executions for downstream failures. To make invalid signatures return 401, use Respond to Webhook after verification instead of acknowledging immediately. See the n8n Webhook reference.