This project demonstrates a freight delay notification system using Temporal.
temporal server start-devto start Temporal Server.npm installto install dependencies.- Copy
.env.exampleto.envand set the required variables. npm run start.watchto start the Worker.- In another shell,
npm run workflowto run the Workflow Client.
npm run test
The following diagram illustrates the workflow for freight delay notifications:
sequenceDiagram
participant Client
participant Workflow
participant GetDelayActivity
participant GetMessageActivity
participant SendEmailActivity
Client->>Workflow: Start FreightDelayWorkflow
Workflow->>GetDelayActivity: Call getDelay()
GetDelayActivity-->>Workflow: Returns delay information
Workflow->>GetMessageActivity: Call getMessage(delayInfo)
GetMessageActivity-->>Workflow: Returns notification message
Workflow->>SendEmailActivity: Call sendEmail(message)
SendEmailActivity-->>Workflow: Email sent confirmation
Workflow-->>Client: Workflow completed
Failures from Open AI API is handled gracefully.
This project is licensed under the MIT License.
