This example app demonstrates how to put together an Nx integrated monorepo for a Temporal worker, together with workflows and activities.
Make sure nx is in the global scope:
$ npm i -g nxMake sure Temporal Server is running:
temporal server start-devAfterwards:
$ pnpm install
$ nx serve temporal-workerThis will start a TS SDK Temporal worker that is basically the same as the hello-world sample. It will not bundle the workflows for development speed, but we should bundle for production!
Run:
$ nx bundle temporal-workerThis will create a Temporal worker that reads from the workflow bundle. It also bundles the workflows.
Run the worker with the bundled workflows as:
$ STAGE=production node dist/apps/temporal-worker/main.js