This is a typescript adaption of the moneytransfer example from the Temporal Java SDK
The money transfer app requires the following search attributes:
- CustomBoolField
- CustomDateTimeField
- CustomIntField
- CustomStringField
These can be added by using tctl (local Temporal) or via tcld or the UI (cloud Temporal).
- 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 webclient
to run the web application. - Using the webapp, you can create new payments, payments over 1000 euros require an approval. Use the app to approve before expiration.
- Use encryption by setting ENCRYPT_PAYLOAD to true
- Set the following ENV Variables
- TEMPORAL_NAMESPACE with the name of your Cloud namespace
- TEMPORAL_HOST_URL with the URL of your Cloud namespace
- TEMPORAL_UI with the URL of the Temporal UI
- MTLS must be set to true
- TEMPORAL_TLS_CERT path to your client cert file
- TEMPORAL_TLS_KEY path to your client cert key file
npm install
to install dependencies.npm run start.watch
to start the Worker.- In another shell,
npm run webclient
to run the web application. - Using the webapp, you can create new payments, payments over 1000 euros require an approval. Use the app to approve before expiration.
- Use encryption by setting ENCRYPT_PAYLOAD to true
DEMO SCENARIO
- Simple transaction
- Introduce an error in activity
- Uncomment the error in the deposit activity, show the error handling in the UI
- Patch code, show that the workflow is resumed and the transfer is executed
- Introduce business logic (if > 1000, reject)
- You can change the amount in client.ts
args: ["myaccount", "friendaccount", nanoid(), 2500 ]
- You can change the amount in client.ts
- Introduce long running business logic with signal, Signal (if > 1000, wait 30s for approval)
- Execute without signal, show timeout with automated rejection
- Execute with signal using clientSignal.ts with the correct workflowId, show that the transfer is executed