@startuml insight_quota_flow !option handwritten true skinparam sequenceMessageAlign center skinparam defaultFontName Helvetica participant "Billing" as Billing participant "insight-billing-gateway" as Gateway participant "DB" as DB participant "event-server" as EventServer participant "insight-task-generator" as TaskGenerator participant "insight-task-processor" as TaskProcessor participant "vlm-host" as VlmHost group #E8F2FC Provisioning Flow Billing -> Gateway : Notify Quota Updated Gateway -> DB : Save/Update Quota Data Gateway -> EventServer : Create Subscription note over TaskGenerator : Target: insight-task-generator end group #FBF6DD Processing Flow EventServer -> TaskGenerator : Webhook Event (Trigger) TaskGenerator -> DB : Fetch Quota Balance DB --> TaskGenerator : Quota Data TaskGenerator -> TaskProcessor : Send Task Message TaskProcessor -> DB : Verify Current Quota DB --> TaskProcessor : Quota Valid TaskProcessor -> VlmHost : Call VLM Model VlmHost --> TaskProcessor : Model Results TaskProcessor -> TaskProcessor : Process Results TaskProcessor -> DB : Save InsightEvent TaskProcessor -> DB : Consume Quota TaskProcessor -> Billing : Notify Quota Usage (NSQ) end @enduml