v1

package
v0.73.5 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 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 string, failures []v1.CELEvaluationFailure) (*msgqueue.Message, error)

func CancelledTaskMessage

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

func CompletedTaskMessage

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

func CreatedDAGMessage

func CreatedDAGMessage(tenantId string, dag *v1.DAGWithData) (*msgqueue.Message, error)

func CreatedEventTriggerMessage

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

func CreatedTaskMessage

func CreatedTaskMessage(tenantId string, task *v1.V1TaskWithPayload) (*msgqueue.Message, error)

func FailedTaskMessage

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

func MonitoringEventMessageFromActionEvent

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

func MonitoringEventMessageFromInternal

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

func NewInternalEventMessage

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

func NotifyTaskCreated

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

func NotifyTaskReleased

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

func TriggerTaskMessage

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

Types

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 string

	// (required) the workflow run id
	WorkflowRunId string

	// (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 string `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 string

	// (required) the workflow run id
	WorkflowRunId string

	// (required) the retry count
	RetryCount int32

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

type CreateMonitoringEventPayload

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

	RetryCount int32 `json:"retry_count"`

	WorkerId *string `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"`
}

type CreatedDAGPayload

type CreatedDAGPayload struct {
	*v1.DAGWithData
}

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"`
	EventSeenAt             time.Time  `json:"event_seen_at"`
	EventKey                string     `json:"event_key"`
	EventExternalId         string     `json:"event_id"`
	EventPayload            []byte     `json:"event_payload"`
	EventAdditionalMetadata []byte     `json:"event_additional_metadata,omitempty"`
	EventScope              *string    `json:"event_scope,omitempty"`
	FilterId                *string    `json:"filter_id,omitempty"`
	TriggeringWebhookName   *string    `json:"triggering_webhook_name,omitempty"`
}

type CreatedTaskPayload

type CreatedTaskPayload struct {
	*v1.V1TaskWithPayload
}

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 string

	// (required) the workflow run id
	WorkflowRunId string

	// (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"`
}

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 NotifyFinalizedPayload

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

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

type ReplayTasksPayload

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

type SignalTaskCancelledPayload

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

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

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

	// (required) the retry count
	RetryCount int32
}

type StreamEventPayload

type StreamEventPayload struct {
	WorkflowRunId string    `json:"workflow_run_id" validate:"required,uuid"`
	StepRunId     string    `json:"step_run_id" validate:"required,uuid"`
	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[string][]int64 `json:"worker_id_to_task_id" validate:"required"`
}

type TaskIdInsertedAtRetryCountWithExternalId

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

type UserEventTaskPayload

type UserEventTaskPayload struct {
	EventExternalId         string  `json:"event_id" validate:"required,uuid"`
	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"`
}

Jump to

Keyboard shortcuts

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