Docs › Integrations › n8n

n8n

Add a NotiLens HTTP Request node to any n8n workflow to fire notifications when automations run, fail, or complete.

Overview

What This Integration Does

Add a HTTP Request node to any n8n workflow and point it at your NotiLens webhook URL. Every time the workflow runs — or fails — NotiLens receives the event and notifies you instantly.

Works with any n8n trigger: schedule, webhook, app event, or manual execution. No credentials to manage beyond your NotiLens webhook URL.

Why NotiLens

Why Use NotiLens with n8n?

n8n's built-in error emails are delayed and easy to miss. NotiLens fires within 60 seconds of a workflow failure, detects trigger silence, and tracks execution volume — so you know immediately when your automations break.

Setup

How to Connect n8n to NotiLens

1. Get your NotiLens webhook URL

  1. Open the NotiLens dashboard and select or create a Custom Topic.
  2. Copy the webhook URL:
https://hook.notilens.com/webhook/<topic_id>/send

2. Add an HTTP Request node in n8n

  1. Open your workflow in n8n.
  2. Add a new HTTP Request node after the step you want to monitor.
  3. Set the following options:
Method:        POST
URL:           https://hook.notilens.com/webhook/<topic_id>/send
Body Type:     JSON
Content-Type:  application/json

3. Map your notification fields

In the Body Parameters section, add the fields you want to send. At minimum, title and message are required. You can map n8n expression values directly:

{
  "title":   "Workflow: {{ $workflow.name }} completed",
  "message": "Executed at {{ $now }} — items processed: {{ $items.length }}",
  "type":    "success",
  "event":   "workflow.completed",
  "meta": {
    "workflow_id":   "{{ $workflow.id }}",
    "execution_id":  "{{ $execution.id }}"
  }
}

4. (Optional) Add an error handler node

To catch workflow failures, use n8n's Error Trigger node as a separate workflow:

  1. Create a new workflow with the Error Trigger as the start node.
  2. Add an HTTP Request node pointing to NotiLens.
  3. Map {{ $json.execution.error.message }} to the message field.
  4. Set type to urgent.
{
  "title":   "n8n workflow failed: {{ $json.workflow.name }}",
  "message": "{{ $json.execution.error.message }}",
  "type":    "urgent",
  "event":   "workflow.failed",
  "meta": {
    "workflow_id":  "{{ $json.workflow.id }}",
    "execution_id": "{{ $json.execution.id }}"
  },
  "force_send": true
}

5. Test and activate

  1. Click Execute Workflow to test.
  2. Confirm the notification appears in the NotiLens app.
  3. Activate the workflow.

That's it — n8n will now send notifications to NotiLens on every execution or failure.

Payload

Webhook Payload Format

Send a POST request with a JSON body. Only title and message are required. All requests must use Content-Type: application/json.

FieldRequiredTypeDescription
titleYesstringShort notification heading
messageYesstringMain notification content
typeNostringinfo success warning urgent
eventNostringLogical event identifier, e.g. workflow.failed
image_urlNoURLImage to display in the notification
open_urlNoURLURL to open when notification is tapped
download_urlNoURLDownload file link
tagsNostringComma-separated tags, e.g. n8n,production
metaNoJSONStructured data — workflow ID, execution ID, node name, etc.
is_actionableNobooleanIf true, repeated notifications until acknowledged
force_sendNobooleanBypass ML filtering and deliver immediately. Default true for failures.
Events

Common n8n Events

EventTypeWhen to use
workflow.completedsuccessWorkflow executed successfully
workflow.failedurgentWorkflow error — use with Error Trigger node
workflow.startedinfoLong-running workflow began
node.errorurgentSpecific node failed (HTTP, DB, API)
data.processedinfoBatch processing completed — include item count in meta
schedule.missedwarningScheduled workflow didn't fire on time
Metrics & Anomaly Detection

Tracking Metrics for Anomaly Detection

Pass numeric values in the meta field alongside your event. NotiLens learns your baseline over time and alerts when values deviate — spikes, drops, or unusual patterns — without you needing to set manual thresholds.

Common metrics to track

MetricWhat it detectsExample value
duration_msWorkflows suddenly taking much longer — API slowdowns, DB timeouts4823
amountRevenue spikes or drops — payment anomalies, refund surges149.99
record_countBatch size deviations — unusually small or large data sets1542
error_countError rate spikes in a workflow run7
retry_countElevated retries signal upstream API instability3
items_skippedUnexpected data gaps — filters dropping more records than normal84
api_latency_msThird-party API degradation affecting your workflow2100
queue_depthBacklog buildup — workflow not keeping up with incoming volume312

Example — payment workflow with metrics

{
  "title":   "Payment workflow completed",
  "message": "{{ $items.length }} payments processed",
  "type":    "success",
  "event":   "payments.processed",
  "meta": {
    "duration_ms":   "{{ $execution.duration }}",
    "record_count":  "{{ $items.length }}",
    "amount":        "{{ $json.total_amount }}",
    "error_count":   "{{ $json.failed_count }}",
    "items_skipped": "{{ $json.skipped_count }}"
  }
}

Example — data sync with latency tracking

{
  "title":   "CRM sync completed",
  "message": "{{ $items.length }} contacts synced in {{ $execution.duration }}ms",
  "type":    "success",
  "event":   "crm.sync",
  "meta": {
    "duration_ms":    "{{ $execution.duration }}",
    "record_count":   "{{ $items.length }}",
    "api_latency_ms": "{{ $json.hubspot_response_time }}",
    "retry_count":    "{{ $json.retries }}"
  }
}
NotiLens doesn't need you to set thresholds. Send metrics consistently on every run and it learns what "normal" looks like. Alerts fire automatically when a value deviates from baseline.