Help us shape the future of Go! Take the 2026 Go Developer Survey

v1

package
v0.112.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CELEvaluationFailureMessage added in v0.70.0

func CELEvaluationFailureMessage(tenantId uuid.UUID, failures []v1.CELEvaluationFailure) (*msgqueue.Message, error)

func CancelledTaskMessage

func CancelledTaskMessage(
	tenantId uuid.UUID,
	taskId int64,
	taskInsertedAt pgtype.Timestamptz,
	taskExternalId uuid.UUID,
	workflowRunId uuid.UUID,
	retryCount int32,
	eventType sqlcv1.V1EventTypeOlap,
	eventMessage string,
	shouldNotify bool,
) (*msgqueue.Message, error)

func CompletedTaskMessage

func CompletedTaskMessage(
	tenantId uuid.UUID,
	taskId int64,
	taskInsertedAt pgtype.Timestamptz,
	taskExternalId uuid.UUID,
	workflowRunId uuid.UUID,
	retryCount int32,
	output []byte,
) (*msgqueue.Message, error)

func CreatedDAGMessage

func CreatedDAGMessage(tenantId uuid.UUID, payload CreatedDAGPayload) (*msgqueue.Message, error)

func CreatedEventTriggerMessage

func CreatedEventTriggerMessage(tenantId uuid.UUID, eventTriggers CreatedEventTriggerPayload) (*msgqueue.Message, error)

func CreatedTaskMessage

func CreatedTaskMessage(tenantId uuid.UUID, payload CreatedTaskPayload) (*msgqueue.Message, error)

func DurableCallbackCompletedMessage added in v0.80.0

func DurableCallbackCompletedMessage(
	tenantId, taskExternalId uuid.UUID, invocationCount int32, branchId, nodeId int64, payload []byte, satisfiedOrder *int64, childTaskIsFailure bool, childTaskErrorMessage *string, redeliveryCount int32,
) (*msgqueue.Message, error)

func DurableRestoreTaskMessage added in v0.80.0

func DurableRestoreTaskMessage(tenantId uuid.UUID, taskExternalId uuid.UUID, reason string) (*msgqueue.Message, error)

func DurableRunTriggerTaskMessage added in v0.102.4

func DurableRunTriggerTaskMessage(tenantId uuid.UUID, msg DurableRunTriggerMessage) (*msgqueue.Message, error)

func FailedTaskMessage

func FailedTaskMessage(
	tenantId uuid.UUID,
	taskId int64,
	taskInsertedAt pgtype.Timestamptz,
	taskExternalId uuid.UUID,
	workflowRunId uuid.UUID,
	retryCount int32,
	isAppError bool,
	errorMsg string,
	isNonRetryable bool,
	retryAfterMs *int64,
) (*msgqueue.Message, error)

func MonitoringEventMessageFromActionEvent

func MonitoringEventMessageFromActionEvent(tenantId uuid.UUID, taskId int64, retryCount int32, durableInvocationCount int32, request *contracts.StepActionEvent) (*msgqueue.Message, error)

func MonitoringEventMessageFromInternal

func MonitoringEventMessageFromInternal(tenantId uuid.UUID, payload CreateMonitoringEventPayload) (*msgqueue.Message, error)

func NewCronUpdateMessage added in v0.79.16

func NewCronUpdateMessage(tenantId uuid.UUID, id string) *msgqueue.Message

func NewInternalEventMessage

func NewInternalEventMessage(tenantId uuid.UUID, timestamp time.Time, events ...v1.InternalTaskEvent) (*msgqueue.Message, error)

func NewTogglePauseWorkflowMessage added in v0.103.0

func NewTogglePauseWorkflowMessage(tenantId, workflowId uuid.UUID, isPaused bool) (*msgqueue.Message, error)

func NotifyNewConcurrencyStrategy added in v0.78.21

func NotifyNewConcurrencyStrategy(tenantId uuid.UUID, strategyId int64) (*msgqueue.Message, error)

func NotifyNewQueue added in v0.78.21

func NotifyNewQueue(tenantId uuid.UUID, queueName string) (*msgqueue.Message, error)

func NotifyNewWorker added in v0.78.21

func NotifyNewWorker(tenantId uuid.UUID, workerId uuid.UUID) (*msgqueue.Message, error)

func NotifyTaskCreated

func NotifyTaskCreated(tenantId uuid.UUID, tasks []*v1.V1TaskWithPayload) (*msgqueue.Message, error)

func NotifyTaskReleased

func NotifyTaskReleased(tenantId uuid.UUID, tasks []*sqlcv1.ReleaseTasksRow) (*msgqueue.Message, error)

func StartBatchMessage added in v0.98.0

func StartBatchMessage(tenantId uuid.UUID, payload StartBatchTaskPayload) (*msgqueue.Message, error)

func TriggerTaskMessage

func TriggerTaskMessage(tenantId uuid.UUID, payloads ...*v1.WorkflowNameTriggerOpts) (*msgqueue.Message, error)

Types

type BatchTaskItem added in v0.98.0

type BatchTaskItem struct {
	InsertedAt    time.Time `json:"inserted_at"`
	ExternalID    uuid.UUID `json:"external_id"`
	WorkflowRunID uuid.UUID `json:"workflow_run_id"`
	TaskID        int64     `json:"task_id"`
}

type CELEvaluationFailures added in v0.70.0

type CELEvaluationFailures struct {
	Failures []v1.CELEvaluationFailure
}

type CancelTasksPayload

type CancelTasksPayload struct {
	Tasks []v1.TaskIdInsertedAtRetryCount `json:"tasks"`
}

type CancelledTaskPayload

type CancelledTaskPayload struct {
	// (required) the task id
	TaskId int64 `validate:"required"`

	// (required) the task inserted at
	InsertedAt pgtype.Timestamptz

	// (required) the task external id
	ExternalId uuid.UUID

	// (required) the workflow run id
	WorkflowRunId uuid.UUID

	// (required) the retry count
	RetryCount int32

	// (optional) the event message
	EventMessage string

	// (required) the reason for cancellation
	EventType sqlcv1.V1EventTypeOlap

	// (optional) whether the task should notify the worker
	ShouldNotify bool
}

type CandidateFinalizedPayload

type CandidateFinalizedPayload struct {
	// (required) the workflow run id (can either be a workflow run id or single task)
	WorkflowRunId uuid.UUID `validate:"required"`
}

type CheckTenantQueuesPayload

type CheckTenantQueuesPayload struct {
	SlotsReleased bool     `json:"slots_released"`
	QueueNames    []string `json:"queue_name"`
	StrategyIds   []int64  `json:"strategy_ids"`
}

type CompletedTaskPayload

type CompletedTaskPayload struct {
	// (required) the task id
	TaskId int64 `validate:"required"`

	// (required) the task inserted at
	InsertedAt pgtype.Timestamptz

	// (required) the task external id
	ExternalId uuid.UUID

	// (required) the workflow run id
	WorkflowRunId uuid.UUID

	// (required) the retry count
	RetryCount int32

	// (optional) the output data
	Output []byte
}

type CreateMonitoringEventPayload

type CreateMonitoringEventPayload struct {
	TaskId int64 `json:"task_id"`

	RequeueCount int `json:"requeue_count"`

	RetryCount             int32 `json:"retry_count"`
	DurableInvocationCount int32 `json:"durable_invocation_count"`

	WorkerId *uuid.UUID `json:"worker_id,omitempty"`

	EventType sqlcv1.V1EventTypeOlap `json:"event_type"`

	EventTimestamp time.Time `json:"event_timestamp" validate:"required"`
	EventPayload   string    `json:"event_payload" validate:"required"`
	EventMessage   string    `json:"event_message,omitempty"`

	// StatusOnly applies a DAG orchestrator event to its run's DAG status without writing a task
	// event, for publishes that duplicate an event already sent by the regular reporting path.
	// Ignored for other tasks.
	StatusOnly bool `json:"status_only,omitempty"`

	// WillRetry records the failure or timeout event but leaves the task and its run non-terminal.
	WillRetry bool `json:"will_retry,omitempty"`
}

type CreatedDAGPayload

type CreatedDAGPayload struct {
	*v1.DAGWithData
	RequeueCount int `json:"requeue_count"`
}

type CreatedEventTriggerPayload

type CreatedEventTriggerPayload struct {
	Payloads []CreatedEventTriggerPayloadSingleton `json:"payloads"`
}

type CreatedEventTriggerPayloadSingleton

type CreatedEventTriggerPayloadSingleton struct {
	MaybeRunId              *int64     `json:"run_id"`
	MaybeRunInsertedAt      *time.Time `json:"run_inserted_at"`
	MaybeRunExternalId      *uuid.UUID `json:"run_external_id,omitempty"`
	EventSeenAt             time.Time  `json:"event_seen_at"`
	EventKey                string     `json:"event_key"`
	EventExternalId         uuid.UUID  `json:"event_id"`
	EventPayload            []byte     `json:"event_payload"`
	EventAdditionalMetadata []byte     `json:"event_additional_metadata,omitempty"`
	EventScope              *string    `json:"event_scope,omitempty"`
	FilterId                *uuid.UUID `json:"filter_id,omitempty"`
	TriggeringWebhookName   *string    `json:"triggering_webhook_name,omitempty"`
}

type CreatedTaskPayload

type CreatedTaskPayload struct {
	*v1.V1TaskWithPayload
	RequeueCount int `json:"requeue_count"`
}

type DurableCallbackCompletedPayload added in v0.80.0

type DurableCallbackCompletedPayload struct {
	Payload               []byte
	SatisfiedOrder        *int64
	ChildTaskIsFailure    bool
	ChildTaskErrorMessage *string
	BranchId              int64
	NodeId                int64
	InvocationCount       int32
	TaskExternalId        uuid.UUID
	// RedeliveryCount is bumped each time the dead-letter path re-dispatches this callback
	// because no dispatcher had an active durable session for the task. It bounds that retry
	// loop (see handleDeadLetteredDurableCallbackCompleted).
	RedeliveryCount int32 `json:"redelivery_count,omitempty"`
}

type DurableRestoreTaskPayload added in v0.80.0

type DurableRestoreTaskPayload struct {
	Reason         string
	TaskExternalId uuid.UUID
}

type DurableRunTriggerMessage added in v0.102.4

type DurableRunTriggerMessage struct {
	DurableTaskId         int64                             `json:"durable_task_id"`
	DurableTaskInsertedAt pgtype.Timestamptz                `json:"durable_task_inserted_at"`
	DurableTaskExternalId uuid.UUID                         `json:"durable_task_external_id"`
	Entries               []PendingDurableRunTriggerPayload `json:"entries"`
}

type FailedTaskPayload

type FailedTaskPayload struct {
	// (required) the task id
	TaskId int64 `validate:"required"`

	// (required) the task inserted at
	InsertedAt pgtype.Timestamptz

	// (required) the task external id
	ExternalId uuid.UUID

	// (required) the workflow run id
	WorkflowRunId uuid.UUID

	// (required) the retry count
	RetryCount int32

	// (required) whether this is an application-level error or an internal error on the Hatchet side
	IsAppError bool

	// (optional) the error message
	ErrorMsg string

	// (optional) A boolean flag to indicate whether the error is non-retryable, meaning it should _not_ be retried. Defaults to false.
	IsNonRetryable bool `json:"is_non_retryable"`

	// (optional) the delay in milliseconds before the next attempt. Ignored when IsNonRetryable is set.
	RetryAfterMs *int64 `json:"retry_after_ms,omitempty"`
}

type FailedWebhookValidationPayload added in v0.70.0

type FailedWebhookValidationPayload struct {
	WebhookName string `json:"webhook_name" validate:"required"`
	ErrorText   string `json:"error_text" validate:"required"`
}

type NewConcurrencyStrategyPayload added in v0.78.21

type NewConcurrencyStrategyPayload struct {
	StrategyId int64 `json:"strategy_id"`
}

type NewQueuePayload added in v0.78.21

type NewQueuePayload struct {
	QueueName string `json:"queue_name"`
}

type NewWorkerPayload added in v0.78.21

type NewWorkerPayload struct {
	WorkerId uuid.UUID `json:"worker_id"`
}

type NotifyFinalizedPayload

type NotifyFinalizedPayload struct {
	// (required) the external id (can either be a workflow run id or single task)
	ExternalId uuid.UUID `validate:"required"`

	// (required) the status of the task
	Status sqlcv1.V1ReadableStatusOlap
}

type PendingDurableRunTriggerPayload added in v0.102.4

type PendingDurableRunTriggerPayload struct {
	NodeId      int64                       `json:"node_id"`
	BranchId    int64                       `json:"branch_id"`
	TriggerOpts *v1.WorkflowNameTriggerOpts `json:"trigger_opts"`
}

type ReplayTasksPayload

type ReplayTasksPayload struct {
	Tasks []TaskIdInsertedAtRetryCountWithExternalId `json:"tasks"`
}

type SignalTaskCancelledPayload

type SignalTaskCancelledPayload struct {
	// (required) the worker id
	WorkerId uuid.UUID `validate:"required"`

	// (required) the task id
	TaskId int64 `validate:"required"`

	// (required) the task inserted at
	InsertedAt pgtype.Timestamptz

	// (required) the retry count
	RetryCount int32
}

type StartBatchTaskPayload added in v0.98.0

type StartBatchTaskPayload struct {
	TenantId      uuid.UUID       `json:"tenant_id" validate:"required"`
	WorkerId      uuid.UUID       `json:"worker_id" validate:"required"`
	ActionId      string          `json:"action_id" validate:"required"`
	BatchId       string          `json:"batch_id" validate:"required"`
	ExpectedSize  int             `json:"expected_size" validate:"required"`
	BatchKey      string          `json:"batch_key,omitempty"`
	MaxRuns       *int            `json:"max_runs,omitempty"`
	TriggerReason string          `json:"trigger_reason,omitempty"`
	TriggerTime   time.Time       `json:"trigger_time" validate:"required"`
	Items         []BatchTaskItem `json:"items"`
}

type StreamEventPayload

type StreamEventPayload struct {
	WorkflowRunId uuid.UUID `json:"workflow_run_id" validate:"required"`
	TaskRunId     uuid.UUID `json:"task_run_id" validate:"required"`
	CreatedAt     time.Time `json:"created_at" validate:"required"`
	Payload       []byte    `json:"payload"`
	RetryCount    *int32    `json:"retry_count,omitempty"`
	EventIndex    *int64    `json:"event_index"`
}

type TaskAssignedBulkTaskPayload

type TaskAssignedBulkTaskPayload struct {
	WorkerIdToTaskIds map[uuid.UUID][]int64 `json:"worker_id_to_task_ids" validate:"required"`
}

type TaskIdInsertedAtRetryCountWithExternalId

type TaskIdInsertedAtRetryCountWithExternalId struct {
	v1.TaskIdInsertedAtRetryCount `json:"task"`
	WorkflowRunExternalId         uuid.UUID `json:"workflow_run_external_id,omitempty"`
	TaskExternalId                uuid.UUID `json:"task_external_id,omitempty"`
}

type TogglePauseWorkflowPayload added in v0.103.0

type TogglePauseWorkflowPayload struct {
	WorkflowID uuid.UUID
	IsPaused   bool
}

type UserEventTaskPayload

type UserEventTaskPayload struct {
	EventExternalId         uuid.UUID `json:"event_id" validate:"required"`
	EventSeenAt             time.Time `json:"event_seen_at" validate:"required"`
	EventKey                string    `json:"event_key" validate:"required"`
	EventData               []byte    `json:"event_data" validate:"required"`
	EventAdditionalMetadata []byte    `json:"event_additional_metadata"`
	EventPriority           *int32    `json:"event_priority,omitempty"`
	EventScope              *string   `json:"event_scope,omitempty"`
	TriggeringWebhookName   *string   `json:"triggering_webhook_name,omitempty"`

	// WasProcessedLocally indicates whether the event was written and tasks were triggered on the gRPC server
	// instead of the controller, so we can skip the triggering logic downstream
	WasProcessedLocally bool `json:"was_processed_locally"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL