Multiple binaries run in workflow orchestration

Hi,

We are doing POC to use temporal. Can you confirm if the below use case work with Temporal

Some binaries(JVMs) run in node1 (ex: Task 1, Task 2, Task 6)
Some binaries(JVMs) run in node 2 (ex: Task 3, Task 4, Task 5)

My workflow should be like this
Task 1 → Task 2 → Task 3 → Task 4 → Task 5 → Task 6

Do i need to define 2 workers(one for each node)? Can i use same queue to accommodate all 6 tasks

Do i need to define 2 workers(one for each node)? Can i use same queue to accommodate all 6 tasks

Each binary would contain a single worker. Each worker has to use a different task queue. You have to specify an appropriate task queue when scheduling tasks from a workflow.

The general rule is that all workers that share a task queue must support the same set of workflow and activity types.

So, I have to add one worker(with unique queue name) and one workflow implementation class in each binary
In the workflow initiator:
i) I have to build these 6 workflows
ii) Build these 6 workflows in sequence order(I want binaries to run in sequence, but not concurrent)

Correct me if my understanding is wrong

In each binary, I would have two workers. One worker just for the workflow code. All binaries would have this worker as we want workflows to run across all of them (unless you want to limit workflow code to a subset of workers). Another worker would contain a subset of activities and have a different task queue for each subset.

In the workflow initiator:
i) I have to build these 6 workflows
ii) Build these 6 workflows in sequence order(I want binaries to run in sequence, but not concurrent)

I don’t understand what “build workflows” means. We don’t have such a concept in Temporal. Do you mean “start workflows”?

“Build” means the below step(from temporal example)

WorkflowOptions options = WorkflowOptions.newBuilder()
.setTaskQueue(Shared.HELLO_WORLD_TASK_QUEUE)
.build();

Why do you want to build workflow options 6 times?

Below is my understanding(based on example provided by temporal)
→ Workflow initiator will open up queue and wait for worker(s) to take queue
→ Worker will register its workflow to the queue
→ Workflow initiator triggers worker code

For my requirement(mentioned in the original post), I tried below options
→ Created one binary to initiate workflow. Created 2 worker binaries with same workflow and queue name but different implementation in each worker. But workflow initiator is picking one of the worker only
→ Created one binary to initiate workflow. Created 2 worker binaries with same workflow, but different queue name and implementation in each worker. In Workflow initiator i wrote code as below. It is triggering both worker codes same time with independent run id

      WorkflowOptions options = WorkflowOptions.newBuilder()
            .setTaskQueue(Shared.HELLO_WORLD_TASK_QUEUE)
            .build();
      HelloWorldWorkflow workflow = client.newWorkflowStub(HelloWorldWorkflow.class, options);

      WorkflowOptions options1 = WorkflowOptions.newBuilder()
            .setTaskQueue(Shared.HELLO_WORLD_TASK_QUEUE1)
            .build();
      HelloWorldWorkflow workflow = client.newWorkflowStub(HelloWorldWorkflow.class, options1);