Documentation
¶
Overview ¶
Package workflow defines validated, deterministic workflow documents. It does not execute steps or install a workflow in an orchestration backend.
Index ¶
Constants ¶
const Version = 1
Version is the document contract version, not a runtime capability claim.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct {
// contains filtered or unexported fields
}
Definition is an immutable validated step graph implementing core.Document. Its JSON is an intermediate contract, NOT an xyOps event/API payload.
func New ¶
func New(p Props) (*Definition, error)
New validates and snapshots p. All branches require success; failure routing, retries and conditional joins are deliberately outside this first contract.
func (*Definition) JSON ¶
func (w *Definition) JSON() ([]byte, error)
JSON emits canonical data for core.App.Attach. This is definition metadata; runtime inputs, credentials, plan files and approval records are not embedded.
type Props ¶
type Props struct {
ID string `json:"id"`
ConcurrencyKey string `json:"concurrency_key"`
SupersedePending bool `json:"supersede_pending"`
Steps []Step `json:"steps"`
}
Props defines a workflow. ConcurrencyKey identifies overlapping targets. Execution must serialize mutations for this key, not hold a lock while waiting for approval. Supersession applies only to runs not yet applying.
type Step ¶
type Step struct {
ID string `json:"id"`
Kind Kind `json:"kind"`
Needs []string `json:"needs"`
Handler string `json:"handler,omitempty"`
TimeoutSeconds int `json:"timeout_seconds"`
Mutates bool `json:"mutates"`
RequiresApproval string `json:"requires_approval,omitempty"`
// Approvers are backend-resolved principal identifiers, not credentials.
Approvers []string `json:"approvers,omitempty"`
}
Step is a node. All Needs must succeed before this node may execute. Handler names an implementation registered by the backend, not a shell command. Approval nodes require a human decision, never an automatically successful task.
type XyopsConnection ¶
type XyopsConnection struct {
ID string `json:"id"`
Source string `json:"source"`
Dest string `json:"dest"`
Condition string `json:"condition,omitempty"`
}
XyopsConnection preserves native routing conditions.
type XyopsManualApproval ¶
type XyopsManualApproval struct {
Approvers []string `json:"approvers"`
TimeoutSeconds int `json:"timeout"`
}
XyopsManualApproval records a human decision bound to the complete manifest and policy. Approvers are exact xyOps usernames, not caller-supplied identities.
type XyopsNode ¶
type XyopsNode struct {
ID string `json:"id"`
Type string `json:"type"`
X int `json:"x"`
Y int `json:"y"`
Data map[string]any `json:"data,omitempty"`
}
XyopsNode is a native xyOps node. Data is backend-owned JSON, not a CDK deployment vocabulary. Action/limit nodes attach to jobs, not sequential steps.
type XyopsPipeline ¶
XyopsPipeline installs three events: execute, approve and deny. The latter two have no infrastructure/signing vault grants and cannot accept API-key or magic-link approval. Execution is a durable, bounded job, not a shell stub.
func NewXyopsPipeline ¶
func NewXyopsPipeline(stack *core.Stack, name string, p XyopsPipelineProps) (*XyopsPipeline, error)
NewXyopsPipeline emits reviewed shell events embedding the same runtime/policy. State is private local storage on one executor; this is not a distributed lock. Every overlapping pipeline must share StateDirectory and ConcurrencyKey.
type XyopsPipelineProps ¶
type XyopsPipelineProps struct {
ID, Title, Category string
Enabled bool
Endpoint string
Executor string
StateDirectory string
ConcurrencyKey string
SupersedePending bool
MaxPending int
Targets, AppSlots []string
Admission XyopsTask
Prepare, Deploy []XyopsTask
Approval XyopsManualApproval
Trigger xyops.Trigger
Fields []xyops.Field
// Values remain in the vault. IdentitySecret needs XYOPS_WORKFLOW_API_KEY
// (job read access only). TaskSecrets are granted ONLY to the run event.
IdentitySecret *xyops.SecretProps
TaskSecrets []xyops.SecretProps
}
XyopsPipelineProps composes one executable, single-executor delivery workflow. Admission MUST authenticate source, CI success and provenance before returning the manifest. Prepare may fetch/verify artifacts and plan; Deploy must re-plan, enforce disruption guards, apply and verify. No build runs on this executor.
type XyopsTask ¶
type XyopsTask struct {
ID string `json:"id"`
Script string `json:"script"`
TimeoutSeconds int `json:"timeout"`
}
XyopsTask is a trusted control-plane handler. Scripts come from the control plane, never from application source, artifact content or request parameters. The manifest path is WORKFLOW_MANIFEST; admission reads request JSON on stdin.
type XyopsWorkflow ¶
XyopsWorkflow is a provider-backed workflow definition, installed when its containing stack is applied (including bootstrap). Construction never runs it.
func NewXyopsWorkflow ¶
func NewXyopsWorkflow(stack *core.Stack, name string, p XyopsWorkflowProps) (*XyopsWorkflow, error)
NewXyopsWorkflow validates and synthesizes a native workflow resource using attributes available in provider 0.1.2-dev.8. Require xyops.Provider on stack. Native loops are allowed. Use an explicit join controller for all-of fan-in.
type XyopsWorkflowProps ¶
type XyopsWorkflowProps struct {
ID string
Title string
Category string
Enabled bool
Nodes []XyopsNode
Connections []XyopsConnection
Triggers []map[string]any
Actions []map[string]any
Limits []map[string]any
Tags []string
Import bool
Params map[string]any
Fields []map[string]any
Notes *string
Icon *string
}
XyopsWorkflowProps maps the existing xyops_workflow provider resource. No runtime approval or deployment-safety guarantee is inferred from a graph. Optional metadata and runtime input fields require provider 0.1.2-dev.8.