Hi We are looking to integrate Prefect into our sy...
# ask-community
j
Hi We are looking to integrate Prefect into our system as a workflow engine. One of the tasks we are looking to move is the running of crons. These crons run on a few different schedules and some of them take 30-45 mins and we would like to run them hourly. Some of these tasks we would like to block the next run until the current run has finished. This is especially important for tasks like database loading where we don't want two tasks running at the same time. Is it possible in Prefect have a task block the next scheduled run of the same task? This is a default in Airflow, but I haven't found an option in Prefect to do this. Can anyone suggest how to do this? Thanks
k
Hi @John Berrisford, flow concurrency limiting is a Prefect cloud feature (not available on server). I think this is also relevant. Details on how to code this yourself would be here
Are you trying to do this limiting on a task level or flow level?
m
Is there any documentation around this feature in Cloud?
k
Hey @Matthias Roels, do you want task concurrency limiting or flow concurrency limiting?
m
flow concurrency limiting
k
You can click on Team -> Flow Concurrency limiting. Flow concurrency limiting works on Labels
👍 1
Sample if you dont have access on your license
j
This seems to be the number of tasks which can run on a worker at any time. Not the concurrency of an individual flow. In my case I have lots of flows which can run at the same time, but I want to limit a specific flow to only run one instance at a time - even if the scheduler tries to run another instance
k
We have both task concurrency and flow concurrency. Flow concurrency uses labels. Tasks use tags. The Flow concurrency is undocumented at the moment.
Task concurrency would be across flows. Like 10 connections to a database for example
j
thanks - can you let me know how to do the flow concurrency? I assume this is a flag for the individual flow? i.e. akin to Kubernetes concurrency policy?
k
It’s label based. In the UI, click Team at the top and then the dropdown will have Flow Concurrency