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 ClientsScheduled

Scheduled Client

Bases: BaseRestClient

The scheduled client is a client for managing scheduled workflows within Hatchet.

Methods:

NameDescription
aio_createCreates a new scheduled workflow run.
aio_deleteDeletes a scheduled workflow run by its ID.
aio_getRetrieves a specific scheduled workflow by scheduled run trigger ID.
aio_listRetrieves a list of scheduled workflows based on provided filters.
createCreates a new scheduled workflow run.
deleteDeletes a scheduled workflow run by its ID.
getRetrieves a specific scheduled workflow by scheduled run trigger ID.
listRetrieves a list of scheduled workflows based on provided filters.

Functions

aio_create

Creates a new scheduled 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 schedule.required
trigger_atdatetimeThe datetime when the run should be triggered.required
inputJSONSerializableMappingThe input data for the scheduled workflow.required
additional_metadataJSONSerializableMappingAdditional metadata associated with the future run as a key-value pair.required

Returns:

TypeDescription
ScheduledWorkflowsThe created scheduled workflow instance.

aio_delete

Deletes a scheduled workflow run by its ID.

Parameters:

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

Returns:

TypeDescription
NoneNone

aio_get

Retrieves a specific scheduled workflow by scheduled run trigger ID.

Parameters:

NameTypeDescriptionDefault
scheduled_idstrThe scheduled workflow trigger ID to retrieve.required

Returns:

TypeDescription
ScheduledWorkflowsThe requested scheduled workflow instance.

aio_list

Retrieves a list of scheduled workflows based on provided filters.

Parameters:

NameTypeDescriptionDefault
offsetint | NoneThe offset to use in pagination.None
limitint | NoneThe maximum number of scheduled workflows to return.None
workflow_idstr | NoneThe ID of the workflow to filter by.None
parent_workflow_run_idstr | NoneThe ID of the parent workflow run to filter by.None
statuseslist[ScheduledRunStatus] | NoneA list of statuses to filter by.None
additional_metadataOptional[JSONSerializableMapping]Additional metadata to filter by.None
order_by_fieldOptional[ScheduledWorkflowsOrderByField]The field to order the results by.None
order_by_directionOptional[WorkflowRunOrderByDirection]The direction to order the results by.None

Returns:

TypeDescription
ScheduledWorkflowsListA list of scheduled workflows matching the provided filters.

create

Creates a new scheduled 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 schedule.required
trigger_atdatetimeThe datetime when the run should be triggered.required
inputJSONSerializableMappingThe input data for the scheduled workflow.required
additional_metadataJSONSerializableMappingAdditional metadata associated with the future run as a key-value pair.required

Returns:

TypeDescription
ScheduledWorkflowsThe created scheduled workflow instance.

delete

Deletes a scheduled workflow run by its ID.

Parameters:

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

Returns:

TypeDescription
NoneNone

get

Retrieves a specific scheduled workflow by scheduled run trigger ID.

Parameters:

NameTypeDescriptionDefault
scheduled_idstrThe scheduled workflow trigger ID to retrieve.required

Returns:

TypeDescription
ScheduledWorkflowsThe requested scheduled workflow instance.

list

Retrieves a list of scheduled workflows based on provided filters.

Parameters:

NameTypeDescriptionDefault
offsetint | NoneThe offset to use in pagination.None
limitint | NoneThe maximum number of scheduled workflows to return.None
workflow_idstr | NoneThe ID of the workflow to filter by.None
parent_workflow_run_idstr | NoneThe ID of the parent workflow run to filter by.None
statuseslist[ScheduledRunStatus] | NoneA list of statuses to filter by.None
additional_metadataOptional[JSONSerializableMapping]Additional metadata to filter by.None
order_by_fieldOptional[ScheduledWorkflowsOrderByField]The field to order the results by.None
order_by_directionOptional[WorkflowRunOrderByDirection]The direction to order the results by.None

Returns:

TypeDescription
ScheduledWorkflowsListA list of scheduled workflows matching the provided filters.