Before starting workers or workflows, you MUST start a local dev server, using the Temporal CLI:
temporal server start-dev # Start this in the background.It is perfectly OK for this process to be shared across multiple projects / left running as you develop your Temporal code.
Alternatively, you can run Temporal as a Docker Compose service. See references/core/docker-compose.md for details.
How you start a worker is project-dependent, but generally Temporal code should have a program entrypoint which starts a worker. If your project doesn't, you should define it.
When you need a new worker, you should start it in the background (and preferrably have it log somewhere you can check), and then remember its PID so you can kill / clean it up later.
Best practice: As far as local development goes, run only ONE worker instance with the latest code. Don't keep stale workers (running old code) around.
Always kill workers when done. Don't leave workers running.