This is an empty project that is scaffolded out when you run npx @temporalio/create@latest ./myfolder and choose the empty option.
- Add your Activity Definitions to
src/activities.ts. - Add your Workflow Definitions to
src/workflows.ts. - Set your task queue name in
src/shared.ts. - Modify the
src/client.tsfile and replaceYOUR_WORKFLOWwith the name of your Workflow. - Add Activity and Workflow tests to the
src/mochadirectory in files with the extension.test.ts.
Install dependencies with npm install.
Run temporal server start-dev to start Temporal Server.
The package.json file contains scripts for running the client, the Worker, and tests.
- In a shell, run
npm run start.watchto start the Worker and reload it when code changes. - In another shell, run
npm run workflowto run the Workflow Client. - Run
npm run formatto format your code according to the rules in.prettierrc. - Run
npm run lintto lint your code according to the rules ineslintrc.js. - Run
npm testto run the tests.