This sample shows use cases for Activities:
makeHTTPRequest
: Make an external HTTP request in an Activity (usingaxios
).cancellableFetch
: Make a cancellable HTTP request with cancellationSignal.doSomethingAsync
: Complete an Activity async withAsyncCompletionClient
.
More Activity samples are listed here.
- Mocha: Run the tests in
src/mocha/
with:npm test
: run oncenpm run test.watch
: run when files changenpm run test.coverage
: run with coverage report
- Jest:
npm run jest
runs tests outside themocha/
directory:
temporal server start-dev
to start Temporal Server.npm install
to install dependencies.npm run start.watch
to start the Worker.- In another shell,
npm run workflow
to run the Workflow.
The Workflow should make an HTTP request to httpbin.org and then return:
The answer is 42