Architecture design for separation of business logic of workflow from worker

Hi, We are trying to come up with an architecture on temporal that separates worker logic (from code/repo perspective) from workflow (which includes business logic). Meaning we would like worker to be built generically in one repo and each workflow and its business logic (meaning activities) resides on a separate repo. Is this possible or the worker and workflow logic has to be in the same project?

You need to register your workflow and activity impls with worker but they don’t have to be in same project. Your worker project can define dependency on lib (for example jar) that includes all your workflows and activities) for example.

Thank you Tihomir, appreciate your response. I have 2 follow up questions:
1- Is there any examples that we can look that follows this architecture?
2- Is it recommended to have one worker and use that for all different workflows or a seperate worker for each workflow?

  1. I think this will depend on how you build and deploy your applications, see for example here that could give some ideas (gradle).

  2. Typically its recommended to start with all your workflow implementations registered with same worker and then go from there to optimize if needed (make sure you load test and watch your sdk and server metrics), see worker tuning guide here as starting point.