Documentation
¶
Index ¶
- Constants
- func CloneStepForRetry(ctx workflow.Context, stepID string, workflowID string) error
- func GroupMaxRetriesForSteps(steps []app.WorkflowStep) int
- type ApproveStepRequest
- type ApproveStepResponse
- type CancelStepRequest
- type CancelStepResponse
- type RetryStepRequest
- type RetryStepResponse
- type Signal
- func (s *Signal) Cancel(ctx workflow.Context) error
- func (s *Signal) Execute(ctx workflow.Context) (err error)
- func (s *Signal) RegisterUpdateHandlers(ctx workflow.Context) error
- func (s *Signal) SleepAfter() time.Duration
- func (s *Signal) Timeout() time.Duration
- func (s *Signal) Type() signal.SignalType
- func (s *Signal) Validate(ctx workflow.Context) error
- func (s *Signal) WithParams(params *signal.Params)
- type SkipStepRequest
- type SkipStepResponse
- type StepResult
Constants ¶
const ( DirectiveContinue = directive.StepContinue DirectiveStop = directive.StepStop DirectiveRetry = directive.StepRetry DirectiveRetryGroup = directive.StepRetryGroup DirectiveSkipGroup = directive.StepSkipGroup DirectiveAwaitApproval = directive.StepAwaitApproval )
Directive aliases for backward compatibility.
const SignalType signal.SignalType = "execute-workflow-step-group"
Variables ¶
This section is empty.
Functions ¶
func CloneStepForRetry ¶ added in v0.19.991
cloneStepForRetry fetches the step and workflow from DB, then creates a clone within the same group. The step should already be marked as discarded before this is called.
If the step's signal implements SignalWithClone, Clone() is called to produce one or more replacement steps (e.g., a plan signal returns a clean copy, an apply signal returns plan + apply). Otherwise the signal is copied verbatim.
func GroupMaxRetriesForSteps ¶ added in v0.19.945
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) RegisterUpdateHandlers ¶
RegisterUpdateHandlers registers group-level update handlers.
func (*Signal) SleepAfter ¶
func (*Signal) Type ¶
func (s *Signal) Type() signal.SignalType
func (*Signal) WithParams ¶ added in v0.19.927
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.