Ruby SDKFeature Clients

Scheduled Client

Scheduled client for managing scheduled workflows within Hatchet.

This class provides a high-level interface for creating, deleting, updating, bulk operations, listing, and retrieving scheduled workflow runs.

scheduled = hatchet.scheduled.create(
  workflow_name: "my-workflow",
  trigger_at: Time.now + 3600,
  input: { key: "value" },
  additional_metadata: { source: "api" }
)

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

Methods:

NameDescription
createCreate a new scheduled workflow run.
deleteDelete a scheduled workflow run by its ID.
updateReschedule a scheduled workflow run by its ID.
bulk_deleteBulk delete scheduled workflow runs.
bulk_updateBulk reschedule scheduled workflow runs.
listList scheduled workflows based on provided filters.
getRetrieve a specific scheduled workflow by ID.

Functions

create

Create a new scheduled workflow run.

IMPORTANT: It's preferable to use Workflow.run to trigger workflows if possible. This method is intended to be an escape hatch.

scheduled = hatchet.scheduled.create(
  workflow_name: "my-workflow",
  trigger_at: Time.now + 3600,
  input: { key: "value" },
  additional_metadata: { source: "api" }
)

Parameters:

NameTypeDescriptionDefault
workflow_nameStringThe name of the workflow to schedule (namespace will be applied)required
trigger_atTimeThe datetime when the run should be triggered.required
inputHashThe input data for the scheduled workflow.{}
additional_metadataHashAdditional metadata associated with the future run.{}

Returns:

TypeDescription
ObjectThe created scheduled workflow instance.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

delete

Delete a scheduled workflow run by its ID.

hatchet.scheduled.delete("scheduled-123")

Parameters:

NameTypeDescriptionDefault
scheduled_idStringThe ID of the scheduled workflow run to delete.required

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

update

Reschedule a scheduled workflow run by its ID.

Note: the server may reject rescheduling if the scheduled run has already triggered, or if it was created via code definition (not via API).

hatchet.scheduled.update("scheduled-123", trigger_at: Time.now + 7200)

Parameters:

NameTypeDescriptionDefault
scheduled_idStringThe ID of the scheduled workflow run to reschedule.required
trigger_atTimeThe new datetime when the run should be triggered.required

Returns:

TypeDescription
ObjectThe updated scheduled workflow instance.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

bulk_delete

Bulk delete scheduled workflow runs.

Provide either scheduled_ids (explicit list) or one or more filter fields.

Parameters:

NameTypeDescriptionDefault
scheduled_idsArray<String> | nilExplicit list of scheduled workflow run IDs to delete.nil
workflow_idString | nilFilter by workflow ID.nil
parent_workflow_run_idString | nilFilter by parent workflow run ID.nil
parent_step_run_idString | nilFilter by parent step run ID.nil
statusesArray<String> | nilFilter by scheduled run statuses (warning: may not be supported)nil
additional_metadataHash | nilFilter by additional metadata key/value pairs.nil

Returns:

TypeDescription
ObjectThe bulk delete response containing deleted IDs and per-item errors.

Raises:

TypeDescription
ArgumentErrorIf neither scheduled_ids nor any filter field is provided.
HatchetSdkRest::ApiErrorIf the API request fails.

bulk_update

Bulk reschedule scheduled workflow runs.

hatchet.scheduled.bulk_update([
  { id: "scheduled-1", trigger_at: Time.now + 3600 },
  { id: "scheduled-2", trigger_at: Time.now + 7200 }
])

Parameters:

NameTypeDescriptionDefault
updatesArray<Hash>Array of hashes with :id and :trigger_at keys.required

Returns:

TypeDescription
ObjectThe bulk update response containing updated IDs and per-item errors.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

list

List scheduled workflows based on provided filters.

scheduled = hatchet.scheduled.list(limit: 10, workflow_id: "wf-1")

Parameters:

NameTypeDescriptionDefault
offsetInteger | nilThe offset to use in pagination.nil
limitInteger | nilThe maximum number of scheduled workflows to return.nil
workflow_idString | nilThe ID of the workflow to filter by.nil
parent_workflow_run_idString | nilThe ID of the parent workflow run to filter by.nil
statusesArray<String> | nilA list of statuses to filter by.nil
additional_metadataHash | nilAdditional metadata to filter by.nil
order_by_fieldString | nilThe field to order the results by.nil
order_by_directionString | nilThe direction to order the results by.nil

Returns:

TypeDescription
ObjectA list of scheduled workflows matching the provided filters.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

get

Retrieve a specific scheduled workflow by ID.

scheduled = hatchet.scheduled.get("scheduled-123")

Parameters:

NameTypeDescriptionDefault
scheduled_idStringThe scheduled workflow trigger ID to retrieve.required

Returns:

TypeDescription
ObjectThe requested scheduled workflow instance.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

Last updated on August 24, 2026

On this page