Documentation Index
Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
Use this file to discover all available pages before exploring further.
Dependencies
Before setting up the License service, ensure you have the following dependencies in place:- Organization Manager for organization lifecycle events and realm resolution
- PostgreSQL database for storing license and usage data
- Kafka for event-driven communication with other FlowX.AI services
- Redis for caching and master election
- Keycloak (or compatible OAuth2 provider) for authentication and authorization
- SpiceDB for fine-grained authorization
Infrastructure prerequisites
| Component | Description |
|---|---|
| PostgreSQL | Dedicated database for license data |
| Kafka | Message broker for inter-service communication |
| Redis | Caching layer and distributed lock for master election |
| Keycloak | Identity provider for service authentication |
| SpiceDB | Authorization service for fine-grained access control |
Configuration
Authorization configuration
| Environment Variable | Description | Default Value |
|---|---|---|
SECURITY_TYPE | Security type (JWT public key validation) | jwt-public-key |
SECURITY_OAUTH2_BASE_SERVER_URL | Base URL of the Keycloak server | |
SECURITY_OAUTH2_SAREALM | Service accounts realm ID | 00000002-0002-4002-8002-000000000002 |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_ID | Service account client ID | flowx-license-sa |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_SECRET | Service account client secret | |
FLOWX_LIB_SECURITY_SERVICES_ORGANIZATIONMANAGER_BASEURL | Organization manager URL | http://organization-manager:80 |
PostgreSQL configuration
The License service uses its own dedicated PostgreSQL database.| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_DATASOURCE_URL | JDBC connection URL for PostgreSQL | jdbc:postgresql://flowxlicensedb:5432/license |
SPRING_DATASOURCE_USERNAME | Database username | postgres |
SPRING_DATASOURCE_PASSWORD | Database password | - |
PostgreSQL and Redis credentials: plain env vars still work. The License service is a standard Spring Boot service — it reads the
SPRING_DATASOURCE_* and SPRING_DATA_REDIS_* environment variables shown here. The postgresql.servers/credentials and redis.servers/credentials blocks in the FlowX Helm chart’s values.yaml are the chart’s own secret-to-env-var mapping; they exist to template the same plain env vars from your secrets. You can keep injecting credentials through plain environment variables exactly as before.Redis configuration
The License service includes Redis in its configuration for caching and master election. Configure Redis connection using the standard Redis environment variables. Quick reference:| Environment Variable | Description | Example Value | Status |
|---|---|---|---|
SPRING_DATA_REDIS_HOST | Redis server hostname | localhost | Recommended |
SPRING_DATA_REDIS_PORT | Redis server port | 6379 | Recommended |
SPRING_DATA_REDIS_PASSWORD | Redis authentication password | - | Recommended |
REDIS_TTL | Cache TTL in milliseconds | 5000000 | Optional |
Both
SPRING_DATA_REDIS_* and SPRING_REDIS_* variable prefixes are supported. The SPRING_DATA_REDIS_* prefix is the modern Spring Boot standard and is recommended for new deployments.For advanced Redis deployment modes (Sentinel, Cluster) and SSL/TLS setup, see the Redis Configuration guide. Note that Sentinel and Cluster modes are only supported by the Events Gateway service.
Redis is configured but not actively used by the License service at this time. It is included as part of the standard Spring service setup and may be used in future versions.
Kafka configuration
Core Kafka settings
| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_KAFKA_BOOTSTRAP_SERVERS | Address of the Kafka server(s) | localhost:9092 |
KAFKA_MESSAGE_MAX_BYTES | Maximum message size (bytes) | 52428800 (50 MB) |
Topic naming configuration
| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_TOPIC_NAMING_PACKAGE | Package prefix for topic names | ai.flowx. |
KAFKA_TOPIC_NAMING_ENVIRONMENT | Environment segment for topic names | |
KAFKA_TOPIC_NAMING_VERSION | Version suffix for topic names | .v1 |
KAFKA_TOPIC_NAMING_SEPARATOR | Primary separator for topic names | . |
KAFKA_TOPIC_NAMING_SEPARATOR2 | Secondary separator for topic names | - |
Kafka topics
The License service consumes events from the following topics:| Topic | Default Value | Description |
|---|---|---|
| License usage | ai.flowx.license.usage.v1 | Receives usage reporting events from other services |
| Organization events | ai.flowx.organization.events.v1 | Receives organization lifecycle events |
Kafka consumer threads
| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_CONSUMER_THREADS_LICENSE_USAGE | Thread count for license usage consumer | 6 |
KAFKA_CONSUMER_THREADS_ORGANIZATION_EVENTS | Thread count for organization events consumer | 2 |
KAFKA_AUTH_EXCEPTION_RETRY_INTERVAL | Retry interval after auth exception (seconds) | 10 |
CAS lib configuration (SpiceDB)
| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_SPICEDB_HOST | SpiceDB hostname | spicedb |
FLOWX_SPICEDB_PORT | SpiceDB gRPC port | 50051 |
FLOWX_SPICEDB_TOKEN | SpiceDB authentication token | - |
FLOWX_LIB_CASCLIENT_RUNTIME_IMPLEMENTATION | Runtime authorization backend used by the CAS client. CUSTOM routes checks through authorization-system; SPICEDB delegates to SpiceDB. Keep the default unless instructed by FlowX. | CUSTOM |
FlowX SaaS connection (self-hosted only)
| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_LICENSE_ORGANIZATION_ID | Organization ID provided by FlowX during self-hosted registration. Initialized with the notset sentinel so the OAuth client can start before the self-hosted client injects the real value at runtime. | notset |
FLOWX_LICENSE_KEY | License key issued by FlowX for this self-hosted deployment. | - |
FLOWX_LICENSE_AUTH_SERVER_URL | Auth endpoint provided by FlowX licensing. | - |
FLOWX_LICENSE_SERVER_URL | License API endpoint provided by FlowX licensing. | - |
Usage upload tuning
The License service periodically uploads usage records to FlowX SaaS. These defaults work for most deployments and only need tuning for very large organizations:| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_SCHEDULER_USAGEUPLOAD_LOADFETCHSIZE | Number of usage records loaded from the database per scheduler tick | 100 |
FLOWX_SCHEDULER_USAGEUPLOAD_UPLOADBATCHSIZE | Number of usage records sent per upload request to FlowX SaaS | 500 |
Logging configuration
| Environment Variable | Description | Default Value |
|---|---|---|
LOGGING_LEVEL_APP | Application-specific log level | INFO |
LOGGING_LEVEL_LIQUIBASE | Liquibase migration log level | INFO |
Secrets management
The License service requires several secrets to be configured. These should be stored securely and referenced via Kubernetes secrets or a secrets management solution.| Secret Name | Description |
|---|---|
SPRING_DATASOURCE_PASSWORD | PostgreSQL database password |
SPRING_REDIS_PASSWORD | Redis authentication password |
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_MAINIDENTITY_CLIENT_SECRET | Keycloak service account secret |
FLOWX_SPICEDB_TOKEN | SpiceDB authentication token |
Deployment
Helm values example
Below is an example Helm values configuration for deploying the License service:Network policies
The License service requires network access to the following services:| Service | Purpose | Pod Label |
|---|---|---|
| Kafka | Message broker communication | flowx.ai/egress-s-kafka |
| PostgreSQL | Primary data storage | flowx.ai/egress-s-postgresql |
| Redis | Caching and master election | flowx.ai/egress-s-redis |
| Keycloak | Authentication | flowx.ai/egress-s-keycloak |
| SpiceDB | Authorization | flowx.ai/egress-s-spicedb |
Monitoring
The License service exposes Prometheus metrics for monitoring. Turn on scraping by setting the pod label:Health endpoints
| Endpoint | Description |
|---|---|
/actuator/health | Health check endpoint |
/actuator/metrics | Prometheus metrics endpoint |
/actuator/info | App info endpoint |
Verify your setup
The License service pod is running and healthy:
kubectl get pods -l app=licenseThe health endpoint returns HTTP 200:
curl http://license:8080/actuator/healthDatabase migrations completed successfully — check pod logs for
Liquibase: Update has been successfulSpiceDB connection is established — check pod logs for successful CAS client initialization
Kafka topics
ai.flowx.license.usage.v1 and ai.flowx.organization.events.v1 exist and the service can consume from themIngress and CORS
The License service is exposed externally on the admin host. Routing is configured through the FlowX Helm chart, which renders either a Kubernetes Ingress (default) or a Gateway API HTTPRoute per service. CORS handling lives in the service code; only the allowed-origins list is deployment-specific.Service route
| Host group | External path | Backend receives |
|---|---|---|
| admin | /license | / |
services.license.ingress.admin.path (or services.license.gateway.admin.paths) in the chart values.
CORS configuration
| Environment Variable | Description | Default Value |
|---|---|---|
APPLICATION_CORS_ALLOW_ORIGIN | Comma-separated list of origins allowed to call this service from the browser. Supports wildcard subdomains. Must include every Designer domain that issues browser requests against License. | - |
Authorization, Content-Type, Fx-Workspace-Id), and credential handling are baked into the service’s application.yaml with safe defaults. Override these only if you have a non-standard requirement.
For the complete route reference, Gateway API HTTPRoute configuration, and route customization, see the ingress configuration guide.
Troubleshooting
Database connection failures
Database connection failures
Symptoms: Service fails to start with database connection errors.Solutions:
- Verify the
licensedatabase exists in PostgreSQL - Check that the database user has appropriate permissions
- Ensure network connectivity between the pod and PostgreSQL service
- Verify the JDBC URL format is correct
SpiceDB connection failures
SpiceDB connection failures
Symptoms: Authorization errors or service fails to initialize CAS client.Solutions:
- Verify SpiceDB is running and reachable at the configured host and port
- Check that the SpiceDB token is correct
- Ensure network policies allow gRPC traffic to SpiceDB on port
50051 - Review pod logs for specific CAS client error messages
Kafka consumer issues
Kafka consumer issues
Symptoms: License usage events or organization events not being processed.Solutions:
- Verify Kafka bootstrap servers are reachable
- Check that the
ai.flowx.license.usage.v1andai.flowx.organization.events.v1topics exist - Ensure the service has consumer permissions on the topics
- Check consumer group offsets for lag
Service account authentication errors
Service account authentication errors
Symptoms: 401/403 errors when communicating with other FlowX services.Solutions:
- Verify the Keycloak service account
flowx-license-sais properly configured - Check that client secrets match between configuration and Keycloak
- Ensure the service account has the
view-usersclient role assigned - Verify the service account realm UUID is correct
Related resources
Redis Configuration
Complete Redis setup including Sentinel and Cluster modes
Access Management
Configure roles and access rights
SpiceDB Configuration
Fine-grained authorization setup
IAM Configuration
Identity and access management setup including License service account

