Ruby SDKFeature Clients

Filters Client

Filters client for interacting with Hatchet's filters API.

This class provides a high-level interface for creating, retrieving, listing, updating, and deleting filters in the Hatchet system.

filters = hatchet.filters.list(limit: 10, workflow_ids: ["wf-1"])
filter = hatchet.filters.create(
  workflow_id: "wf-1",
  expression: 'input.priority > 5',
  scope: "high-priority"
)

It is available on the main client as hatchet.filters.

Methods:

NameDescription
listList filters for the current tenant.
getGet a filter by its ID.
createCreate a new filter.
deleteDelete a filter by its ID.
updateUpdate a filter by its ID.

Functions

list

List filters for the current tenant.

filters = hatchet.filters.list(limit: 10, workflow_ids: ["wf-1"])

Parameters:

NameTypeDescriptionDefault
limitInteger | nilThe maximum number of filters to return.nil
offsetInteger | nilThe number of filters to skip.nil
workflow_idsArray<String> | nilA list of workflow IDs to filter by.nil
scopesArray<String> | nilA list of scopes to filter by.nil

Returns:

TypeDescription
ObjectA list of filters matching the specified criteria.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

get

Get a filter by its ID.

filter = hatchet.filters.get("filter-123")

Parameters:

NameTypeDescriptionDefault
filter_idStringThe ID of the filter to retrieve.required

Returns:

TypeDescription
ObjectThe filter details.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

create

Create a new filter.

filter = hatchet.filters.create(
  workflow_id: "wf-1",
  expression: 'input.value > 10',
  scope: "my-scope",
  payload: { threshold: 10 }
)

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to associate with the filter.required
expressionStringThe CEL expression to evaluate for the filter.required
scopeStringThe scope for the filter.required
payloadHash | nilThe payload to send with the filter.nil

Returns:

TypeDescription
ObjectThe created filter.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

delete

Delete a filter by its ID.

hatchet.filters.delete("filter-123")

Parameters:

NameTypeDescriptionDefault
filter_idStringThe ID of the filter to delete.required

Returns:

TypeDescription
ObjectThe deleted filter.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

update

Update a filter by its ID.

hatchet.filters.update("filter-123", { expression: 'input.value > 20' })

Parameters:

NameTypeDescriptionDefault
filter_idStringThe ID of the filter to update.required
updatesHashThe updates to apply to the filter.required

Returns:

TypeDescription
ObjectThe updated filter.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

Last updated on August 24, 2026

On this page