I was looking at the https://github.com/temporalio/hello-world-project-template-java example and also at the documentation in general, and I have some basic questions:
From the example:
- One of them starts a workflow synchronously (
InitiateHelloWorld) and executes a method, a workflow that is associated with a specific task queue
- The other one (
HelloWorldWorker) starts a worker listening to incoming task queue and it registers a workflow implementation and some activities, and it starts polling the task queue
how do I actually signal the worker to start the workflow? To me, once I execute the worker code, that doesn’t seem to do anything in terms of execution, just set up, and association of worker with workflow. Would you first create a worker listening to a task queue, and then start the workflow either in a sync or async manner ? That seemed to have worked for me
from the docs, I see that a worker can be associated with millions of workflows listening on the same task queue, I was thinking to have a setup where 1 workflow has 1 worker associated with it and any instances of that workflow will be served by that worker… is that a good model, given that we would potentially have lots of workflows, thus lots of workers ?
what happens if we don’t start a worker manually? Does temporal automatically assign one to the workflow? From what I can see you HAVE to specify a worker for a workflow before you start it, because otherwise if you don’t have any workers listening on the task queue that you’re attempting to send a “start task” to, it wouldn’t know what worker to assign it to? Do I have a good understanding here?
a workflow method, from the docs, is essentially the method that gets called as the entry point in the workflow. Can you have multiple @workflowMethods ? What happens then ?
is there a way to query workflows and get the information available on the
temporal-webside , via an API call or something similar (or through the SDK)? Not talking about the @queryMethod here, just about the general information that you would get on the temporal front-end. Would you just use the available objects and their getters ?
is there an example of starting the workflow asynchronously using the Java SDK ?