Automation Conditions
Conditions are optional filters evaluated after a trigger fires. All conditions must pass for the actions to run. If any condition fails, the automation silently exits — no error is logged.
Schema
CREATE TABLE automation_conditions (
id INT AUTO_INCREMENT PRIMARY KEY,
id_automation INT NOT NULL,
field VARCHAR(100) NOT NULL,
operator VARCHAR(30) NOT NULL,
value TEXT,
sort_order INT DEFAULT 0
);
Operators
| operator | Description |
|---|---|
equals |
Field exactly matches value |
not_equals |
Field does not match value |
contains |
Field contains the string (case-insensitive) |
not_contains |
Field does not contain the string |
starts_with |
Field starts with the string |
is_empty |
Field is NULL or empty string |
is_not_empty |
Field has a non-null, non-empty value |
greater_than |
Numeric field > value |
less_than |
Numeric field < value |
in_list |
Field matches any value in comma-separated list |
Field references
Fields are dot-notated references to the trigger record:
| Field | Refers to |
|---|---|
contact.status |
Status field of the triggering contact |
contact.lead_score |
Lead score |
contact.tags |
Tag list (use contains operator) |
deal.stage_id |
Current stage of the triggering deal |
deal.value |
Deal value |
company.name |
Company name on the contact |
Condition logic
All conditions are evaluated with AND logic — every condition must pass. OR logic is not currently supported natively; work around it by creating two separate automations with the same actions.
Example
Fire only when a contact's lead score exceeds 80 and they don't already have the "qualified" tag:
INSERT INTO automation_conditions (id_automation, field, operator, value, sort_order)
VALUES
(42, 'contact.lead_score', 'greater_than', '80', 1),
(42, 'contact.tags', 'not_contains', 'qualified', 2);