Restrict when your destination will be invoked.
Conditions enable a more complex configuration of webhook Subscriptions to be configured. Since you can have multiple Subscriptions for the same event per Account its possible to use conditions to route some events to one system, based on an attribute value, and others to different system.
When defining a condition you can only do 'static' comparisons of scalar values, array values which results in an 'Any Of' check or a scalar value can be prefixed with a ! to reverse it. When our platform is determining if a Subscription should be utilized we will consult this map of attributes and make sure each value is true. If it is not, then no invocation is attempted.
Example
Given the following Subscription configuration.
{
id: 'subscription-id',
destination: 'https://some.domain/you/have',
type: 'business_processes.update',
conditions: {
status: 'failed'
}
}
The destination will only be invoked when a business_process
has been updated, and the status of the Business Process is equal to 'failed'. These comparisons are case sensitive, so if you set a value of 'FAILED' this Subscription will never be invoked.