Title: feat: add conditional routing for webhooks based on event properties
Labels: enhancement feature
Complexity: medium
Branch: feat/webhook-conditional-routing
Problem Context
Subscribers want to filter webhook deliveries by event properties (e.g., "only send if amount > 1000 XLM"). Without this, they receive all events and must filter client-side, wasting bandwidth and latency.
Scope
Included:
- Condition DSL: JSON-based rules for event filtering
- Operators:
eq, gt, gte, lt, lte, in, contains, regex
- Nested conditions: AND/OR/NOT logic
- UI for building conditions
- Dry-run: test condition against sample events
Not included:
- Complex CEP (event stream processing)
Implementation Guidelines
Model updates:
class WebhookSubscription(models.Model):
# ... existing fields ...
filter_condition = models.JSONField(blank=True, null=True)
Condition DSL example:
{
"op": "and",
"conditions": [
{ "field": "decodedPayload.amount", "op": "gte", "value": 1000 },
{ "field": "event_type", "op": "eq", "value": "transfer" }
]
}
Constraints:
- Condition evaluation must be <1ms per event
- Conditions stored as JSON, not in code
Acceptance Criteria
Title:
feat: add conditional routing for webhooks based on event propertiesLabels:
enhancementfeatureComplexity:
mediumBranch:
feat/webhook-conditional-routingProblem Context
Subscribers want to filter webhook deliveries by event properties (e.g., "only send if amount > 1000 XLM"). Without this, they receive all events and must filter client-side, wasting bandwidth and latency.
Scope
Included:
eq,gt,gte,lt,lte,in,contains,regexNot included:
Implementation Guidelines
Model updates:
Condition DSL example:
{ "op": "and", "conditions": [ { "field": "decodedPayload.amount", "op": "gte", "value": 1000 }, { "field": "event_type", "op": "eq", "value": "transfer" } ] }Constraints:
Acceptance Criteria