Skip to content

hadyrashwan/freight-delay-notification

Repository files navigation

Freight Delay Notification

This project demonstrates a freight delay notification system using Temporal.

Running locally

  • temporal server start-dev to start Temporal Server.
  • npm install to install dependencies.
  • Copy .env.example to .env and set the required variables.
  • npm run start.watch to start the Worker.
  • In another shell, npm run workflow to run the Workflow Client.

Running tests

  • npm run test

Workflow

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
Loading

Failures from Open AI API is handled gracefully.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors