My workflow gets retriggered multiple times on one webhook call. How do I prevent this?

I use Mixpost with is a Social Media manager. It works great but lacks support of Pixelfed. Hopefully it will one day support other federated sites.

So, I’m working on a workflow that is triggered when I make a new Mastodon post and grabs the images/tags/Status and posts them to my Pixelfed account.

My workflow works as expected regarding the data scrape and post.

Describe the problem/error/question

What’s tripping me up is the fact that the workflow may bet triggered multiple times once it is triggered which results in my Pixelfed account having the same post several times.

A few observations:

  1. I use a webhook to trigger the workflow.
  2. The webhook call is always successful in activating the workflow the first time.
  3. The retrigger only happens when the webhook call is made - meaning that the duplicate posts only happen in the few seconds following the initial webhook call.

I’ve included my partial workflow that shows how I’m attempting to use a lock mechanism to prevent the rerunning of the workflow.

Within the workflow I also utilize a Uniqueness check that prevents the repost using an IF node that checks to see if the new POSTID from Mastedon is in a list of past POSTIDs and if so we jump to the Release Lock node and ends.

I can’t explain why the retrigger happens since the webhook call is only made once, right?

Is there a way to limit the number of times a webhook triggers a work flow in a given timespan?
Something like “Once the webhook call triggers the workflow do not rerun the workflow for xx seconds.”

Thanks for your time and any input.

What is the error message (if any)?

No error, but the workflow may run multiple times requiring that I do additional work.

I’m relatively new to n8n, so I’m OK with any critic of my logic.
I’ll try to incorporate any suggestions you folks have.

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.47.3
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker on Synology NAS
  • Operating system: Synology DSM

hello @Rodney_Almodovar

That’s quite strange. Can you show the screen of the past execution with that behaviour? The most obvious issue is that you have multiple items somewhere and your post node is being called multiple times.

OK. THanks for your input. I went back and did some recreates and found that maybe I was a bit naive regarding my setup. If using Postman to invoke the webhook, the flow wasn’t retriggered as seen previously. So I went to Mixpost and poked around. Apparently, my naivety led me to believe that when Mixpost posted the social media updates to it would ONLY call the webhook once on Post to Mastodon. So maybe that accounts for the retriggers?

However, this morning’s attempts to recreate the problem don’t seem to align with what I had thought was the problem. This morning the webhook was only called ONCE even though Mixpost made the same type of Post to Mastodon/X/instagram and FB.

I’m going to continue my efforts at recreating the issue and will simply add a rate limiter into my work flow so that I can control any additional rogue calls to the webhook.
I’ll post more details as I move this along.

I’d appreciate any thoughts you have on rate limiting though…
regards,
Rodney

1 Like

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