# adityasagave/shipment-booking-automation architecture

> Architecture diagram of the GitHub repository adityasagave/shipment-booking-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityasagave/shipment-booking-automation
- Repository: https://github.com/adityasagave/shipment-booking-automation

## Overview

##### Project type and purpose
- This is a no-code/low-code automation solution built with Microsoft Power Automate Desktop.
- Purpose: Automate shipment booking tasks (Excel form prep, Word doc edits for CI/CSD, Outlook email sends and inbox monitoring, print dispatch) to save time and reduce errors.

##### File structure
- Top-level files:
- LICENSE (project license)
- Power-Automate-language.wdl (workflow definition in WDL format)
- README.md (documentation)
- No separate code directories—this is a single PAD (Power Automate Desktop) flow defined in the WDL file.
- Supporting assets are in predefined folders specified in the README (Booking form-offline, CSD-offline, CI-offline, signature images).

##### README for architecture insights
- Core workflow stages:
a. Input collection (date, weight, dimensions, agent selection).
b. Excel automation (populate booking form).
c. Word automation (populate CI & CSD docs).
d. Outlook integration (send initial emails, monitor inbox, parse Job ID/AWB via regex, send final emails).
e. Print automation (auto-print final CI & CSD).
- Technical stack: Power Automate Desktop, Excel, Word, Outlook, Regex, file/date/loop controls.

a. Main components:
- User Interface (PAD UI dialogs)
- PAD Flow Engine (core workflow)
- Excel Service (reads/writes .xlsx)
- Word Service (reads/writes .docx)
- Outlook Service (SMTP send, inbox monitor)
- Regex Parser (Job ID & AWB extraction)
- File System (template storage, signature images, output folder)
- Printer Service (auto-print documents)
b. Relationships & interactions:
- User launches PAD flow → UI dialogs collect inputs → PAD Flow Engine
- PAD Flow Engine calls Excel Service → reads template, writes data → saves booking form
- PAD Flow Engine calls Word Service twice (CI, CSD) → populates fields, images, tamper tape numbers
- PAD Flow Engine calls Outlook Service to send initial emails → monitors inbox
- Inbox messages → Regex Parser extracts Job ID & AWB → PAD Flow Engine updates Word docs → Outlook Service sends final emails
- PAD Flow Engine calls Printer Service → sends CI & CSD to printer
- PAD Flow Engine writes output files back to File System
c. Architectural patterns/design principles:
- Orchestration pattern: PAD Flow Engine orchestrates multiple application connectors.
- Modular adapters: Excel adapter, Word adapter, Outlook adapter, Regex processor, Printer adapter.
- Single workflow file (Power-Automate-language.wdl) defines logic, loops, conditions.
d. Key technologies:
- Microsoft Power Automate Desktop (workflow engine)
- Microsoft Excel & Word COM automation
- Outlook Desktop COM automation
- Regular expressions for parsing
- Local file system for templates & outputs

## Diagram (Mermaid)

```mermaid
flowchart TD
    UI["User UI Dialogs"]:::user
    subgraph "Orchestration"
        PAD["PAD Flow Engine"]:::orchestrator
    end
    Excel["Excel Service"]:::service
    Word["Word Service"]:::service
    Outlook["Outlook Service"]:::service
    Reg["Regex Parser"]:::parser
    FS["File System"]:::storage
    Printer["Printer Service"]:::service
    Docs["README.md"]:::docs
    License["LICENSE"]:::docs

    UI -->|"collect inputs"| PAD
    PAD -->|"populate templates"| Excel
    Excel -->|"save form to FS"| FS
    PAD -->|"populate CI & CSD"| Word
    Word -->|"save docs to FS"| FS
    PAD -->|"send initial emails"| Outlook
    Outlook -->|"incoming emails"| PAD
    PAD -->|"parse Job ID/AWB"| Reg
    Reg -->|"parsed data"| PAD
    PAD -->|"update Word docs"| Word
    PAD -->|"send final emails"| Outlook
    PAD -->|"print documents"| Printer
    Printer -->|"output to FS"| FS

    click PAD "https://github.com/adityasagave/shipment-booking-automation/blob/main/Power-Automate-language.wdl"
    click Docs "https://github.com/adityasagave/shipment-booking-automation/blob/main/README.md"
    click License "https://github.com/adityasagave/shipment-booking-automation/tree/main/LICENSE"

    classDef service fill:#B3CDE3,stroke:#6497B1,color:#03396C;
    classDef storage fill:#C7E9B4,stroke:#7FBF7F,color:#00441B;
    classDef parser fill:#FDE0A9,stroke:#FBB44A,color:#A45200;
    classDef orchestrator fill:#FFF2AE,stroke:#FDD835,color:#8D6E63;
    classDef user fill:#D3E5FF,stroke:#82A4E8,color:#1E3A5F;
    classDef docs fill:#EEEEEE,stroke:#CCCCCC,color:#333333;
```
