v1

package
v0.55.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelledTaskMessage

func CancelledTaskMessage(
	tenantId string,
	taskId int64,
	taskInsertedAt pgtype.Timestamptz,
	taskExternalId string,
	workflowRunId string,
	retryCount int32,
	eventType sqlcv1.V1EventTypeOlap,
	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 CreatedTaskMessage

func CreatedTaskMessage(tenantId string, task *sqlcv1.V1Task) (*msgqueue.Message, error)

func FailedTaskMessage

func FailedTaskMessage(
	tenantId string,
	taskId int64,
	taskInsertedAt pgtype.Timestamptz,
	taskExternalId string,
	workflowRunId string,
	retryCount int32,
	isAppError bool,
	errorMsg string,
) (*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 []*sqlcv1.V1Task) (*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 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

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

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

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 CreatedTaskPayload

type CreatedTaskPayload struct {
	*sqlcv1.V1Task
}

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
}

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 []v1.TaskIdInsertedAtRetryCount `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"`
}

type TaskAssignedBulkTaskPayload

type TaskAssignedBulkTaskPayload struct {
	WorkerIdToTaskIds map[string][]int64 `json:"worker_id_to_task_id" validate:"required"`
}

type UserEventTaskPayload

type UserEventTaskPayload struct {
	EventId                 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"`
}

Jump to

Keyboard shortcuts

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