How to Set Up a Workflow to Prevent Concurrent Executions and Limit to Only One Execution?

This topic was automatically generated from Slack. You can find the original thread here.

how can you setup a workflow so that it will not allow concurrent executions, force the workflow to only have one execution, ignore other triggers if the workflow is being executed?

To set up a workflow that does not allow concurrent executions and processes events in a serialized manner, you can limit the concurrency to 1 worker. This ensures that each event is processed only after the previous event’s execution is complete. To configure this, follow these steps: 1. Go to your workflow’s settings. 2. Under “Concurrency Controls”, set the number of workers to 1. This will make sure that your workflow processes events one at a time, and no concurrent executions will occur.

Thank you , that’s helpful.

You’re welcome! If you have any more questions or need further assistance, feel free to ask. I’m here to help!

is it possible to limit concurrent executions without queueing the additional events? So that if more events come while the workflow is executing, they are simply discarded.

Currently, Pipedream does not have a built-in feature to discard events when limiting concurrency to 1 worker. When you set the number of workers to 1, events will be queued and processed in a serialized manner, but they won’t be discarded. If you need to discard events based on specific conditions, you can implement custom logic within your workflow to check if the current event should be processed or not. However, this will still consume workflow invocations and might not be an ideal solution if you’re looking to save on execution costs.