When I launch a worker does the workflow execution of the worker execute on the node where I run the worker or is the actual workflow execution done on the temporal server?
Your workers execute the code.
Without going into details, three main parts are involved during the workflow execution: client, server, and worker.
The client sends a request to the server, in your case, to start a workflow (specifying at least namespace, taskqueue and workflowType),
The server durably creates the workflow execution (and event history) and then communicates with your workers by placing workflow tasks on task queues that your workers poll on
Once a worker picks up a workflow task, executes as much of your workflow code as possible until it needs to block to communicate back to the server to do things like schedule activity invocations, create durable timers, complete/fail the workflow execution.
Workflow executions in temporal are not tied to a specific worker, in case a worker crashes, another worker, if available, will pick up the task in order to continue with the workflow execution.
This video explains how it works
- Fault Tolerant Distributed Microservices Orchestration with Temporal - Maxim & Tihomir @ TheDevConf - YouTube
- Temporal - Understanding Workflow Event Histories Workshop - Part 1 - YouTube
Which example are you running? Some SDKs sample repositories have the starter(client) and worker in the same class, which can be confusing.