WF-119: Resource Quota Management
Workflow ID: WF-119 Category: Resource Management Priority: P2 Last Updated: January 11, 2026
Overview
This workflow manages resource quotas for workstations, storage, and API rate limits, including approaching limit alerts, hard limit enforcement, and upgrade path presentation.
Trigger Events
- Resource usage crosses threshold (50%, 80%, 95%)
- Hard limit reached
- User requests quota increase
- Automated quota review (monthly)
Sequence Diagram
Quota Types
1. Workstation Resources
| Resource | Pro | Enterprise | Units |
|---|---|---|---|
| CPU cores | 4 | 16 | vCPUs |
| RAM | 8 | 32 | GB |
| Disk storage | 50 | 200 | GB |
| Concurrent sessions | 2 | 10 | sessions |
2. Storage Quotas
| Resource | Pro | Enterprise | Units |
|---|---|---|---|
| Project storage | 100 | 500 | GB |
| Context database | 10 | 50 | GB |
| Backup retention | 7 | 30 | days |
| Artifact storage | 25 | 100 | GB |
3. API Rate Limits
| Resource | Pro | Enterprise | Units |
|---|---|---|---|
| API requests | 1,000 | 10,000 | /hour |
| Webhook calls | 100 | 1,000 | /hour |
| Export requests | 10 | 100 | /day |
| Bulk operations | 5 | 50 | /hour |
Alert Thresholds
| Threshold | Action | Notification |
|---|---|---|
| 50% | Log only | Dashboard indicator |
| 80% | Warning | Email + Dashboard |
| 95% | Urgent | Email + In-app alert |
| 100% | Enforce | Block + Upgrade prompt |
Process Steps
1. Usage Monitoring
Collection Frequency:
| Resource | Frequency | Method |
|---|---|---|
| Storage | Every 5 min | Disk usage scan |
| API calls | Real-time | Request counter |
| Sessions | Real-time | Connection count |
| CPU/RAM | Every 1 min | System metrics |
Aggregation:
- Hourly summaries
- Daily reports
- Monthly trends
2. Alert Generation
80% Warning Alert:
{
"alert_id": "alert_123",
"user_id": "usr_456",
"resource": "storage",
"current_usage_gb": 82.5,
"quota_gb": 100,
"percentage": 82.5,
"threshold": "warning",
"created_at": "2026-01-11T12:00:00Z"
}
Email Content:
Subject: Storage quota warning - 82% used
Hi [Name],
Your storage is approaching its limit:
Used: 82.5 GB / 100 GB (82%)
At 100%, you won't be able to create new files.
Options:
- Delete unused files
- Upgrade your plan for more storage
Manage storage: [DASHBOARD_URL]
View plans: [PRICING_URL]
3. Hard Limit Enforcement
API Response at Limit:
{
"error": "quota_exceeded",
"code": "STORAGE_QUOTA_EXCEEDED",
"message": "Storage quota exceeded. Delete files or upgrade plan.",
"current_usage_gb": 100.2,
"quota_gb": 100,
"upgrade_url": "/dashboard/billing/upgrade"
}
Blocked Operations:
- File creation/upload
- Project cloning
- Backup creation
Still Allowed:
- File reading
- File deletion
- Dashboard access
4. Upgrade Path
Upgrade Options Displayed:
| Current | Upgrade To | Additional | Price |
|---|---|---|---|
| Pro | Enterprise | +100 GB storage | +$100/mo |
| Pro | Storage Add-on | +50 GB | +$25/mo |
| Enterprise | Custom | Unlimited | Contact sales |
One-Click Upgrade Flow:
- User clicks "Upgrade" in quota alert
- Pre-filled with recommended option
- Stripe checkout (if payment change)
- Instant quota increase
- Confirmation email
5. Quota Increase Request
For Enterprise/Custom:
POST /api/v1/quotas/request-increase
{
"resource": "storage",
"current_quota_gb": 500,
"requested_quota_gb": 1000,
"justification": "New project with large assets",
"timeline": "immediate"
}
Review Process:
- Auto-approve if within plan limits
- Sales review if custom quota needed
- Finance approval for large increases
API Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/quotas | GET | Get all quota usage |
/api/v1/quotas/{resource} | GET | Get specific quota |
/api/v1/quotas/history | GET | Usage history |
/api/v1/quotas/request-increase | POST | Request increase |
/api/v1/quotas/alerts | GET | List active alerts |
Request: Get Quotas
GET /api/v1/quotas
Response
{
"user_id": "usr_456",
"plan": "pro",
"quotas": {
"storage": {
"used_gb": 82.5,
"quota_gb": 100,
"percentage": 82.5,
"status": "warning"
},
"api_requests": {
"used": 450,
"quota": 1000,
"percentage": 45,
"status": "ok",
"resets_at": "2026-01-11T13:00:00Z"
},
"sessions": {
"active": 1,
"quota": 2,
"percentage": 50,
"status": "ok"
}
},
"alerts": [
{
"resource": "storage",
"threshold": "warning",
"created_at": "2026-01-11T12:00:00Z"
}
],
"upgrade_available": true
}
Dashboard Display
Quota Widget:
+----------------------------------+
| Resource Usage |
+----------------------------------+
| Storage [========--] 82% |
| API Calls [====------] 45% |
| Sessions [=====-----] 50% |
+----------------------------------+
| ! Storage approaching limit |
| [Upgrade Plan] |
+----------------------------------+
Error Messages
| Error | HTTP | User Message |
|---|---|---|
STORAGE_EXCEEDED | 507 | "Storage full. Delete files or upgrade." |
RATE_LIMITED | 429 | "Too many requests. Wait or upgrade." |
SESSION_LIMIT | 403 | "Max sessions reached. Close one or upgrade." |
EXPORT_LIMIT | 429 | "Daily export limit reached. Try tomorrow." |
Audit Events
| Event | Logged |
|---|---|
quota.threshold_crossed | Resource, Percentage, Threshold |
quota.alert_sent | User, Resource, Channel |
quota.limit_enforced | User, Resource, Operation blocked |
quota.increase_requested | User, Resource, Amount |
quota.increase_approved | User, Resource, New quota |
quota.upgrade_completed | User, Old plan, New plan |
Related Workflows
Last Updated: January 11, 2026