Hello, I used the solution there provided by @jan to check if other flows are running. However I’m getting this error. Authorization is required! All of my other internal http request node work fine for starting flows, so I’m unsure what the issue is.
My first guess is that you’d have basic auth configured for n8n so it’s expecting a username and password. Have you tried adding these to the HTTP Request node (under Authentication → Basic Auth and then Credential for Basic Auth → Create New)?
But it seems I have another issue now. I added to the flow “1. Clean Up (Search)” but as you can see in the screenshot, it triggered even though 2 other flows were already running.
The example you have shared would only check if the current workflow is already executing more than once, if I see that correctly.
Based on your screenshot I understand however you want to check whether any other workflow is running? If so, you wouldn’t need to filter for the current workflow ID. You could just check whether there are more than 1 workflows running in total. Simply remove the filter part .filter(execution => execution.workflowId.toString() === $workflow.id.toString()) from your Function.
So from quickly trying this out I can confirm the endpoint you are using does not return any workflows in Waiting status if that’s what you were looking at.
To find these, you could use the http://localhost:5678/rest/executions endpoint which is used when opening the executions list from the left sidebar:
This example workflow would find waiting workflows when testing this:
Unfortunately this isn’t working for me. I have 2 waiting executions however no executions are detected as waiting. I’ve noticed that in the executions model waiting executions don’t show when “any status” is selected, only when the “waiting” filter is selected. Maybe there is an additional parameter that is needed in the url as well.