Documentation
¶
Overview ¶
Package definition provides the decoded workflow schema used by Maestro.
Use DecodeFile, DecodeYAML, or DecodeJSON to load definitions from bytes or disk. Application code usually loads through github.com/justinush/maestro/pkg/maestro or validates with github.com/justinush/maestro/pkg/validate before execution.
JSON and YAML decoding are strict: unknown fields are rejected.
Index ¶
Constants ¶
const ( // StepKindHuman is a step that waits for host input via SubmitInput. StepKindHuman = idef.StepKindHuman // StepKindAction is a step the engine advances automatically (onEnter actions, transitions). StepKindAction = idef.StepKindAction // StepKindEnd is a terminal step; ids must be listed in WorkflowDefinition.TerminalStepIDs. StepKindEnd = idef.StepKindEnd )
Step kind constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action is one onEnter/onExit invocation
Fields:
- Type: registry key (for example "stub" or "http")
- ID: stable identifier for tracing
- Params: action-specific JSON object (RawJSON)
type RawJSON ¶
RawJSON holds a JSON object fragment embedded in YAML/JSON workflow files (for example action params or inputSchema).
type Step ¶
Step is a node in the workflow graph.
Fields:
- ID, Kind (required)
- Description, Labels, Annotations, PresentationRef (optional metadata / UI)
- InputSchema: optional JSON Schema for human-step SubmitInput payloads
- OnEnter, OnExit: action lists run when entering or leaving the step
type Transition ¶
type Transition = idef.Transition
Transition is a directed edge between steps.
Fields:
- From, To: step ids
- When: optional CEL guard (empty means true)
- Priority: ascending order when multiple guards are evaluated (lower first)
type WorkflowDefinition ¶
type WorkflowDefinition = idef.WorkflowDefinition
WorkflowDefinition is the root document loaded from workflow YAML/JSON.
Fields:
- SchemaVersion: schema version (for example "0.1")
- ID, Version: workflow identity (Version is stored on run.RunRecord)
- Title, Description: optional documentation
- InitialStepID: where new instances start
- TerminalStepIDs: end step ids that may complete a run
- Steps, Transitions: the workflow graph
func DecodeFile ¶
func DecodeFile(path string) (*WorkflowDefinition, error)
DecodeFile reads a workflow file (.json, .yaml, or .yml). JSON decoding is strict.
func DecodeJSON ¶
func DecodeJSON(data []byte) (*WorkflowDefinition, error)
DecodeJSON parses workflow JSON bytes (strict: unknown fields and trailing content rejected).
func DecodeYAML ¶
func DecodeYAML(data []byte) (*WorkflowDefinition, error)
DecodeYAML parses workflow YAML bytes (strict: unknown fields rejected).