Limit worker process to work on only one workflow, and limit workflow to be executed by only one worker

Hello.

I have a pipeline that involve filesystem, and so i need what each workflow(his tasks and activities) will be coupled to one proccess worker.

Also, the files are heavy, so to manage the storage well, i need that each worker will be working on one workflow only.

I tried to implement an architecture that there will be a public task queue and private task queue for each instance.

every instance will have 2 workers - one polling workflows from the public task queue, creating child workflow(which does the actual work) on the private task queue).

I limited the max concurrent workflow task queue to 1.

Im experiencing some weird behavior, mostly it takes really long time until the task being polled, and if i cancel a workflow, so the worker should take another one fro the task queue, its just not hapenning.

Whould like to hear tips, criticism about the architecture or everything comes in mind.

Hi

I limited the max concurrent workflow task queue to 1.

this limit the number of workflow tasks, not the number of concurrent workflows.

Also, the files are heavy, so to manage the storage well, i need that each worker will be working on one workflow only.

I tried to implement an architecture that there will be a public task queue and private task queue for each instance.

I think your approach is in the right direction.

With worker configuration you can’t limit the number or concurrent workflows but the number of concurrent task. In your case I think you want to limit maxConcurrentActivityTasks to 1, and only in the private task queue to ensure only one activity tasks runs at the time.

You can control the number of concurrent child workflows with code, in the parent workflow.

1 Like

Interesting, i didnt think about it this way, inwas sure it limit the amount of wofklows.

I will try to shift the creating of new workflows to activity.