n8n email automation
Lots of services emit email and nothing else. A Tempx inbox plus a five-node n8n workflow turns that stream into triggers: extract verification codes, watch for failure notices, forward order confirmations into your stack — without running a mail server or writing a webhook receiver.
Schedule Trigger → HTTP Request: GET /api/inbox → Filter on subject/sender → Code: extract code → act
Node by node
| Node | Settings |
|---|---|
| Schedule Trigger | Every 1 minute (inbox reads cap at 240/min, so this has huge headroom) |
| HTTP Request | GET https://tempx.uk/api/inbox, query parameter address = alerts-7cq2@tempx.uk. For a private inbox add a header Authorization: Bearer … |
| Split Out | Field: messages — one item per email |
| Filter | {{ $json.subject }} contains your marker (e.g. backup failed), and {{ $json.receivedAt }} newer than the watermark |
| Code | extract the interesting part (snippet below) |
| Action | Slack, Telegram, a webhook into your app — whatever acts on it |
Extract a code (Code node)
// Code node: pull the first 4-8 digit code out of the preview
const m = ($json.preview || "").match(/\b(\d{4,8})\b/);
return [{ json: { code: m ? m[1] : null, subject: $json.subject } }];
Process each mail once (watermark)
// Code node, before the Filter: only mails newer than last run
const staticData = $getWorkflowStaticData("global");
const last = staticData.lastSeen || 0;
const fresh = $json.messages.filter((m) => m.receivedAt > last);
if (fresh.length) {
staticData.lastSeen = Math.max(...fresh.map((m) => m.receivedAt));
}
return [{ json: { fresh } }];
Testing the workflow itself
The same inbox doubles as the test bench for the sending side of your automations: point the workflow's email steps at the capture gateway or the Resend adapter, run the workflow, and assert on what landed — no customer ever sees a test notification.
Wire the first node
Pick an inbox address, paste the HTTP Request URL, and the watcher is half done.
Open an inbox