Workflow Index¶
Quick reference for all 10 documented workflows with visual diagrams.
Find Your Workflow¶
| I need to... | Workflow | Complexity |
|---|---|---|
| Understand the master orchestrator | Master Sync | Critical |
| Debug KPN SP16 sync issues | KPN SP16 Sync | High |
| Debug Vodafone sync issues | Vodafone Sync | Medium |
| Debug T-Mobile sync issues | T-Mobile Sync | Medium |
| Debug KPN EEN sync issues | KPN EEN Sync | Medium |
| Debug Yielder/Odido issues | Yielder Sync | Medium |
| Understand CDR processing | CDR Processing | Very High |
| Debug manual totals recalc | Manual Totals | Low |
| Debug addon activation | Addon Management | Low |
| Understand API calculations | API Calculation Import | Medium |
All Workflows¶
1. Master Sync Orchestration¶
Complexity: Critical
Duration: 5-10 minutes (all providers)
Frequency: Every 5 minutes
Trigger: Cron */5 * * * *
Purpose: Master orchestrator that runs all provider syncs
Entry Point: sync:manager console command
Flow:
Cron → sync:manager → SyncManagementService
→ Query active SyncProfiles
→ For each profile: Create SyncTask
→ Dispatch SyncProfileCommand
→ SyncProfileHandler routes to provider
→ Provider handler executes
→ Dispatch totals calculation
Key Handler: SyncProfileHandler (master router)
Single Point of Failure: If sync:manager stops, ALL automation stops
2. KPN SP16 Complete Sync¶
Complexity: High (4-command chain) Duration: 3-8 minutes Trigger: SyncProfileHandler routes KPN_SP16 type
Commands: 1. KpnSp16SyncCommand 2. KpnSp16ImportCommand 3. PupeteerKpnSp16SyncCommand 4. DispatchTotalsCommand
Special Features: - Import queue processing - Puppeteer browser automation - 3 external API calls - 8 database tables
Database Operations:
- Reads: kpn_import_queue, sync_profile, customer
- Writes: call_detail_record, subscription, invoice, totals, totals_backup
3. Vodafone Sync¶
Complexity: Medium (2-command chain) Duration: 2-5 minutes Trigger: SyncProfileHandler routes MY_VODAFONE type
Commands: 1. VodafoneSyncCommand 2. DispatchTotalsCommand 3. DispatchTotalsBackupCommand
Features: - Queue processing - Portal scraping - 2 API calls - 7 database tables
CDR Volume: 5k-20k per sync
4. T-Mobile Calvi Sync¶
Complexity: Medium (2-command chain) Duration: 2-4 minutes Trigger: SyncProfileHandler routes T_MOBILE type
Commands: 1. TMobileCalviSyncCommand 2. DispatchTotalsCommand 3. DispatchTotalsBackupCommand
Special Features: - Calvi partner structure support - Partner-level totals - Monthly partner calculation (18th)
Console Command:
5. KPN EEN Sync¶
Complexity: Medium (2-command chain) Duration: 2-5 minutes Trigger: SyncProfileHandler routes KPN_EEN type
Commands: 1. KpnEenSyncCommand 2. DispatchTotalsCommand 3. DispatchTotalsBackupCommand
Features: - KPN EEN Platform API - CDR and subscription import
CDR Volume: 3k-10k per sync
6. Yielder Sync¶
Complexity: Medium (3-command chain) Duration: 2-6 minutes Trigger: SyncProfileHandler routes YIELDER type
Commands: 1. YielderSyncCommand 2. CalculateSubscriptionTotalsCommand 3. DispatchTotalsCommand 4. DispatchTotalsBackupCommand
Special Features: - Queue handling (every minute) - SIM card activation queue - Subscription-level totals
Queue Command:
7. Routit CDR Complete Lifecycle¶
Complexity: Very High (6-phase workflow)
Duration: 10-30 minutes
Trigger: routit:cdr:sync console command
Phases: 1. Request CDRs - Request from Routit API 2. Download CDRs - Download ZIP files 3. Import CDRs - Bulk insert 10k-50k records 4. Generate Invoice - Create Routit invoice 5. Calculate Totals - Calculate billing 6. Finalize - Generate insights, save status
Commands: 6 distinct commands across all phases
Bottleneck: Import phase (2-5 minutes for bulk insert)
Performance: 5k-10k CDRs per second during import
8. Manual Totals Recalculation¶
Complexity: Low (user-triggered) Duration: 10-30 seconds Trigger: User clicks "Recalculate" button
Entry Point: UsageController.php:617
Commands: 1. CalculateTotalsCommand 2. BillingInsightTotalsCommand 3. SaveStatusCommand 4. DispatchTotalsBackupCommand
Use Cases: - Correct calculation errors - Apply updated rate plans - Reprocess after CDR import - Manual verification
User Experience: - Loading spinner - Async execution - Page refresh after 10-30 seconds
9. User Addon Management¶
Complexity: Low (user-triggered) Duration: 2-5 seconds Trigger: User clicks "Activate/Cancel Addons" button
Entry Point: TmobileSimcardController.php:696,700
Commands: - ActivateRoutitAddonsCommand - CancelRoutitAddonsCommand
Features: - Routit Nina API integration - Rate limiting (10 requests/min per customer) - Permission validation - Activity logging
Database:
-- Log addon activation
INSERT INTO addon_log (customer_id, user_id, action, addon_type)
VALUES (123, 456, 'activate', 'data_boost');
10. API-Triggered Calculation Import¶
Complexity: Medium Duration: Variable (depends on data size) Trigger: API endpoint call
Command: CalculationImportCommand
Purpose: Import calculations from external API
Features: - API integration - Data validation - Async processing - Error handling
Workflow Comparison¶
By Complexity¶
| Complexity | Count | Workflows |
|---|---|---|
| Critical | 1 | Master Sync |
| Very High | 1 | Routit CDR Lifecycle |
| High | 1 | KPN SP16 |
| Medium | 5 | Vodafone, T-Mobile, KPN EEN, Yielder, API Import |
| Low | 2 | Manual Totals, Addon Management |
By Command Chain Length¶
| Chain Length | Workflows |
|---|---|
| 6 phases | Routit CDR Lifecycle |
| 4 commands | KPN SP16, Manual Totals |
| 3 commands | Yielder |
| 2 commands | Vodafone, T-Mobile, KPN EEN |
| 1 command | Addon Management, API Import |
By CDR Volume¶
| Volume | Workflows |
|---|---|
| 10k-50k | KPN SP16, Routit CDR |
| 5k-20k | Vodafone |
| 5k-15k | T-Mobile |
| 3k-10k | KPN EEN |
| 2k-8k | Yielder |
| N/A | Manual Totals, Addon Management, API Import |
By Duration¶
| Duration | Workflows |
|---|---|
| 10-30 minutes | Routit CDR Lifecycle |
| 5-10 minutes | Master Sync (all providers) |
| 3-8 minutes | KPN SP16 |
| 2-6 minutes | Vodafone, T-Mobile, KPN EEN, Yielder |
| 10-60 seconds | Manual Totals |
| 2-5 seconds | Addon Management |
Workflow Dependencies¶
Master Sync → All Provider Workflows¶
graph TB
Master[Master Sync<br/>sync:manager]
Master --> KPN[KPN SP16 Sync]
Master --> VOD[Vodafone Sync]
Master --> TMO[T-Mobile Sync]
Master --> EEN[KPN EEN Sync]
Master --> YIELD[Yielder Sync]
KPN --> Totals1[Totals]
VOD --> Totals2[Totals]
TMO --> Totals3[Totals]
EEN --> Totals4[Totals]
YIELD --> Totals5[Totals]
style Master fill:#ff6b6b
style Totals1 fill:#51cf66
style Totals2 fill:#51cf66
style Totals3 fill:#51cf66
style Totals4 fill:#51cf66
style Totals5 fill:#51cf66
Common Pattern¶
ALL provider syncs follow this pattern:
- Sync - Import data from provider
- Calculate - Run totals calculation
- Backup - Backup totals to historical table
- Save - Update status
Critical Workflow Points¶
Single Points of Failure¶
If these fail, entire workflows stop:
- MessageConsumedHandler - Enables ALL command chaining
- SyncProfileHandler - Routes ALL provider syncs
- DispatchTotalsHandler - Routes ALL totals calculations
- sync:manager cron - Triggers ALL automated syncs
See: Single Points of Failure →
Troubleshooting Workflows¶
Workflow Not Running¶
- Check cron status:
sync:managerrunning every 5 min? - Check SyncProfile active status in database
- Check SyncTask table for errors
- Review handler logs
Workflow Failing¶
- Identify which command in chain is failing
- Check handler logs for that command
- Verify external API access (if sync workflow)
- Check database connectivity
- Review Common Issues →
Workflow Slow¶
- Check CDR volume - is it unusually high?
- Check database query performance
- Check external API response times
- Review bulk insert optimization (for import workflows)
See: Debugging Guide →
Related Documentation¶
- Complete Workflow Details - Full documentation with diagrams
- Command Index - All console commands
- Handler Index - All MessageBus handlers
- Dependencies - Workflow relationships
- Troubleshooting - Debug workflows