executeworkflowstep

package
v0.19.905 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectiveKey           = "directive"
	DirectiveContinue      = "continue"
	DirectiveSkipGroup     = "skip-group"
	DirectiveStop          = "stop"
	DirectiveRetry         = "retry"
	DirectiveRetryGroup    = "retry-group"
	DirectiveAwaitApproval = "await-approval"
)

Directive constants — duplicated here to avoid import cycle with the flow package. The canonical definitions are in flow.DirectiveX.

View Source
const (
	DenyViolationsKey  = "deny_violations"
	WarnViolationsKey  = "warn_violations"
	PassedPolicyIDsKey = "passed_policy_ids"
)

Policy evaluation metadata keys

View Source
const SignalType signal.SignalType = "execute-workflow-step"

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovePlanRequest

type ApprovePlanRequest struct {
	ApprovalResponseID string `json:"approval_response_id"`
	ResponseType       string `json:"response_type"`
}

ApprovePlanRequest is the input for the "approve-plan" update handler.

type CancelStepRequest

type CancelStepRequest struct{}

CancelStepRequest is the input for the "cancel-step" update handler.

type CancelStepResponse

type CancelStepResponse struct{}

CancelStepResponse is the response from the "cancel-step" update handler.

type CreateStepRetryResponse

type CreateStepRetryResponse struct {
	// Directive is the result directive written to the step: "retry" for a
	// single-step clone, "retry-group" when the group should be retried.
	Directive string `json:"directive"`
	NewStepID string `json:"new_step_id"`
}

CreateStepRetryResponse is the response from the "create-step-retry" update handler.

type IsRetryableResponse

type IsRetryableResponse struct {
	Retryable      bool   `json:"retryable"`
	Skippable      bool   `json:"skippable"`
	AutoRetry      bool   `json:"auto_retry"`
	MaxRetries     int    `json:"max_retries"`
	MaxAutoRetries int    `json:"max_auto_retries"`
	RetryGroup     bool   `json:"retry_group"`
	RetryIndex     int    `json:"retry_index"`
	StepID         string `json:"step_id"`
}

IsRetryableResponse is the response from the "is-retryable" update handler.

type Signal

type Signal struct {
	StepID     string `json:"step_id"`
	WorkflowID string `json:"workflow_id"`

	// OwnerID is the entity that owns the queues (e.g. install ID).
	OwnerID   string `json:"owner_id"`
	OwnerType string `json:"owner_type"`

	// TargetQueueName is the queue where the inner signal (the actual step signal)
	// gets enqueued for execution (e.g. "install-signals").
	TargetQueueName string `json:"target_queue_name"`

	// TargetQueueID, when set, is used directly for the inner signal dispatch,
	// bypassing the OwnerID/TargetQueueName lookup.
	TargetQueueID string `json:"target_queue_id,omitempty"`
	// contains filtered or unexported fields
}

Signal encapsulates the full lifecycle of executing a single workflow step. When dispatched to the step queue (e.g. install-workflow-steps), it fetches all necessary state from the database and runs the complete step execution flow: status updates, inner signal dispatch, approval handling, policy checks, and noop plan detection.

func (*Signal) Cancel

func (s *Signal) Cancel(ctx workflow.Context) error

Cancel propagates cancellation to the inner signal if one is currently executing. The inner signal's Cancel() method is responsible for updating the underlying resource (e.g. stack run) status to cancelled.

func (*Signal) Execute

func (s *Signal) Execute(ctx workflow.Context) error

Execute runs the full workflow step lifecycle. This replicates the logic from WorkflowConductor.executeFlowStep but as a self-contained signal that fetches its own state from the database.

func (*Signal) RegisterUpdateHandlers

func (s *Signal) RegisterUpdateHandlers(ctx workflow.Context) error

RegisterUpdateHandlers registers step-level update handlers on the handler workflow. Called by the handler framework after initializeState(), before Execute().

func (*Signal) SleepAfter

func (s *Signal) SleepAfter() time.Duration

func (*Signal) Type

func (s *Signal) Type() signal.SignalType

func (*Signal) Validate

func (s *Signal) Validate(ctx workflow.Context) error

type WasRetriedResponse

type WasRetriedResponse struct{}

WasRetriedResponse is the response from the "was-retried" update handler.

Jump to

Keyboard shortcuts

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