Listing running workflow execution with API

I am trying to avoid concurrent workflow execution for a specific workflow.

I wanted to

  • List execution for current workflow
  • Enter a waiting loop if there is a running workflow

The problem is that node n8n “get execution” does not seem to get running execution. Is it possible to list running execution in a workflow ?

Is there a better way to queue these workflow (triggered by a webhook) ? I want to prevent concurrent execution that could hit the API Rate limit on some APIs

Information on your n8n setup

  • n8n version: 1.34.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu

Hi @Valerian_Lebert!

It sounds like you have a couple of questions here.

  1. Is it possible to get the running execution
  2. Is there a better way to avoid concurrent executions

I hope this article would be helpful to answering your first question: How to get current execution ID in the node - #6 by jan

In regards to preventing concurrent executions, my recommendation is to always strive to make the workflows idempotent. You can also see a few approaches mentioned in this past community thread: Multiple webook calls overlaping - #5 by jan

Happy building!

1 Like

Thanks @Ludwig , this helps

But take note that /rest/executions-current may not work anymore, as it’s an undocumented feature that could be disabled :slight_smile:

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