Forked from https://github.com/steveandroulakis/temporal-money-transfer
Run a Temporal Server (Guide)
brew install temporal
temporal server start-dev
Install Node dependencies:
cd ui
npm install
cd server
npm install
Start worker
cd server
npm run worker
Start UI
cd server
npm run start
A dropdown menu simulates the following scenarios
- The transfer will run to completion
The transfer will pause and wait for approval. If the user doesn't approve the transfer within a set time, the workflow will fail.
Approve a transfer using Signals
You can also do this through the temporal
cli:
temporal workflow signal \
--query 'ExecutionStatus="Running" and WorkflowType="moneyTransferWorkflow"' \
--name approveTransfer \
--reason 'approving transfer'
In ./server/temporal/workflows.ts
, uncomment the line // throw new Error('Workflow bug!');
. Re-comment it and restart the worker for the workflow to recover.
Will introduce artifical delays in the withdraw
activity's API calls. This will cause activity retries. After 5 retries, the delay will be removed and the workflow will proceed.
Introduces an unrecoverable failure in the deposit
activity (invalid account). The workflow will fail after running compensation activities (undoWithdraw
).
Creates a Schedule that will run a set of workflows on a cadence.
Produces a schedule ID, which you can inspect in the Temporal UI's "Schedules" menu.