Available starting with FlowX.AI 5.6.0The Webhook Gateway is a new microservice that exposes a public endpoint for receiving incoming webhook calls from external systems. It handles webhook event ingestion and routes them to process instances via Kafka.
Dependencies
Before setting up the Webhook Gateway, ensure you have the following dependencies in place:- PostgreSQL database for storing webhook registration data
- Kafka for publishing process start events
- Redis for caching
- Keycloak (or compatible OAuth2 provider) for authentication and authorization
- SpiceDB for fine-grained authorization
Infrastructure prerequisites
| Component | Description |
|---|---|
| PostgreSQL | Dedicated database named webhook_gateway |
| Kafka | Message broker for triggering process starts |
| Redis | Caching layer for improved performance |
| Keycloak | Identity provider for service authentication |
| SpiceDB | Authorization service for workspace validation |
Configuration
Authorization configuration
Set the following environment variables to connect to your identity management platform:| Environment Variable | Description | Default Value |
|---|---|---|
SECURITY_TYPE | Security type | oauth2 |
SECURITY_OAUTH2_BASE_SERVER_URL | Base URL of the OAuth2/OIDC server | |
SECURITY_OAUTH2_REALM | OAuth2 realm name | |
SECURITY_OAUTH2_CLIENT_CLIENT_ID | Client ID for token introspection | |
SECURITY_OAUTH2_CLIENT_CLIENT_SECRET | Client secret for token introspection | |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_ID | Service account client ID | flowx-webhook-gateway-sa |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_SECRET | Service account client secret | |
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_MAINAUTHPROVIDER_TOKEN_URI | Provider token URI | ${SECURITY_OAUTH2_BASE_SERVER_URL}/realms/${SECURITY_OAUTH2_REALM}/protocol/openid-connect/token |
The Webhook Gateway exposes
/webhooks/** as public (unauthenticated) paths for receiving incoming webhooks. The /api/** paths require a valid JWT token.PostgreSQL configuration
The Webhook Gateway uses its own dedicated PostgreSQL database for storing webhook registration data.| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_DATASOURCE_URL | JDBC connection URL for PostgreSQL | jdbc:postgresql://postgresql:5432/webhook_gateway |
SPRING_DATASOURCE_USERNAME | Database username | flowx |
SPRING_DATASOURCE_PASSWORD | Database password | - |
Redis configuration
Webhook Gateway uses Redis for caching. 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.
Kafka configuration
The Webhook Gateway is a producer-only service — it publishes messages to Kafka but does not consume from any topics.Core Kafka settings
| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_KAFKA_BOOTSTRAP_SERVERS | Address of the Kafka server(s) | localhost:9092 |
SPRING_KAFKA_SECURITY_PROTOCOL | Security protocol for Kafka connections | PLAINTEXT |
KAFKA_AUTHEXCEPTIONRETRYINTERVAL | Retry interval after authorization exceptions (seconds) | 10 |
OAuth authentication (when using SASL_PLAINTEXT)
| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_OAUTH_CLIENT_ID | OAuth client ID | kafka |
KAFKA_OAUTH_CLIENT_SECRET | OAuth client secret | kafka-secret |
KAFKA_OAUTH_TOKEN_ENDPOINT_URI | OAuth token endpoint | kafka.auth.localhost |
When using the
kafka-auth profile, the security protocol will automatically be set to SASL_PLAINTEXT and the SASL mechanism will be set to OAUTHBEARER.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 Webhook Gateway publishes to the following Kafka topic to trigger process starts from incoming webhook events:| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_TOPIC_PROCESS_START_OUT | Topic for triggering process starts from webhook events | ai.flowx.core.trigger.start-for-event.process.v1 |
CAS lib configuration (SpiceDB)
| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_LIB_CASCLIENT_SPICEDB_HOST | SpiceDB hostname | spicedb |
FLOWX_LIB_CASCLIENT_SPICEDB_PORT | SpiceDB gRPC port | 50051 |
FLOWX_LIB_CASCLIENT_SPICEDB_TOKEN | SpiceDB authentication token | - |
Service communication
The Webhook Gateway communicates with the following FlowX services:| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_LIB_SECURITY_SERVICES_ORGANIZATIONMANAGER_BASEURL | Organization Manager base URL | http://organization-manager:80 |
FLOWX_LIB_CASCLIENT_SERVICES_AUTHORIZATIONSYSTEM_BASEURL | Authorization System base URL | http://authorization-system:80 |
Logging configuration
| Environment Variable | Description | Default Value |
|---|---|---|
LOGGING_LEVEL_ROOT | Root logging level | INFO |
LOGGING_LEVEL_APP | Application-specific log level | INFO |
Secrets management
The Webhook Gateway 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_CLIENTSECRET | Keycloak service account secret |
FLOWX_LIB_CASCLIENT_SPICEDB_TOKEN | SpiceDB authentication token |
KAFKA_OAUTH_CLIENT_SECRET | Kafka OAuth client secret (if using OAuth) |
Deployment
Helm values example
Below is an example Helm values configuration for deploying the Webhook Gateway:Unlike most FlowX services, the Webhook Gateway requires ingress to be enabled because it receives incoming HTTP requests from external systems on the
/webhooks path.Network policies
The Webhook Gateway requires network access to the following services:| Service | Purpose | Pod Label |
|---|---|---|
| Kafka | Message broker communication | flowx.ai/egress-s-kafka |
| PostgreSQL | Webhook registration storage | flowx.ai/egress-s-postgresql |
| Redis | Caching | flowx.ai/egress-s-redis |
| Keycloak | Authentication | flowx.ai/egress-s-keycloak |
| SpiceDB | Authorization | flowx.ai/egress-s-spicedb |
| Organization Manager | Organization context resolution | flowx.ai/egress-s-organization-manager |
| Authorization System | Access control | flowx.ai/egress-s-authorization-system |
Monitoring
The Webhook Gateway 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 Webhook Gateway pod is running and healthy:
kubectl get pods -l app=webhook-gatewayThe health endpoint returns HTTP 200:
curl http://webhook-gateway: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
The
/webhooks ingress path is accessible from external systemsTroubleshooting
Database connection failures
Database connection failures
Symptoms: Service fails to start with database connection errors.Solutions:
- Verify the
webhook_gatewaydatabase 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 publishing failures
Kafka publishing failures
Symptoms: Webhook events not triggering process starts.Solutions:
- Verify Kafka bootstrap servers are reachable
- Check that the
ai.flowx.core.trigger.start-for-event.process.v1topic exists - Ensure the service has producer permissions on the topic
- Review pod logs for Kafka producer errors
Webhook endpoint not reachable
Webhook endpoint not reachable
Symptoms: External systems cannot reach the webhook URL.Solutions:
- Verify ingress is enabled and the
/webhookspath is configured - Check that network policies allow inbound traffic to the Webhook Gateway
- Ensure DNS resolves correctly for the webhook URL
- Verify the service is listening on port
8080
Service account authentication errors
Service account authentication errors
Symptoms: 401/403 errors when communicating with other FlowX services.Solutions:
- Verify the Keycloak service account is properly configured
- Check that client secrets match between configuration and Keycloak
- Ensure the service account has required roles assigned
- Verify
SECURITY_TYPEis set tooauth2
Related resources
Redis Configuration
Complete Redis setup including Sentinel and Cluster modes
SpiceDB Configuration
Fine-grained authorization setup
Kafka Authentication
Configure Kafka security and authentication
IAM Configuration
Identity and access management setup

