Ruby SDKFeature Clients

Workflows ClientRuby SDK

Workflows client for managing workflow definitions within Hatchet.

Note that workflows are the declaration, not the individual runs. If you're looking for runs, use the Runs client instead.

workflow = hatchet.workflows.get("workflow-id")
workflows = hatchet.workflows.list(workflow_name: "my-workflow", limit: 10)

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

Methods:

NameDescription
getGet a workflow by its ID.
listList all workflows in the tenant matching optional filters.
get_versionGet a workflow version by the workflow ID and an optional version.
deletePermanently delete a workflow.
pausePause a workflow.
unpauseUnpause a workflow.

Functions

get

Get a workflow by its ID.

workflow = hatchet.workflows.get("workflow-123")

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to retrieve.required

Returns:

TypeDescription
ObjectThe workflow details.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

list

List all workflows in the tenant matching optional filters.

workflows = hatchet.workflows.list(workflow_name: "my-workflow", limit: 10, offset: 0)

Parameters:

NameTypeDescriptionDefault
workflow_nameString | nilThe name of the workflow to filter by (namespace will be applied)nil
limitInteger | nilThe maximum number of items to return.nil
offsetInteger | nilThe offset to start the list from.nil

Returns:

TypeDescription
ObjectA list of workflows.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

get_version

Get a workflow version by the workflow ID and an optional version.

version = hatchet.workflows.get_version("workflow-123", version: "v2")

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to retrieve the version for.required
versionString | nilThe version to retrieve. If nil, the latest version is returned.nil

Returns:

TypeDescription
ObjectThe workflow version.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

delete

Permanently delete a workflow.

DANGEROUS: This will delete a workflow and all of its data.

hatchet.workflows.delete("workflow-123")

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to delete.required

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

pause

Pause a workflow. While paused, new runs of the workflow are queued but not started.

hatchet.workflows.pause("workflow-123", queue_ttl: 3600)

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to pause.required
queue_ttlInteger | StringHow long runs stay queued while the workflow is paused before they are dropped, in seconds or as a duration string (e.g. "1h30m")required
paused_workflow_cron_run_queue_behaviorStringThe behavior of cron runs triggered while the workflow is paused ("QUEUE" or "DROP")HatchetSdkRest::WorkflowPauseScheduledCronRunQueueBehavior::QUEUE
paused_workflow_scheduled_run_queue_behaviorStringThe behavior of scheduled runs triggered while the workflow is paused ("QUEUE" or "DROP")HatchetSdkRest::WorkflowPauseScheduledCronRunQueueBehavior::QUEUE

Returns:

TypeDescription
HatchetSdkRest::WorkflowThe updated workflow.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

unpause

Unpause a workflow.

hatchet.workflows.unpause("workflow-123")

Parameters:

NameTypeDescriptionDefault
workflow_idStringThe ID of the workflow to unpause.required

Returns:

TypeDescription
HatchetSdkRest::WorkflowThe updated workflow.

Raises:

TypeDescription
HatchetSdkRest::ApiErrorIf the API request fails.

Last updated on October 14, 2026

On this page