This example demonstrates the usage of Signals, Queries, and Workflow Cancellation.
Signals, Queries, and cancellation messages are sent through the WorkflowClient
:
and are handled in the Workflow:
- Make sure Temporal Server is running locally (see the quick install guide).
npm install
to install dependencies.npm run start.watch
to start the Worker.- In another shell,
npm run workflow.start
to run the Workflow. - Run
npm run workflow.query
to query the Workflow. Should printblocked? true
- Run
npm run workflow.signal
to unblock the Workflow. Should printunblockSignal sent
- Run
npm run workflow.query
to query the Workflow. Should printblocked? false