Skip to content

๐Ÿ›ก๏ธ Template #22363: Detect Payment Fraud and Deduplicate Webhooks with DevDeskApp, PostgreSQL, and Slack โ€‹

Published on n8n.ioTemplate ID: 22363

๐Ÿ”— Template on n8n.io: n8n.io/workflows/22363

Template 22363 payment fraud detection and deduplication workflow on the n8n canvas
Figure 1: The template on the n8n canvas.

๐ŸŽฏ Overview โ€‹

High-growth e-commerce platforms and SaaS businesses face two critical payment webhook challenges:

  1. Duplicate Webhook Retries: Payment providers (Stripe, Razorpay, Shopify) retry delivery when servers take too long to reply, causing duplicate order fulfillments or duplicate digital credit top-ups.
  2. Fraudulent Chargebacks & Suspicious Orders: High-ticket purchases made with disposable emails, proxy IPs, or mismatched billing addresses often slip through without automated risk scoring.

This template creates an automated zero-trust gate before fulfilling orders:

  1. Calculates SHA-256 Idempotency Checksum: Hashes the transaction ID, currency, and amount with DevDeskApp Hash Payload into a deterministic key to instantly detect webhook replays.
  2. Issues Audit UUID v4: Assigns a unique correlation token across PostgreSQL and ledger logs with DevDeskApp UUID Generator.
  3. PII Sanitization & Slugification: Normalizes customer names and email domains into clean audit slugs (order-8921-sarah-connor) with DevDeskApp Slugify String without leaking raw PII.
  4. Automated Quarantine Gate: Splits verified payments for instant database fulfillment, while quarantining suspicious orders into #security-alerts in Slack.

๐Ÿ“ธ Pipeline โ€‹

Template 22363 pipeline: payment webhook, DevDeskApp hasher, UUID and slugifier, risk evaluation gate, Postgres and Slack branches
Figure 2: Node order and branches in the published template.
NodeResource ยท OperationPurpose
Payment Webhook (Stripe / Shopify)trigger ยท webhookIngests live payment event (charge.succeeded or payment_intent.succeeded)
DevDeskApp: JSON Prettifierjson ยท prettifyValidates and cleans raw webhook JSON formatting
DevDeskApp: SHA-256 Idempotency Hashercrypto ยท hash (sha256)Checksum of transactionId + amount to prevent replay attacks
DevDeskApp: Trace UUID Generatorcrypto ยท uuidDistributed tracking ID across internal microservices
DevDeskApp: Customer Slugifiertext ยท slugifyGenerates standardized order reference slug
If: Duplicate / High Risk?ifEvaluates risk score, disposable email flag, and existing DB checksum
PostgreSQL: Ingest OrderPostgres nodeInserts verified payment record into production database
Slack: Security / Order AlertSlack nodeAlerts team of verified order or urgent fraud quarantine

โšก Execution sample โ€‹

json
{
  "status": "ORDER_VERIFIED",
  "auditToken": "8f2d5a1b-4c3e-4d9f-a6b8-2c7e1f4a9b0c",
  "orderSlug": "ord-98214-elena-rostova",
  "gateway": "stripe_live",
  "transactionId": "ch_3N82kls8921klsa",
  "amountFormatted": "$249.00 USD",
  "riskAssessment": {
    "riskScore": 12,
    "verdict": "LOW_RISK_ACCEPTED",
    "idempotencyHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  "database": {
    "table": "ecommerce_orders",
    "inserted": true,
    "idempotencyKeyStored": true
  }
}

๐Ÿ“ฅ Import it โ€‹

  1. Make sure n8n-nodes-devdeskapp is installed (installation guide).
  2. Open the template on n8n.io and click Use for free, or copy the workflow JSON.
  3. Paste it onto a new workflow canvas with Ctrl + V (Cmd + V on macOS).
  4. Configure your Stripe Webhook Secret, PostgreSQL connection, and Slack channel.
  5. Test using the sample webhook event and verify zero-delay in-memory checksum computation.

Released under the MIT License.