Integrating KAELUM with n8n Workflows
Complete guide to integrating KAELUM's K.A.T.E. capabilities with n8n automation workflows for powerful merchant and user operations.
Integrating KAELUM with n8n
Overview
KAELUM provides a powerful webhook endpoint that allows n8n workflows to trigger K.A.T.E. operations, enabling advanced automation and workflow orchestration.
Authentication
All n8n webhook requests must include an Authorization header:
Authorization: Bearer YOUR_N8N_WEBHOOK_KEY
Contact admin to obtain your N8N_WEBHOOK_KEY.
Webhook Endpoint
POST https://kaelum.app/functions/n8nWebhook
Supported Operations
1. Merchant Optimization
Generate discount optimization recommendations for a merchant.
Request:
{
"operation": "merchant_optimization",
"data": {
"merchant_id": "user_abc123"
}
}
Response:
{
"ok": true,
"recommendation": {
"recommended_discount_pct": 9,
"confidence_score": 0.87,
"rationale": "...",
"predicted_impact": {
"revenue_increase_pct": 23,
"transaction_increase_pct": 15
}
}
}
2. User Insights
Generate personalized spending insights for a user.
Request:
{
"operation": "user_insights",
"data": {
"user_id": "user_xyz789"
}
}
3. Batch Operations
Process multiple merchants or users in one request.
Request:
{
"operation": "batch_merchant_optimization",
"data": {
"merchant_ids": ["user_1", "user_2", "user_3"]
}
}
Example n8n Workflow
Weekly Merchant Optimization
- Schedule Trigger: Every Monday at 9 AM
- HTTP Request Node: GET all active merchants
- Split In Batches: Process 10 merchants at a time
- HTTP Request Node: Call KAELUM webhook for each batch
- Email Node: Send summary report to admin
Real-Time Fraud Detection
- Webhook Trigger: New transaction created
- HTTP Request Node: Call KAELUM fraud_check
- IF Node: Check if risk_score > 0.7
- Email Node: Alert admin if high risk
- Update Record: Flag transaction for review
Rate Limits
- Standard: 100 requests/hour
- Batch operations: 10 requests/hour
- Contact admin for higher limits
Error Handling
All errors return appropriate HTTP status codes:
- 400: Bad Request (missing/invalid parameters)
- 401: Unauthorized (invalid API key)
- 500: Server Error
Best Practices
- Batch operations for processing multiple entities
- Error handling in your workflows
- Exponential backoff for retries
- Monitor usage to stay within rate limits
- Test with small batches before scaling