Conditions
Destinations support condition expressions that determine when they should fire. Conditions use a safe expression language (based on simpleeval) that evaluates to true or false.
Available Variables
Section titled “Available Variables”| Variable | Type | Description |
|---|---|---|
event_type | string | The raw event type from the provider |
payload | dict | The full original webhook payload |
provider | string | The provider name (e.g., stripe) |
account_slug | string | The account slug |
delivery_failed | bool | true if primary delivery exhausted all retries |
Expression Syntax
Section titled “Expression Syntax”Conditions support standard Python-like expressions:
Equality
Section titled “Equality”event_type == "charge.failed"String Methods
Section titled “String Methods”event_type.startswith("payment.")"invoice" in event_typeLogical Operators
Section titled “Logical Operators”provider == "stripe" and event_type == "charge.failed"delivery_failed or event_type == "charge.disputed"Payload Access
Section titled “Payload Access”payload.get("amount", 0) > 10000payload.get("status") == "failed"Combined Expressions
Section titled “Combined Expressions”event_type.startswith("payment.") and payload.get("amount", 0) > 10000Common Patterns
Section titled “Common Patterns”Alert on delivery failure
Section titled “Alert on delivery failure”delivery_failedAlert on specific event types
Section titled “Alert on specific event types”event_type == "charge.failed"Alert on high-value events
Section titled “Alert on high-value events”event_type == "charge.succeeded" and payload.get("amount", 0) > 50000Alert for a specific provider
Section titled “Alert for a specific provider”provider == "stripe" and "invoice" in event_typeAlert on failure for specific events
Section titled “Alert on failure for specific events”delivery_failed and event_type.startswith("payment.")No Condition
Section titled “No Condition”If no condition is set on a destination, it fires for every event after primary delivery succeeds (or after retries are exhausted).
Safety
Section titled “Safety”Condition expressions are evaluated in a sandboxed environment. Only the variables listed above are available — no access to the filesystem, network, or Python builtins. Invalid expressions are logged and the destination is skipped.