LaneyGuide
Automations

Automation query reference

Review list-step search, filters, sorting, windows, and relationship conditions.

ReferenceVerified Aug 7, 2026Owner Laney Product

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: 0

This 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 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.

OperatorMeaning
eqEqual to the value
neqNot equal to the value
gt, gteGreater than or greater than or equal to the value
lt, lteLess than or less than or equal to the value
like, ilikeMatches a text pattern. ilike ignores case.
inMatches a value in the list
containsRequires 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.

ValueMeaning
nowThe run time
now-30m30 minutes before the run
now-2hTwo hours before the run
now-2dTwo days before the run
now+1hOne 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: false

Use 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: 25

This 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.

On this page