Feature Flags
Feature Flag System
StackFlow's feature flag system allows platform administrators to enable or disable specific capabilities without code deployments. Feature flags are evaluated at runtime by the StackFlowAPI Lambda and cached in Redis for 60 seconds to minimize database load. Flags can be scoped to the entire platform, specific tenants, specific user roles, or percentage-based rollouts.
- DynamoDB:
StackFlow_FeatureFlagtable with PKflagKeyand GSI ontenantId - IAM:
StackFlowAPIRolewithdynamodb:GetItem,dynamodb:PutItemonStackFlow_FeatureFlag - Redis: Feature flag cache under
sf:flags:{tenantId}:{flagKey}with TTL 300s
Managing Flags
Navigate to Admin → System → Feature Flags to view and manage all flags. Each flag has a key, current state, scope, and description. Changes take effect within 60 seconds as the Redis cache expires.
curl -X PATCH https://your-instance.stackflow-tech.com/prod/api/admin/feature-flags/ai_copilot_v2 -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" -d '{"enabled": true, "scope": "tenant", "rollout_percentage": 20}'
Flag Scoping
| Scope | Description |
|---|---|
global | Applies to all tenants and users on the platform |
tenant | Applies to all users within a specific tenant |
role | Applies to users with a specific role |
user | Applies to specific user IDs (for targeted testing) |
percentage | Random percentage of users (canary rollout) |
Rollout Strategies
Percentage-based rollouts use a deterministic hash of the user's ID to ensure consistent behavior — a user who sees a feature today will continue to see it tomorrow. Rollout percentage can be gradually increased from 0% to 100% without user disruption.
Default Flags
| Flag Key | Default | Description |
|---|---|---|
ai_copilot | Enabled | AI Copilot sidebar |
semantic_cache | Enabled | Redis semantic query cache |
exemplar_learning | Enabled | Learn from resolved incidents |
neptune_impact_analysis | Enabled | Neptune-based blast radius |
cloud_finops | Disabled | FinOps Hub (requires cost data setup) |
saml_federation | Disabled | SAML 2.0 SSO (beta) |