Workflow cron without overlap

Hi,

I want to run a workflow through cron every minute, but I don’t want the executions to overlap. E.g.: if a run takes 3 minutes, I don’t want to start the same workflow again while there’s one still being executed

Any tips on how to deal with this in a reliable manner?

Hi @fishnux, this is a bit tricky at the moment. You could consider an approach as discussed in the other threads around this (for example here). That said, the UI API authentication has changed since so if you decide to go down that somewhat hacky route you might want to check out Credential unauthorized - #3 by pemontto for more details on how to work around this.

2 Likes

Another hacky way could be to add a RabbitMQ(or similar) queue in the middle with a trigger that can only do one at a time(this can be configured in the trigger node)
You would want to remove the queue items if there are multiple queued I guess. Should also be a way to do that. Not sure how though.
It’s a hacky way of doing it, but should theoretically work.

Maybe there is something in the RabbitMQ code where it configures the number of parallel executions of the same trigger that might help. But that could be RabbitMQ specific.

2 Likes

Regarding @BramKn suggestion. There is already a setting on the RabbitMQ node which allows that. So should be quite simple to do.

2 Likes