Complete Workflow Documentation¶
Status: 100% Complete
Total Workflows Documented: 10
Overview¶
This section provides COMPLETE execution traces with visual diagrams for all major automation workflows.
Workflow Categories¶
graph TB
subgraph "Automated Workflows (Every 5 min)"
Master[Master Sync Orchestration]
Master --> KPN[KPN SP16 Sync]
Master --> VOD[Vodafone Sync]
Master --> TMO[T-Mobile Sync]
Master --> EEN[KPN EEN Sync]
Master --> YIELD[Yielder Sync]
end
subgraph "CDR Processing"
CDR[Routit CDR Lifecycle<br/>6 phases]
end
subgraph "User-Triggered"
USER1[Manual Totals]
USER2[Addon Management]
USER3[API Calculation Import]
end
style Master fill:#ffebee
style CDR fill:#e3f2fd
style USER1 fill:#f3e5f5
style USER2 fill:#f3e5f5
style USER3 fill:#f3e5f5
Workflow 1: Master Sync Orchestration¶
Trigger: Cron */5 * * * *
Critical: If this fails, ALL automation stops
flowchart TD
Start[Cron: Every 5 minutes] --> Manager[sync:manager command]
Manager --> Service[SyncManagementService]
Service --> Query[Query active SyncProfiles]
Query --> Router[SyncProfileHandler<br/>MASTER ROUTER]
Router --> KPN[KpnSp16SyncCommand]
Router --> VOD[VodafoneSyncCommand]
Router --> TMO[TMobileCalviSyncCommand]
Router --> EEN[KpnEenSyncCommand]
Router --> YIELD[YielderSyncCommand]
KPN --> Totals[Calculate Totals]
VOD --> Totals
TMO --> Totals
EEN --> Totals
YIELD --> Totals
style Start fill:#ffebee
style Router fill:#fff3e0
style Totals fill:#e8f5e9
View detailed Master Sync workflow →
Workflow 2: KPN SP16 Complete Sync¶
4-command chain: Sync → Import → Puppeteer → Totals → Backup
flowchart LR
A[KpnSp16SyncCommand] --> B[KpnSp16ImportCommand]
B --> C[PupeteerKpnSp16SyncCommand]
C --> D[DispatchTotalsCommand]
D --> E[DispatchTotalsBackupCommand]
style A fill:#e3f2fd
style E fill:#e8f5e9
View detailed KPN SP16 workflow →
Workflow 3: Vodafone Sync¶
2-command chain: Sync → Totals → Backup
flowchart LR
A[VodafoneSyncCommand] --> B[DispatchTotalsCommand]
B --> C[DispatchTotalsBackupCommand]
style A fill:#e3f2fd
style C fill:#e8f5e9
View detailed Vodafone workflow →
Workflow 4: T-Mobile Calvi Sync¶
2-command chain: Sync → Totals → Backup
flowchart LR
A[TMobileCalviSyncCommand] --> B[DispatchTotalsCommand]
B --> C[DispatchTotalsBackupCommand]
style A fill:#e3f2fd
style C fill:#e8f5e9
View detailed T-Mobile workflow →
Workflow 5: KPN EEN Sync¶
2-command chain: Sync → Totals → Backup
flowchart LR
A[KpnEenSyncCommand] --> B[DispatchTotalsCommand]
B --> C[DispatchTotalsBackupCommand]
style A fill:#e3f2fd
style C fill:#e8f5e9
View detailed KPN EEN workflow →
Workflow 6: Yielder Sync¶
4-command chain: Sync → Subscription Totals → Totals → Insights → Backup
flowchart LR
A[YielderSyncCommand] --> B[CalculateSubscriptionTotalsCommand]
B --> C[CalculateTotalsCommand]
C --> D[BillingInsightTotalsCommand]
D --> E[DispatchTotalsBackupCommand]
style A fill:#e3f2fd
style E fill:#e8f5e9
Longest provider sync chain (4 commands)
View detailed Yielder workflow →
Workflow 7: Routit CDR Complete Lifecycle¶
6-phase workflow: Request → Download → Import → Invoice → Calculate → Insights
flowchart TD
A[Phase 1: Request CDRs<br/>RoutitRequestCdrsCommand] --> B[Phase 2: Download CDRs<br/>RoutitDownloadCdrsCommand]
B --> C[Phase 3: Import CDRs<br/>RoutitImportCdrsCommand]
C --> D[Phase 4: Generate Invoice<br/>RoutitInvoiceCommand]
D --> E[Phase 5: Calculate Totals<br/>CalculateTotalsCommand]
E --> F[Phase 6: Billing Insights<br/>BillingInsightTotalsCommand]
style A fill:#e1f5fe
style F fill:#e8f5e9
Longest workflow in system (5-10 minutes)
Workflow 8: Manual Totals Recalculation¶
User-triggered: Web UI button → Async calculation
flowchart LR
User[User clicks<br/>Recalculate button] --> Controller[UsageController]
Controller --> A[CalculateTotalsCommand]
A --> B[BillingInsightTotalsCommand]
B --> C[SaveStatusCommand]
C --> D[DispatchTotalsBackupCommand]
style User fill:#f3e5f5
style D fill:#e8f5e9
View detailed manual totals workflow →
Workflow 9: Mobile Addon Management¶
User-triggered: Activate or cancel mobile addons
flowchart TD
User[User action in UI] --> Decision{Action type?}
Decision -->|Activate| Activate[ActivateRoutitAddonsCommand]
Decision -->|Cancel| Cancel[CancelRoutitAddonsCommand]
Activate --> API1[Routit Nina API]
Cancel --> API2[Routit Nina API]
API1 --> Done[Update database]
API2 --> Done
style User fill:#f3e5f5
style Done fill:#e8f5e9
View detailed addon management workflow →
Workflow 10: API Calculation Import¶
API-triggered: External system imports calculations
flowchart LR
API[POST /api/v1/calculation/import] --> Service[CalculationApiService]
Service --> Queue[Create CalculationImportQueue]
Queue --> Command[CalculationImportCommand]
Command --> Process[Process import queue]
style API fill:#fff3e0
style Process fill:#e8f5e9
View detailed API import workflow →
Workflow Statistics¶
By Complexity¶
| Complexity | Count | Workflows |
|---|---|---|
| Simple (1-2 commands) | 3 | Vodafone, T-Mobile, KPN EEN |
| Medium (3-4 commands) | 5 | KPN SP16, Yielder, Manual Totals, Addon Mgmt, API Import |
| Complex (5+ commands) | 2 | Master Sync, Routit CDR |
By Trigger Type¶
| Trigger | Count | Workflows |
|---|---|---|
| Automated (Cron) | 6 | Master Sync + all provider syncs |
| User-Triggered | 2 | Manual Totals, Addon Management |
| API-Triggered | 1 | Calculation Import |
| Manual/Scheduled | 1 | Routit CDR |
By Chain Depth¶
| Workflow | Chain Length | Time |
|---|---|---|
| Routit CDR Lifecycle | 6 phases | 5-10 minutes |
| KPN SP16 Sync | 4 commands | 2-5 minutes |
| Yielder Sync | 4 commands | 1-3 minutes |
| Manual Totals | 4 commands | 10-30 seconds |
| Vodafone Sync | 2 commands | 30-60 seconds |
| T-Mobile Sync | 2 commands | 30-60 seconds |
| KPN EEN Sync | 2 commands | 30-60 seconds |
Critical Workflow Dependencies¶
graph TB
CRON[Cron Daemon] --> SM[sync:manager]
SM --> SPH[SyncProfileHandler<br/>SINGLE POINT OF FAILURE]
SPH --> ALL[All Provider Syncs]
ALL --> MCH[MessageConsumedHandler<br/>SINGLE POINT OF FAILURE]
MCH --> CHAINS[All Command Chains]
style CRON fill:#ffebee
style SPH fill:#ff6b6b
style MCH fill:#ff6b6b
Single Points of Failure¶
- MessageConsumedHandler - Enables ALL command chaining
- SyncProfileHandler - Routes ALL provider syncs
- sync:manager cron - Triggers ALL automation
Related Documentation¶
- Master Sync Workflow - Detailed master sync trace
- Provider Workflows - All provider sync flows
- CDR Processing - Complete Routit CDR lifecycle
- User Workflows - Manual and API-triggered flows
- Message Handlers - Handler documentation
- Critical Paths - Dependency analysis
Status: 100% Complete
Last Updated: December 15, 2025