I am wanting to have some reusable components (workflows/activities) for example have a workflow to raise a request in a request system, but I want to make it available to other workflows that will not be in the same application.
so I have the following questions:
Can I call a child workflow that has the worker running from another application to the client?
Can I call an activity that is attached to a worker of another application to the client?
Which is better assuming I can do either, child workflow or activity?
Can I call a child workflow that has the worker running from another application to the client?
Yes, if the worker is different, ensure you set a different taskqueue for the childworkflow and have a worker listening to the taskqueue with the childWorkflow implementation.
Just wanted to ask, i think you mean worker that polls on a separate task queues, right ? (you can have two workers each in different worker processes/apps that poll on same task queue as well, both would need to have all workflows and activities registered tho).
Which is better assuming I can do either, child workflow or activity?
If all the ChildWorklfow would do is invoke the activity (so no other business logic) and you dont need to set specific activity configs (so letting activity config being set in workflow is ok), then think you should invoke the activity directly.
You can implement this by using different task queue for each “system” workflow. Then when you have to specify the correct task queue name when creating the child workflow stub. For example: