๐Ÿค Track secure order status and email alerts with webhooks, Gmail, and Data Tables

โšก 15 views ยท ๐Ÿค CRM & Sales Operations

Description

Quick overview

Accept orders, enforce safe status transitions, deduplicate milestone alerts, expose a verifier-protected customer lookup, and surface stale notifications.

How it works

  1. Authenticates the order-intake webhook with the server-side ORDER_INTAKE_TOKEN.
  2. Validates the required tenant, order ID, explicit source event ID, initial state, explicit-offset timestamp, and an unpadded 24โ€“256-character per-order lookup secret; then derives stable keys and returns duplicate intake without another side effect.
  3. Persists a new Order, Status History row, and pending Notification before sending a controlled Gmail message.
  4. Authenticates exactly one internal status event per request with ORDER_STATUS_TOKEN, rejects arrays, joins the event to its Order, and reads all matching Status History rows before classification.
  5. Returns accepted or held event replays without another write, holds new older or invalid transitions, and persists every valid transition before checking all matching Notifications rows; only a new notification key can create another notification or Gmail message.
  6. Records Gmail success or explicit Pending Send failure in Notifications and Orders, serves a verifier-protected customer lookup with only safe fields, and alerts the operations inbox when notifications remain pending for at least two hours.

Setup

  1. Create n8n Data Tables named Orders, Status History, and Notifications with the columns listed in the workflow README, then re-select the correct table in every Data Table node.
  2. Create distinct n8n Variables ORDER_INTAKE_TOKEN and ORDER_STATUS_TOKEN.
  3. Connect a Gmail credential to the three Gmail nodes and replace ops@example.com with a controlled operations inbox. The template never takes the recipient from webhook data and does not email the customer directly.
  4. Generate a distinct random 24โ€“256-character unpadded lookup secret for each order, then connect the intake, internal status, and customer lookup webhook URLs to the correct source systems.
  5. Review the status vocabulary, allowed transitions, equal-timestamp policy, customer-safe messages, notification copy, two-hour stale threshold, and schedule. Keep the workflow inactive while testing wrong tokens, weak secrets, missing event IDs, arrays, replays, re-entry, lookup outcomes, Gmail failure, and stale rows.

Requirements

Customization

Additional info

Important limits:

๐Ÿ”— Nodes Used

Webhook, Gmail, Schedule Trigger, Data table

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup