Bonaventure OgetoBy Bonaventure Ogeto|

Paystack with n8n

In n8n: create a new workflow → add a Webhook node as trigger (copy the test/production URL) → configure Paystack to POST events to that URL → add action nodes: Set (to transform data), Google Sheets, Slack, HTTP Request, or PostgreSQL. Use the IF node to branch on event.event type. n8n is self-hosted — run it on Railway, DigitalOcean, or your own VPS.

Setting Up Paystack + n8n

  1. Self-host n8n (e.g., docker run -it --rm --name n8n -p 5678:5678 n8nio/n8n) or use n8n Cloud.
  2. Create a new workflow in n8n.
  3. Add a Webhook node. Set HTTP Method to POST, copy the Test URL.
  4. In Paystack dashboard → Settings → Webhooks, paste the n8n webhook URL.
  5. Trigger a test payment in Paystack test mode. n8n shows the incoming data in the Webhook node output.
  6. Add an IF node: condition {{$json.event}} equals charge.success.
  7. Add your action nodes on the True branch (Google Sheets, Slack, DB, etc.).
  8. When ready for production, activate the workflow and switch to the Production webhook URL in Paystack.

Example: Payment → Postgres + Slack Notification

Nodes in sequence:

  1. Webhook — receives Paystack event
  2. IF — filter: {{$json.event}} = charge.success
  3. Set — extract fields: reference, amount (÷ 100), email, channel, paid_at
  4. Postgres — INSERT INTO orders (reference, amount, email, channel, paid_at) VALUES (…)
  5. Slack — post to #payments channel: "New payment: {{$json.amount}} from {{$json.email}}"

For the Postgres node, configure a Postgres credential in n8n with your database connection string. Map the Set node output fields to the Postgres INSERT columns.

Learn More

See Paystack with Make for a no-code cloud alternative.

Sign up for the McTaba newsletter

Key Takeaways

  • n8n is open-source and self-hostable — no per-operation pricing once hosted.
  • Use the Webhook node as trigger to receive Paystack charge.success events.
  • Add an IF node to branch on {{$json.event}} for different event types.
  • n8n has native nodes for Google Sheets, Slack, Airtable, PostgreSQL, and 400+ other services.
  • For production, use the n8n production webhook URL (not test URL) and set up proper authentication.

Frequently Asked Questions

Where should I host n8n for production use with Paystack?
Railway, Render, DigitalOcean App Platform, or a $5/month VPS work well. n8n needs a persistent filesystem for workflow storage. Use the n8n Docker image with a mounted volume, or use n8n Cloud (paid). Your n8n instance needs a public HTTPS URL for Paystack to reach it — use a custom domain or the platform's default HTTPS URL.
Can n8n validate Paystack webhook signatures?
n8n does not have built-in HMAC-SHA512 validation. You can use the Function node to manually compute the HMAC: require the crypto module in n8n's sandbox (if available), or use the HTTP Request node to call a lightweight validation microservice. For lower-risk automations like logging, signature validation is optional — for fulfillment actions, always validate.
How is n8n different from Zapier for Paystack?
n8n is self-hosted and open-source — no per-operation cost once running. It supports more complex branching logic, code nodes (JavaScript), and direct database connections. Zapier is easier to set up (no hosting) but charges per Zap run at scale. For high-volume Paystack events (thousands of transactions/month), self-hosting n8n is cheaper.

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon