executeworkflowstep

package
v0.19.916 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: AGPL-3.0 Imports: 23 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"`

	// WorkflowType identifies the kind of workflow that owns this step. Set at
	// dispatch time from the in-scope *app.Workflow so the lifecycle hook can
	// emit workflow_step.lifecycle events without a DB lookup.
	WorkflowType string `json:"workflow_type,omitempty"`

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

	// OrgID / OrgName / OwnerName are pass-through fields stamped by the
	// parent execute-workflow signal and forwarded by the step group at
	// dispatch time. Exposed via LifecycleContext so workflow_step lifecycle
	// webhook payloads carry human-readable names without a per-event DB
	// lookup.
	OrgID     string `json:"org_id,omitempty"`
	OrgName   string `json:"org_name,omitempty"`
	OwnerName string `json:"owner_name,omitempty"`

	// 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) LifecycleContext added in v0.19.915

func (s *Signal) LifecycleContext() signal.SignalLifecycleContext

LifecycleContext exposes the step + workflow identity to lifecycle hooks so they can emit workflow_step.lifecycle.* webhook events without leaking the inner signal's operation taxonomy.

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) Timeout added in v0.19.915

func (s *Signal) Timeout() 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