Duplicate workflow executions when using Redis trigger

Describe the problem/error/question

We are encountering problems with the Redis “new Redis event” trigger, where a single publish event sometimes triggers multiple duplicate workflow runs. For instance, there have been instances where one event led to three separate workflow runs - all of which have the same start time. Temporarily disabling and then reenabling the workflow with the “new Redis event” trigger resolves the issue of duplicate runs. However, the problem occasionally resurfaces whenever we modify that workflow again.

It feels like the redis trigger doesn’t properly call or cleanup/deregister the closeFunction method.

What is the error message (if any)?

No error message, but there are duplicate workflow runs. The problem gets resolved if I disable and then reenable the “Redis Trigger Bug POC” Workflow.

Please share your workflow

Redis Trigger Bug POC

Redis Trigger Bug POC Trigger

Share the output returned by the last node

Information on your n8n setup

  • n8n version: v1.21.1
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): queue
  • Running n8n via (Docker, npm, n8n cloud, desktop app): NPM running in a Docker Container in Kubernetes
  • Operating system: Debian

Hey @tylerodonnell,

Welcome to the community :cake:

How many workers do you have in your queue mode setup? How long does this issue typically take to happen as well is it something that happens after a few days?

As a test I have set up a Redis Trigger that sends a message to Gotify then I have another trigger that runs every hour to send a message to Redis.

I am not sure what your message frequency is but if you let me know I can tweak the schedule.

Hi @Jon, currently we’re operating with just one worker. The issue we’re facing isn’t related to the duration for which the workflow is active. Instead it’s connected to modifying the workflow that uses the Redis trigger. Occasionally, editing that workflow leads to future Redis events to triggering duplicate executions of the Workflow. I unfortunately haven’t been able to identify a consistent pattern to this behavior yet.

Hey @tylerodonnell,

Interesting so if I was to modify the workflow and hit save it should be enough to trigger the issue?

@Jon Yes. It doesn’t replicate every time you hit save, but from what we’ve observed, will eventually happen.

Hey @tylerodonnell,

I have not seen it cause an issue yet, I will keep poking the workflow though to see if I can trigger it. I am going to increase the load as well.

Hi @Jon We upgraded to version 1.23.0 (prerelease) after seeing a few other redis fixes in the changelog and that appears to have resolved this issue.

1 Like

Hey @tylerodonnell,

That is good news and could be why I have not seen it, We do have some other Redis changes coming out shortly as well.

1 Like

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