Filter when an automation or AI agent behavior actually executes
Overview
A condition is an optional filter attached to an automation or AI agent behavior. After the trigger event fires, the system evaluates the condition against the card's current field values. If the condition passes, the automation runs; if it fails, execution is skipped.
Conditions use the same structure in both automations (createAutomation / updateAutomation) and AI agent behaviors (createAiAgent / updateAiAgent).
Structure
A condition object has two fields:
| Field | Type | Description |
|---|---|---|
expressions | array of objects | The individual field checks. Each expression evaluates one field against one criterion. |
expressions_structure | array of arrays | Defines how expressions are combined with AND / OR logic. |
Expression fields
| Field | Type | Description |
|---|---|---|
structure_id | integer | Unique identifier for this expression within the condition. Start from 0 and increment. Returned as a string in responses. |
field_address | string | The internal_id of the field to evaluate. See Get Resource IDs → Field internal_id. |
operation | string | Comparison to apply. See Available operations below. |
value | string | The value to compare against. Format depends on the field type. |
AND / OR logic
expressions_structure is an array of arrays. Each inner array groups expressions that must all be true (AND). Different inner arrays are connected by OR.
"expressions_structure": [
[0, 1],
[2]
]
The above reads as: (expression 0 AND expression 1) OR expression 2.
Common patterns:
expressions_structure | Logic |
|---|---|
[[0]] | Only expression 0 |
[[0, 1]] | Expression 0 AND expression 1 |
[[0], [1]] | Expression 0 OR expression 1 |
[[0, 1], [2]] | (Expression 0 AND 1) OR expression 2 |
[[0], [1, 2]] | Expression 0 OR (expression 1 AND 2) |
Available operations
Text / string fields
| Operation | Description |
|---|---|
equals | Exact match |
not_equals | Not equal to |
present | Field has any value |
blank | Field is empty |
string_contains | Contains substring |
string_not_contains | Does not contain substring |
Number fields
| Operation | Description |
|---|---|
equals | Exact numeric match |
not_equals | Not equal to |
number_greater_than | Greater than |
number_less_than | Less than |
present | Field has any value |
blank | Field is empty |
Date fields
| Operation | Description |
|---|---|
date_is_today | Today's date |
date_is_yesterday | Yesterday's date |
date_in_current_week | This week |
date_in_last_week | Last week |
date_in_current_month | This month |
date_in_last_month | Last month |
date_in_current_year | This year |
date_in_last_year | Last year |
date_is | Specific date — value: "YYYY-MM-DD" |
date_is_after | After a specific date |
date_is_before | Before a specific date |
Examples
Single condition
Run only when the Priority field equals "High":
"condition": {
"expressions": [
{
"structure_id": 0,
"field_address": "132",
"operation": "equals",
"value": "High"
}
],
"expressions_structure": [[0]]
}
Multiple AND conditions
Run only when Priority is "High" and Status is "Open":
"condition": {
"expressions": [
{
"structure_id": 0,
"field_address": "132",
"operation": "equals",
"value": "High"
},
{
"structure_id": 1,
"field_address": "145",
"operation": "equals",
"value": "Open"
}
],
"expressions_structure": [[0, 1]]
}
OR logic
Run when Priority is "High" or "Critical":
"condition": {
"expressions": [
{
"structure_id": 0,
"field_address": "132",
"operation": "equals",
"value": "High"
},
{
"structure_id": 1,
"field_address": "132",
"operation": "equals",
"value": "Critical"
}
],
"expressions_structure": [[0], [1]]
}
Complex logic
Run when (Priority is "High" and Status is "Open") or Due Date is today:
"condition": {
"expressions": [
{
"structure_id": 0,
"field_address": "132",
"operation": "equals",
"value": "High"
},
{
"structure_id": 1,
"field_address": "145",
"operation": "equals",
"value": "Open"
},
{
"structure_id": 2,
"field_address": "156",
"operation": "date_is_today",
"value": ""
}
],
"expressions_structure": [[0, 1], [2]]
}
No condition (always run)
Two equivalent formats are accepted:
Empty arrays — used in AI agent behaviors:
"condition": {
"expressions": [],
"expressions_structure": []
}
Placeholder expression — used in standalone automations:
"condition": {
"expressions": [
{
"structure_id": 0,
"field_address": "",
"operation": "",
"value": ""
}
],
"expressions_structure": [[0]]
}
Both mean "no filter — always run when the event fires."
Retrieving conditions from existing automations
{
automations(repoId: "306422123", organizationId: "321") {
edges {
node {
id
name
condition {
expressions_structure
expressions {
structure_id
field_address
operation
value
}
}
}
}
}
}
Notes
structure_idmust be unique within a condition. Use sequential integers starting from0.field_addressmust match an existing field'sinternal_idin the pipe.- Use the correct operation for the field type — applying a number or date operation to a text field will be accepted but will not match as expected at runtime.
- Value format: plain strings for text, numeric strings (
"123","45.67") for numbers, ISO date strings ("2024-01-15") for specific date operations. - For connector fields,
valueshould be the connected card's ID.
