Skip to main content

Count open cases by priority

core.cases.aggregate_cases filters cases, splits them into groups, and returns one object per group. Omit aggs to count cases:
Groups sort by the first calculation, highest first. Read a group with a JSONPath filter, such as ${{ ACTIONS.open_by_priority.result.groups[?(@.priority == "high")].count }}.

Count all matching cases

Pass group_by: [] to get one total. Combine conditions with and, or, and not:
Priority and severity compare by rank, so gte: high matches high and critical. Status supports equality and list operators only.

Count cases per day in your timezone

Date and time fields need a bucket: hour, day, week, or month. Set timezone to bucket by local days. Results always hold UTC timestamps:
2026-08-31T04:00:00Z is midnight on August 31 in New York, so a case created at 2026-09-01T02:00:00Z lands in that group. Date buckets sort oldest first.

Top values of a custom field

Prefix custom case fields with fields.. Use order_by with an output name, limit for the top N, and min_count to drop small groups:
truncated: true means more groups matched than limit returned. There is no cursor, so raise limit or narrow filters to see the rest.

Sum and median table columns per group

core.table.aggregate_rows takes the same group_by, aggs, and filters shape, plus a table name. Without an alias, each output is named function_field:
ne and not_in also exclude rows where the column is empty. Add {field: disposition, op: is_null} inside an or to keep them. Sums, means, and medians return floats.

Count distinct values in a table

Use count_distinct to count unique non-null values per group:
Table text comparisons with eq, ne, in, and not_in are case-sensitive. Use contains or starts_with for case-insensitive matches.

Search table rows by meaning

core.table.search finds rows by meaning in the TEXT columns that have vector search enabled. Literal keyword search stays in core.table.search_rows:
score is cosine similarity, so compare it within one search rather than against a fixed threshold. index reports how many rows are indexed. The action fails while the index is still building; set allow_partial: true to search only indexed rows. To read the next page, pass next_cursor as cursor within five minutes and keep the other inputs unchanged. Vector search requires an Enterprise plan and an LLM provider with an embedding model.

Fetch full rows for search results

Search results hold row IDs and excerpts. Look up each full row by its id:

Give an agent these actions as tools

List the actions under actions so the agent can filter, group, and search on its own:
Agents read the same input schemas, so name the case fields, table names, and columns in instructions to save tool calls.
  • See Cases for every core.cases.aggregate_cases input, field type, and filter operator.
  • See Lookups for every core.table.aggregate_rows input and the operators each column type supports.
  • See Tables to enable vector search on a column and check index status.
  • See AI agent for agent tools, approvals, and output types.
  • See JSONPath for the filter syntax used to read groups.