Templates / Prevent duplicate payment transactions with webhook, Postgres, and HTTP API

Prevent duplicate payment transactions with webhook, Postgres, and HTTP API

Ready for 3.0

by Oneclick AI Squad ✓ · 18 views · created 2026-10-01 · Engineering

Ready 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.

  1. Postgres: run a query
  2. Code: runs custom JavaScript code
  3. Postgres: run a query
  4. Code: runs custom JavaScript code
  5. If: checks a condition and branches into true / false
  6. HTTP Request: calls an HTTP API (POST)
  7. Respond to Webhook: sends the response back to the webhook caller
  8. Code: runs custom JavaScript code
  9. Postgres: run a query

Services it uses

Postgres

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)

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…

Excerpt from Oneclick AI Squad's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.