executeworkflowstepgroup

package
v0.19.946 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectiveContinue      = directive.StepContinue
	DirectiveStop          = directive.StepStop
	DirectiveRetry         = directive.StepRetry
	DirectiveRetryGroup    = directive.StepRetryGroup
	DirectiveSkipGroup     = directive.StepSkipGroup
	DirectiveAwaitApproval = directive.StepAwaitApproval
)

Directive aliases for backward compatibility.

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

Variables

This section is empty.

Functions

func GroupMaxRetriesForSteps added in v0.19.946

func GroupMaxRetriesForSteps(steps []app.WorkflowStep) int

GroupMaxRetriesForSteps returns the minimum MaxRetries across all signals in the given steps, including signals produced by Clone(). Falls back to signal.DefaultMaxRetries for signals that don't implement SignalWithMaxRetries.

Types

type ApproveStepRequest

type ApproveStepRequest struct {
	StepID             string `json:"step_id"`
	ApprovalResponseID string `json:"approval_response_id"`
	ResponseType       string `json:"response_type"`
}

ApproveStepRequest is the input for the "approve-step" group update handler.

type ApproveStepResponse

type ApproveStepResponse struct{}

ApproveStepResponse is the response from the "approve-step" group update handler.

type CancelStepRequest

type CancelStepRequest struct {
	StepID string `json:"step_id"`
}

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

type CancelStepResponse

type CancelStepResponse struct{}

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

type RetryStepRequest

type RetryStepRequest struct {
	StepID string `json:"step_id"`
}

RetryStepRequest is the input for the "retry-step" group update handler.

type RetryStepResponse

type RetryStepResponse struct {
	Retryable bool   `json:"retryable"`
	Directive string `json:"directive"`
}

RetryStepResponse is the response from the "retry-step" group update handler.

type Signal

type Signal struct {
	WorkflowID      string `json:"workflow_id"`
	StepGroupID     string `json:"step_group_id"`
	GroupIdx        int    `json:"group_idx"`
	OwnerID         string `json:"owner_id"`
	OwnerType       string `json:"owner_type"`
	QueueName       string `json:"queue_name"`
	TargetQueueName string `json:"target_queue_name"`
	Parallel        bool   `json:"parallel"`

	// WorkflowType identifies the kind of workflow that owns this group. Set
	// at dispatch time from the in-scope *app.Workflow and forwarded to each
	// child execute-workflow-step signal so the workflow_step lifecycle
	// hook can suppress events for envelope workflows like drift_run /
	// drift_run_reprovision_sandbox without a DB lookup.
	WorkflowType string `json:"workflow_type,omitempty"`

	// OrgID / OrgName / OwnerName are pass-through fields stamped by the
	// parent execute-workflow signal. They are forwarded to the step signal
	// at dispatch time 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"`

	// DerivedTimeout is set at dispatch time from the group's TimeoutSeconds.
	// When non-zero, Timeout() returns this instead of the hardcoded fallback.
	DerivedTimeout time.Duration `json:"derived_timeout,omitempty"`
	// contains filtered or unexported fields
}

Signal encapsulates the lifecycle of executing all steps within a single workflow step group (GroupIdx). It orchestrates sequential or parallel step dispatch and communicates the group outcome back to the flow signal via the workflow's ResultDirective field.

func (*Signal) Cancel

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

Cancel propagates cancellation to all in-flight step signals.

func (*Signal) Execute

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

Execute runs all steps in this group, either sequentially or in parallel.

func (*Signal) RegisterUpdateHandlers

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

RegisterUpdateHandlers registers group-level update handlers.

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

func (*Signal) WithParams added in v0.19.927

func (s *Signal) WithParams(params *signal.Params)

type SkipStepRequest

type SkipStepRequest struct {
	StepID string `json:"step_id"`
}

SkipStepRequest is the input for the "skip-step" group update handler.

type SkipStepResponse

type SkipStepResponse struct {
	Skippable bool `json:"skippable"`
}

SkipStepResponse is the response from the "skip-step" group update handler.

type StepResult

type StepResult struct {
	// Result carries the directive and status metadata from the step.
	Result directive.StepResult

	// Error is set when the step failed unexpectedly (not handled by the
	// directive system). The caller should propagate this as a group error.
	Error error
}

StepResult describes the outcome of executing a single step.

Jump to

Keyboard shortcuts

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