Multiple instances of worker services interacting with temporal server

If we have multiple instances (say 3) of a worker service running and it interacts with the temporal server.
If we have an API being invoked in container 1 which triggers WF1, and on container 2 we have WF2 being triggered. How are the respective activities executed for WF1 and WF2. Will it utilize container 3 worker threads as well?
I would be interested in understanding this in more detail. Can you please point me to the documentation?

Hi @waykar

When your workers connect to the server, they open a long poll connection requesting for workflow and activity tasks. You can find an small explanation here Workflow vs Activity - #3 by antonio.perez, let me know if it helps.

Will it utilize container 3 worker threads as well?

Temporal server will do a fairly distribution of the load (tasks) across the workers listening to the same taskqueue, so it is highly possible that astivity tasks get dispatched to all workers.

If we have an API being invoked in container 1 which triggers WF1, and on container 2 we have WF2 being triggered.

The same mentioned before for activities applies to workflows. If you have more than one worker listening to the same taskqueue, when you schedule a workflow it can run in any worker

Antonio

@antonio.perez This does help in understanding the internals. Thank you

Also, workflow is not tied to a specific worker and can move between them at any time. Otherwise, a failure of a single worker might block workflow execution.