Conditions

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:

FieldTypeDescription
expressionsarray of objectsThe individual field checks. Each expression evaluates one field against one criterion.
expressions_structurearray of arraysDefines how expressions are combined with AND / OR logic.

Expression fields

FieldTypeDescription
structure_idintegerUnique identifier for this expression within the condition. Start from 0 and increment. Returned as a string in responses.
field_addressstringThe internal_id of the field to evaluate. See Get Resource IDs → Field internal_id.
operationstringComparison to apply. See Available operations below.
valuestringThe 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_structureLogic
[[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

OperationDescription
equalsExact match
not_equalsNot equal to
presentField has any value
blankField is empty
string_containsContains substring
string_not_containsDoes not contain substring

Number fields

OperationDescription
equalsExact numeric match
not_equalsNot equal to
number_greater_thanGreater than
number_less_thanLess than
presentField has any value
blankField is empty

Date fields

OperationDescription
date_is_todayToday's date
date_is_yesterdayYesterday's date
date_in_current_weekThis week
date_in_last_weekLast week
date_in_current_monthThis month
date_in_last_monthLast month
date_in_current_yearThis year
date_in_last_yearLast year
date_isSpecific date — value: "YYYY-MM-DD"
date_is_afterAfter a specific date
date_is_beforeBefore 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_id must be unique within a condition. Use sequential integers starting from 0.
  • field_address must match an existing field's internal_id in 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, value should be the connected card's ID.

See also