Cross cluster / namespace workflow chaining

Hi Team,

The application we are building spin off a chain of two workflows to execute a series of state machine transitions. Both these workflows are for two different target application and hence we want to have a separation / silos in terms of temporal cluster.

Activity worker (AW) of Workflow1 in Cluster1 tries to spin off Workflow2 in Cluster2, for which AW needs to create two connections to Cluster1 and Cluster2. However while trying to do that using Java SDK of Temporal, we are encountering the following error:

Parameter 0 of method workflowClient in [com.playground.sm].stateManagementService.config.TemporalConfigLIS required a single bean, but 2 were found.

Is the use case as explained before supported in Temporal? I understand cross namespace is not supported as of now, but here we are trying to make use of two clusters via a same worker.

Any help will be highly appreciated.

here we are trying to make use of two clusters via a same worker

WorkerFactory from which you create your workers has a single connection object passed in, so workers created from this factory can poll from the cluster the connection was established for, if thats the question.

I’m not sure why your you need connection to two separate cluster from same worker, can you give more info?

Hi @tihomir

Thanks for your response. We have two (big) workflows, say workflow1 and workflow2. Workflow1’s state machine need to kick off Workflow2, but both cant have a parent-child like relationship.

So, Workflow1’s activity worker spins off Workflow2 in a different Temporal cluster. To keep separation between Workflow1’s and Workflow2’s execution we were thinking of having two Temporal cluster as both belong to two different applications, done by two different teams.

Thanks.