Documentation
¶
Index ¶
- Constants
- func CompleteStepGeneration(ctx workflow.Context, cfg StepConfig, flw *app.Workflow, queueSignalID string) (*app.Workflow, error)
- func DispatchGroupSignal(ctx workflow.Context, cfg StepConfig, group *app.WorkflowStepGroup, ...) (string, error)
- func DispatchGroupSignalByIdx(ctx workflow.Context, cfg StepConfig, groupIdx int, flw *app.Workflow, ...) (string, error)
- func DispatchStepSignal(ctx workflow.Context, cfg StepConfig, step *app.WorkflowStep, ...) error
- func StepHumanDescription(err error) string
- type ApprovalPauseErr
- type ContinueAsNewErr
- type EagerStepGroupsResult
- type FlowStoppedErr
- type StepConfig
- type WorkflowStepGenerator
Constants ¶
const ( DirectiveContinue = "continue" DirectiveStop = "stop" DirectiveAwaitApproval = "await-approval" DirectiveSkipGroup = "skip-group" DirectiveRetry = "retry" DirectiveRetryGroup = "retry-group" )
Step directives tell the parent conductor how to proceed after a step completes.
const DirectiveKey = "directive"
DirectiveKey is the metadata key used to communicate step execution directives from the step workflow back to the parent conductor.
Variables ¶
This section is empty.
Functions ¶
func CompleteStepGeneration ¶ added in v0.19.903
func CompleteStepGeneration(ctx workflow.Context, cfg StepConfig, flw *app.Workflow, queueSignalID string) (*app.Workflow, error)
CompleteStepGeneration fetches and persists all remaining step groups after eager generation. Safe to call even if eager generation was not used (no-op).
func DispatchGroupSignal ¶ added in v0.19.894
func DispatchGroupSignal(ctx workflow.Context, cfg StepConfig, group *app.WorkflowStepGroup, flw *app.Workflow) (string, error)
DispatchGroupSignal enqueues an execute-workflow-step-group signal to the step queue and awaits its completion via the group-finished update handler. Returns the group's directive directly so the caller doesn't need to re-fetch from DB.
func DispatchGroupSignalByIdx ¶ added in v0.19.894
func DispatchGroupSignalByIdx(ctx workflow.Context, cfg StepConfig, groupIdx int, flw *app.Workflow, parallel bool) (string, error)
DispatchGroupSignalByIdx is a backward-compatible helper that dispatches a group signal using a GroupIdx and parallel flag directly, without a WorkflowStepGroup object.
func DispatchStepSignal ¶ added in v0.19.894
func DispatchStepSignal(ctx workflow.Context, cfg StepConfig, step *app.WorkflowStep, flw *app.Workflow) error
DispatchStepSignal enqueues the execute-workflow-step signal to the step queue. The signal runs the full step lifecycle in its own handler workflow.
func StepHumanDescription ¶ added in v0.19.894
StepHumanDescription returns a user-facing error message for a failed step. For non-retryable application errors (validation failures, user errors), it extracts the root cause so the user sees actionable details. For transient/internal errors, it returns a generic message to avoid leaking internals.
Types ¶
type ApprovalPauseErr ¶ added in v0.19.894
type ApprovalPauseErr struct {
StepID string
}
ApprovalPauseErr indicates that execution stopped because a step is awaiting approval.
func NewApprovalPauseErr ¶ added in v0.19.894
func NewApprovalPauseErr(stepID string) *ApprovalPauseErr
func (*ApprovalPauseErr) Error ¶ added in v0.19.894
func (e *ApprovalPauseErr) Error() string
type ContinueAsNewErr ¶
type ContinueAsNewErr struct {
StartFromStepIdx int
}
ContinueAsNewErr signals that the workflow should continue-as-new from the given group/step index.
func NewContinueAsNewErr ¶
func NewContinueAsNewErr(startsFromStepIdx int) *ContinueAsNewErr
func (*ContinueAsNewErr) Error ¶
func (e *ContinueAsNewErr) Error() string
type EagerStepGroupsResult ¶ added in v0.19.903
EagerStepGroupsResult holds the result of an eager step generation — the eager groups are persisted and ready for execution, while remaining groups can be fetched later via CompleteStepGeneration.
func GenerateEagerStepGroups ¶ added in v0.19.903
func GenerateEagerStepGroups(ctx workflow.Context, cfg StepConfig, flw *app.Workflow) (*EagerStepGroupsResult, error)
GenerateEagerStepGroups generates and persists the eager step groups, allowing execution to begin on them while remaining groups are still generating.
type FlowStoppedErr ¶ added in v0.19.894
FlowStoppedErr is returned when a workflow is stopped due to a denial or skip-dependents response. Unlike ErrNotApproved, this carries context about why the flow stopped and signals to the execute-flow signal that it should not enter the retry-wait loop.
func NewFlowStoppedErr ¶ added in v0.19.894
func NewFlowStoppedErr(stepID, reason string) *FlowStoppedErr
func (*FlowStoppedErr) Error ¶ added in v0.19.894
func (e *FlowStoppedErr) Error() string
type StepConfig ¶ added in v0.19.894
type StepConfig struct {
GroupQueueName string
QueueName string
TargetQueueName string
GenerateStepsQueueName string
OwnerID string
OwnerType string
MW tmetrics.Writer
}
StepConfig holds the queue/owner configuration needed to dispatch and manage workflow steps. Used by both the execute-flow signal (directly) and the WorkflowConductor (for backward compatibility).
type WorkflowStepGenerator ¶
type WorkflowStepGenerator func(ctx workflow.Context, uf *app.Workflow) (*app.GenerateStepsResult, error)
WorkflowStepGenerator is a function that generates workflow steps for a given workflow.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
checks
|
|
|
Package directive defines typed directive constants for the workflow step and group execution system.
|
Package directive defines typed directive constants for the workflow step and group execution system. |
|
signals
|
|