We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.

SDK ReferencePython SDKFeature ClientsRuns

Runs Client

Bases: BaseRestClient

The runs client is a client for interacting with task and workflow runs within Hatchet.

Methods:

NameDescription
getGet workflow run details for a given workflow run ID.
aio_getGet workflow run details for a given workflow run ID.
listList task runs according to a set of filters.
aio_listList task runs according to a set of filters.
createTrigger a new workflow run.
aio_createTrigger a new workflow run.
replayReplay a task or workflow run.
aio_replayReplay a task or workflow run.
bulk_replayReplay task or workflow runs in bulk, according to a set of filters.
aio_bulk_replayReplay task or workflow runs in bulk, according to a set of filters.
cancelCancel a task or workflow run.
aio_cancelCancel a task or workflow run.
bulk_cancelCancel task or workflow runs in bulk, according to a set of filters.
aio_bulk_cancelCancel task or workflow runs in bulk, according to a set of filters.
get_resultGet the result of a workflow run by its external ID.
aio_get_resultGet the result of a workflow run by its external ID.
get_run_refGet a reference to a workflow run.

Functions

get

Get workflow run details for a given workflow run ID.

Parameters:

NameTypeDescriptionDefault
workflow_run_idstrThe ID of the workflow run to retrieve details for.required

Returns:

TypeDescription
V1WorkflowRunDetailsWorkflow run details for the specified workflow run ID.

aio_get

Get workflow run details for a given workflow run ID.

Parameters:

NameTypeDescriptionDefault
workflow_run_idstrThe ID of the workflow run to retrieve details for.required

Returns:

TypeDescription
V1WorkflowRunDetailsWorkflow run details for the specified workflow run ID.

list

List task runs according to a set of filters.

Parameters:

NameTypeDescriptionDefault
sincedatetimeThe start time for filtering task runs.now() - timedelta(hours=1)
only_tasksboolWhether to only list task runs.False
offsetint | NoneThe offset for pagination.None
limitint | NoneThe maximum number of task runs to return.None
statuseslist[V1TaskStatus] | NoneThe statuses to filter task runs by.None
untildatetime | NoneThe end time for filtering task runs.None
additional_metadatadict[str, str] | NoneAdditional metadata to filter task runs by.None
workflow_idslist[str] | NoneThe workflow IDs to filter task runs by.None
worker_idstr | NoneThe worker ID to filter task runs by.None
parent_task_external_idstr | NoneThe parent task external ID to filter task runs by.None

Returns:

TypeDescription
V1TaskSummaryListA list of task runs matching the specified filters.

aio_list

List task runs according to a set of filters.

Parameters:

NameTypeDescriptionDefault
sincedatetimeThe start time for filtering task runs.now() - timedelta(hours=1)
only_tasksboolWhether to only list task runs.False
offsetint | NoneThe offset for pagination.None
limitint | NoneThe maximum number of task runs to return.None
statuseslist[V1TaskStatus] | NoneThe statuses to filter task runs by.None
untildatetime | NoneThe end time for filtering task runs.None
additional_metadatadict[str, str] | NoneAdditional metadata to filter task runs by.None
workflow_idslist[str] | NoneThe workflow IDs to filter task runs by.None
worker_idstr | NoneThe worker ID to filter task runs by.None
parent_task_external_idstr | NoneThe parent task external ID to filter task runs by.None

Returns:

TypeDescription
V1TaskSummaryListA list of task runs matching the specified filters.

create

Trigger a new workflow run.

IMPORTANT: It’s preferable to use Workflow.run (and similar) to trigger workflows if possible. This method is intended to be an escape hatch. For more details, see the documentation.

Parameters:

NameTypeDescriptionDefault
workflow_namestrThe name of the workflow to trigger.required
inputJSONSerializableMappingThe input data for the workflow run.required
additional_metadataJSONSerializableMappingAdditional metadata associated with the workflow run.{}
priorityint | NoneThe priority of the workflow run.None

Returns:

TypeDescription
V1WorkflowRunDetailsThe details of the triggered workflow run.

aio_create

Trigger a new workflow run.

IMPORTANT: It’s preferable to use Workflow.run (and similar) to trigger workflows if possible. This method is intended to be an escape hatch. For more details, see the documentation.

Parameters:

NameTypeDescriptionDefault
workflow_namestrThe name of the workflow to trigger.required
inputJSONSerializableMappingThe input data for the workflow run.required
additional_metadataJSONSerializableMappingAdditional metadata associated with the workflow run.{}
priorityint | NoneThe priority of the workflow run.None

Returns:

TypeDescription
V1WorkflowRunDetailsThe details of the triggered workflow run.

replay

Replay a task or workflow run.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the task or workflow run to replay.required

Returns:

TypeDescription
NoneNone

aio_replay

Replay a task or workflow run.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the task or workflow run to replay.required

Returns:

TypeDescription
NoneNone

bulk_replay

Replay task or workflow runs in bulk, according to a set of filters.

Parameters:

NameTypeDescriptionDefault
optsBulkCancelReplayOptsOptions for bulk replay, including filters and IDs.required

Returns:

TypeDescription
NoneNone

aio_bulk_replay

Replay task or workflow runs in bulk, according to a set of filters.

Parameters:

NameTypeDescriptionDefault
optsBulkCancelReplayOptsOptions for bulk replay, including filters and IDs.required

Returns:

TypeDescription
NoneNone

cancel

Cancel a task or workflow run.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the task or workflow run to cancel.required

Returns:

TypeDescription
NoneNone

aio_cancel

Cancel a task or workflow run.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the task or workflow run to cancel.required

Returns:

TypeDescription
NoneNone

bulk_cancel

Cancel task or workflow runs in bulk, according to a set of filters.

Parameters:

NameTypeDescriptionDefault
optsBulkCancelReplayOptsOptions for bulk cancel, including filters and IDs.required

Returns:

TypeDescription
NoneNone

aio_bulk_cancel

Cancel task or workflow runs in bulk, according to a set of filters.

Parameters:

NameTypeDescriptionDefault
optsBulkCancelReplayOptsOptions for bulk cancel, including filters and IDs.required

Returns:

TypeDescription
NoneNone

get_result

Get the result of a workflow run by its external ID.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the workflow run to retrieve the result for.required

Returns:

TypeDescription
JSONSerializableMappingThe result of the workflow run.

aio_get_result

Get the result of a workflow run by its external ID.

Parameters:

NameTypeDescriptionDefault
run_idstrThe external ID of the workflow run to retrieve the result for.required

Returns:

TypeDescription
JSONSerializableMappingThe result of the workflow run.

get_run_ref

Get a reference to a workflow run.

Parameters:

NameTypeDescriptionDefault
workflow_run_idstrThe ID of the workflow run to get a reference to.required

Returns:

TypeDescription
WorkflowRunRefA reference to the specified workflow run.