DEV Community

Manish Kumar
Manish Kumar

Posted on

How to Get Instant Stripe Payment Notifications with n8n (Free Template)

I was checking my Stripe dashboard 10+ times a day just to see if payments came through.

That's roughly 80 hours a year staring at a dashboard. So I automated it with n8n — now I get an instant Slack notification every time someone pays.

Here's exactly how it works, and you can grab the free template at the end.

The Problem

If you process payments through Stripe, you know the drill:

  • Refresh the Stripe dashboard to check if a payment landed
  • Check email for Stripe receipts
  • Ask your team "did that customer actually pay?"

There's no real-time push notification built into Stripe's dashboard. You either poll it manually or set up webhooks yourself.

The Solution: 4-Node n8n Workflow

I built a simple n8n workflow that catches Stripe webhook events and sends formatted Slack notifications in real-time. The entire setup takes about 5 minutes.

Here's the flow:

Stripe Trigger → Validate Event → Format Payment → Slack Notification

Node 1: Stripe Trigger

n8n generates a webhook URL. You configure Stripe to send payment_intent.succeeded events to that URL. Every time someone pays, Stripe pushes the event to your workflow automatically.

No polling. No cron jobs. Instant.

Node 2: Validate Event (Code Node)

Stripe webhooks can occasionally send malformed events, especially during retries. This node checks:

  • Does the event have a valid type field?
  • Is data.object present?
  • Does the payment have an amount field?

If any check fails, the event is rejected before it reaches your Slack channel. This prevents cryptic errors from cluttering your notifications.

const event = $input.item.json;

if (!event.type) {
throw new Error('Missing event type');
}
if (!event.data || !event.data.object) {
throw new Error('Missing event data.object');
}

const obj = event.data.object;
if (obj.amount === undefined && obj.amount_received === undefined) {
throw new Error('Payment event missing amount field');
}

return { json: event };

Enter fullscreen mode Exit fullscreen mode




Node 3: Format Payment (Code Node)

This node extracts the important details from the raw Stripe event and formats them into a clean, readable message:

const event = $input.item.json;
const obj = event.data.object;

const amount = ((obj.amount_received || obj.amount || 0) / 100);
const currency = (obj.currency || 'usd').toUpperCase();
const customerEmail = obj.receipt_email
|| obj.charges?.data?.[0]?.billing_details?.email
|| obj.metadata?.email
|| 'No email on record';
const paymentId = obj.id || 'N/A';
const created = obj.created
? new Date(obj.created * 1000).toISOString()
: new Date().toISOString();

return {
json: {
slack_message: '✅ Payment Received\n'
+ 'Amount: ' + amount.toFixed(2) + ' ' + currency + '\n'
+ 'Customer: ' + customerEmail + '\n'
+ 'Payment ID: ' + paymentId + '\n'
+ 'Date: ' + created
}
};

Enter fullscreen mode Exit fullscreen mode




Node 4: Slack Notification

The formatted message gets posted to your #payments Slack channel. Your whole team sees it instantly — on desktop, mobile, wherever.

No more "hey, did that payment go through?" messages.

What You Need

Setup Steps

  1. Import the workflow JSON into n8n (Workflows → Import from File)
  2. Add your Stripe Secret Key to the Stripe Trigger node
  3. Add your Slack Bot Token to the Slack node
  4. Create a #payments channel in Slack and invite the bot
  5. Activate the workflow
  6. Test with Stripe test mode (sk_test_...)

Grab the Free Template

The complete workflow JSON is on GitHub — import it directly into your n8n instance:

Stripe Payment Notifier — Free n8n Template

Full Version

The free template covers payment succeeded alerts to Slack. I also built a full version that adds:

  • Subscription created alerts
  • Failed charge alerts
  • Google Sheets logging for all events
  • Gmail email notifications
  • Smart event routing with Switch node
  • Error handling with automatic retries

If you need the complete payment monitoring system, the full version is available on my Gumroad.

Results

After using this for a few months:

  • Zero missed payments — vs. catching some the next day before
  • ~80 hours/year saved on dashboard checking
  • Team stays informed without anyone asking
  • Haven't touched the workflow since setting it up

If you have questions about the setup or want to customize it for your use case, drop a comment — happy to help.

Top comments (0)