Automation query reference
Review list-step search, filters, sorting, windows, and relationship conditions.
A list step combines search, filters, sorting, and a result window in one query.
The system applies all settings when it selects rows for the workflow.
query:
search: "Kim"
where:
status: { in: [confirmed] }
starts_at: { lt: "now-30m" }
order: { column: starts_at, ascending: true }
limit: 25
offset: 0This example selects confirmed rows that contain Kim in searchable text. Their start time
must be at least 30 minutes old. The query returns up to 25 rows, oldest start time first.
Search
search finds a term in the text and translated names that a feature makes searchable.
You do not select the search columns. The available search columns depend on the feature.
query:
search: "VIP"Search combines with where, or, and embed. All configured parts apply.
Filters
Every condition in where must match. Two operators on one column both apply.
For example, { gte: "now", lt: "now+2h" } selects the next two hours.
| Operator | Meaning |
|---|---|
eq | Equal to the value |
neq | Not equal to the value |
gt, gte | Greater than or greater than or equal to the value |
lt, lte | Less than or less than or equal to the value |
like, ilike | Matches a text pattern. ilike ignores case. |
in | Matches a value in the list |
contains | Requires an array custom field to contain all values |
Each feature permits different filter columns and operators. Review its filterable columns in Feature reference.
Custom fields
Query a customer, reservation, or conversation custom field through custom.<key>. Forms,
tables, and automations use the same custom field key.
query:
where:
"custom.student_grade": { eq: middle }
"custom.interest_area": { contains: [coding] }Use like or ilike for text custom fields. Use eq, neq, or in for one option,
number, date, or switch value. Use contains for a multi-select value. Review available keys
and kinds in the current organization's Custom fields.
Alternative conditions
Inside one or item, only one condition must match. where and each separate or item must
still match together. You cannot use in inside or.
query:
where:
status: { eq: open }
or:
- last_message_at: { lt: "now-2d" }
updated_at: { lt: "now-7d" }Relative time
A time value can use now. It can also add or subtract minutes, hours, and days.
| Value | Meaning |
|---|---|
now | The run time |
now-30m | 30 minutes before the run |
now-2h | Two hours before the run |
now-2d | Two days before the run |
now+1h | One hour after the run |
The workflow resolves a relative time when the run starts.
Relationship conditions
embed uses a related record in the query. Set inner: true to require a matching related
record. This example selects open conversations for active customers.
query:
where:
status: { in: [open] }
last_message_at: { lt: "now-1d" }
embed:
customer_id:
inner: true
where:
status: { eq: active }A relationship condition uses only relationships provided by the feature. Related rows use the workflow runner's data scope and permissions.
Sort order
order.column selects the sort column. Omit ascending, or set it to true, for ascending
order. Set it to false for descending order.
query:
order:
column: created_at
ascending: falseUse only columns that the feature provides for queries. Keep the same order when you split results into several windows.
Result window
limit sets the maximum rows for one run. A list step selects up to 20 rows when you omit it.
The largest value you can set is 50.
offset sets the number of rows to skip and starts at 0. Set it with limit when you split results.
query:
order: { column: created_at, ascending: true }
limit: 25
offset: 25This example selects the second group of 25 rows in the same order. Do not drain a changing
result set with offset. Change processed rows so the next query excludes them.
Start a large query with a small limit. Review the run time and results before an increase.
A separate safety limit applies to step iteration.