Stripe Event ID - Filter Out Multiple Runs

Hi,

I am trying to use the Stripe Node to process Subscribes/Unsubscribes. As others have said stripe doesn’t send just one webhook, they send a bunch but I only want my flow to run fully for 1 evt_ID in each flood of stripe requests.

Now I have the evt_ID saving to a google sheet, I was wondering what my next step is.

IF Stripe Node Evt_ID = One Already in the Google Sheet - Stop the flow
If Stripe Node Evt_ID = Not in Google Sheet than finish the flow.

I also have a google sheet node retrieving all the IDs that are stored.

I am just wondering what my next step should be.

Hi @RCS, this is somewhat tricky unfortunately.

In a first step, you might want to check webhooks section of your Stripe dashboard to ensure the relevant n8n webhook URL appears only once indeed and the problem isn’t caused by n8n registering too many webhooks in the first place.

As for the actual de-duplication you probably want to handle the search first and only continue with storing your id (and the rest of your workflow) if this value isn’t found yet.

Like so:

When encountering a new webhook, the Merge node will let it pass and you can add it to your Google Sheet (and run your main logic).

n8n:

Google Sheets:

Now when a webhook with an identical id is received, the Merge node would find the match and not pass it on to the rest of your workflow:

Hope this helps!

With all that in mind, be a bit careful with relying on Google Sheets. This isn’t the fastest of APIs out there, so if your webhooks come in in very quick succession you might still see the occasional duplicate processed.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.