Prevent duplicate payment transactions with webhook, Postgres, and HTTP API
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This workflow has 10 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Postgres.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Postgres: run a query
- Code: runs custom JavaScript code
- Postgres: run a query
- Code: runs custom JavaScript code
- If: checks a condition and branches into true / false
- HTTP Request: calls an HTTP API (POST)
- Respond to Webhook: sends the response back to the webhook caller
- Code: runs custom JavaScript code
- Postgres: run a query
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Webhook
n8n-nodes-base.webhook - Postgres
n8n-nodes-base.postgres - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow exposes a payment webhook that uses Postgres as an idempotency store to prevent duplicate charges, calling an external payment provider API only once per Idempotency-Key and replaying the stored result for retries, mismatches, and…