Go SDKFeature Clients

Crons Client

Accessed via client.Crons() on the Hatchet client.

CronsClient

CronsClient provides methods for interacting with cron workflow triggers

Methods:

NameDescription
CreateCreate creates a new cron workflow trigger.
DeleteDelete removes a cron workflow trigger.
GetGet retrieves a specific cron workflow trigger by its ID.
ListList retrieves a collection of cron workflow triggers based on the provided parameters.

Functions

Create

Create creates a new cron workflow trigger.

func (c *CronsClient) Create(ctx context.Context, workflowName string, cron CreateCronTrigger) (*rest.CronWorkflows, error)

Parameters:

NameType
ctxcontext.Context
workflowNamestring
cronCreateCronTrigger

Returns:

Type
*rest.CronWorkflows
error

Delete

Delete removes a cron workflow trigger.

func (c *CronsClient) Delete(ctx context.Context, cronId string) error

Parameters:

NameType
ctxcontext.Context
cronIdstring

Returns:

Type
error

Get

Get retrieves a specific cron workflow trigger by its ID.

func (c *CronsClient) Get(ctx context.Context, cronId string) (*rest.CronWorkflows, error)

Parameters:

NameType
ctxcontext.Context
cronIdstring

Returns:

Type
*rest.CronWorkflows
error

List

List retrieves a collection of cron workflow triggers based on the provided parameters.

func (c *CronsClient) List(ctx context.Context, opts rest.CronWorkflowListParams) (*rest.CronWorkflowsList, error)

Parameters:

NameType
ctxcontext.Context
optsrest.CronWorkflowListParams

Returns:

Type
*rest.CronWorkflowsList
error

RunPriority

RunPriority is the priority for a workflow run.

const (
	// RunPriorityLow is the lowest priority for a workflow run.
	RunPriorityLow	RunPriority	= 1
	// RunPriorityMedium is the medium priority for a workflow run.
	RunPriorityMedium	RunPriority	= 2
	// RunPriorityHigh is the highest priority for a workflow run.
	RunPriorityHigh	RunPriority	= 3
)

CreateCronTrigger

CreateCronTrigger contains the configuration for creating a cron trigger.

Fields:

NameTypeDescription
NamestringName is the unique identifier for the cron trigger.
ExpressionstringExpression is the cron expression that defines the schedule.
Inputmap[string]interface{}(optional) Input is the input data for the workflow.
AdditionalMetadatamap[string]interface{}(optional) AdditionalMetadata is metadata to associate with the cron trigger.
Priority*RunPriority(optional) Priority is the priority of the run triggered by the cron.

IsValidCronExpression

IsValidCronExpression validates that a string is a valid cron expression.

func IsValidCronExpression(expression string) bool

Parameters:

NameType
expressionstring

Returns:

Type
bool

InvalidCronExpressionError

InvalidCronExpressionError represents an error when an invalid cron expression is provided.

Fields:

NameTypeDescription
Expressionstring

Functions

Error
func (e *InvalidCronExpressionError) Error() string

Returns:

Type
string

Last updated on August 24, 2026

On this page