Pipeline Definition Language

A YAML-based specification for defining multi-workflow orchestrations with triggers, approvals, rollback, and external notifications.

Format YAML + JSON SchemaExtension .pipeline.yamlVersion 1.2.0Status DraftUpdated 2026-03-26

Overview

The Pipeline Definition Language (PDL) is a YAML-based specification for defining multi-workflow orchestrations in the UluOps validation framework. Pipelines compose workflows and commands into stages with explicit dependencies, triggers, approvals, rollback strategies, and external notifications.

PDL is the top-level orchestration layer in the UluOps definition hierarchy:

text
ADL (Agent Definition)
       │
       │ wrapped by
       ▼
CDL (Command Definition)
       │
       │ orchestrated by
       ▼
WDL (Workflow Definition)
       │
       │ staged by
       ▼
PDL (Pipeline Definition)  ◄── YOU ARE HERE

What Pipelines Do

CapabilityDescription
Stage orchestrationOrganize workflows/commands into stages with explicit dependencies
Event triggersExecute on git push, PR events, schedules, webhooks, or manually
Approval gatesRequire human authorization before critical stages
Environment managementVariables and secrets scoped to pipeline or stage
Failure recoveryAutomatic rollback strategies on deployment failures
External notificationsSlack, email, GitHub status, webhooks
Artifact preservationConfigurable retention policies for build outputs
Cross-run statePersist state across pipeline runs
Postflight trackerPersist results to validation tracker with token metrics

Pipeline vs Workflow

AspectWorkflow (WDL)Pipeline (PDL)
ContainsCommands in phasesWorkflows and/or commands in stages
TriggersNone (invoked by caller)Git events, webhooks, schedules, manual
ApprovalsNoneHuman gates before stages
RollbackNoneAutomatic failure recovery
NotificationsNoneExternal system integration
StatePer-run onlyPersisted across runs
PostflightDecision handlers (on_ship, etc.)Tracker persistence + conditional actions

Design Principles

💡
Tip
Workflow/Command Orchestration, Not Agent OrchestrationPipelines compose workflows and commands, not agents directly. Agents must be wrapped in commands, which can then be referenced in workflows or directly in pipeline stages.
💡
Tip
Event-Driven ExecutionPipelines define when they should run via triggers. Unlike workflows which are invoked programmatically, pipelines respond to external events (git push, PR, schedule, webhook, manual).
💡
Tip
Human-in-the-Loop ApprovalsCritical stages can require human approval before execution. This enables safe deployment workflows with mandatory review checkpoints.
💡
Tip
Fail-Safe with RollbackPipelines can define automatic rollback strategies to recover from failures. This ensures production stability even when deployments fail.
💡
Tip
Declarative Stage DependenciesStages declare explicit dependencies. The runtime builds a DAG (Directed Acyclic Graph) and determines execution order, parallelizing where possible.
💡
Tip
Consistent Interface PatternPipelines use the same interface block structure as Agents (ADL), Commands (CDL), and Workflows (WDL) for consistency across the definition language family.

Schema Structure

CI/CD Pipeline

A complete CI/CD pipeline with validation, staging, production deployment, rollback, and postflight tracker integration:

yaml
pipeline:
  interface:
    name: release-pipeline
    version: 1.0.0
    displayName: Release Pipeline
    description: Complete CI/CD pipeline from validation to deployment
    domain: software
    subdomain: ci-cd
    tags: [release, ci-cd, deployment]

  triggers:
    - type: git_push
      branches: [main, master]
      paths:
        include: ["src/**", "package.json"]
        exclude: ["**/*.md", "docs/**"]
    - type: manual
      allowed: true
      parameters:
        - name: environment
          type: string
          options: [staging, production]
          default: staging

  environment:
    variables:
      - name: NODE_ENV
        value: "production"
    secrets:
      - name: DEPLOY_KEY
        required: true
        stages: [deploy-staging, deploy-prod]

  stages:
    - id: preflight
      name: Pre-Flight Checks
      parallel: true
      steps:
        - name: Install dependencies
          command: npm ci
      gate:
        on_failure: abort

    - id: validate
      name: Core Validation
      depends_on: [preflight]
      workflows:
        - ref: ship@>=1.0.0
          args:
            target: "."
      gate:
        threshold: 70
        on_failure: abort

    - id: deploy-staging
      name: Deploy to Staging
      depends_on: [validate]
      steps:
        - name: Deploy
          command: npm run deploy:staging

    - id: deploy-prod
      name: Deploy to Production
      depends_on: [deploy-staging]
      approval:
        required: true
        approvers: ["@release-team"]
        timeout_hours: 24
      steps:
        - name: Deploy
          command: npm run deploy:prod

  rollback:
    enabled: true
    strategy: revert_to_last_success
    triggers:
      - condition: "stages.deploy-prod.failed"
        action: rollback_production

  notifications:
    channels:
      - type: slack
        webhook: "{{ secrets.SLACK_WEBHOOK }}"
        events: [started, success, failure, rollback]
      - type: github_status
        enabled: true

  postflight:
    tracker:
      enabled: true
      project: "{{ pipeline.interface.name }}"
      include_token_metrics: true
    on_success:
      - description: Notify release channel
        command: echo "Release pipeline succeeded"
    on_failure:
      - description: Alert on-call
        command: echo "Release pipeline failed"

Multi-Workflow Orchestration

A simpler pipeline that orchestrates multiple validation workflows:

yaml
pipeline:
  interface:
    name: full-validation
    version: 1.0.0
    displayName: Full Validation Pipeline
    description: Comprehensive validation running multiple specialized workflows
    domain: software

  triggers:
    - type: pull_request
      actions: [opened, synchronize]
    - type: manual
      allowed: true

  stages:
    - id: pre-implementation
      name: Pre-Implementation Review
      workflows:
        - ref: pre-implementation@>=1.0.0
          args:
            target: "."
      gate:
        threshold: 70
        on_failure: warn

    - id: post-implementation
      name: Post-Implementation Validation
      depends_on: [pre-implementation]
      workflows:
        - ref: post-implementation@>=1.0.0
          args:
            target: "."
      gate:
        threshold: 75
        on_failure: abort

    - id: ship-gate
      name: Ship Readiness Gate
      depends_on: [post-implementation]
      workflows:
        - ref: ship@>=1.0.0
          args:
            target: "."
            strict: true
      gate:
        threshold: 80
        on_failure: abort

Hybrid Pipeline (Workflows + Commands)

A pipeline that mixes workflows with direct command invocations:

yaml
pipeline:
  interface:
    name: audit-and-fix
    version: 1.0.0
    displayName: Audit and Fix Pipeline
    description: Run validation audit then attempt automatic fixes
    domain: software

  triggers:
    - type: schedule
      cron: "0 3 * * *"
    - type: manual
      allowed: true
      parameters:
        - name: auto_fix
          type: boolean
          default: true

  stages:
    - id: audit
      name: Full Audit
      workflows:
        - ref: ship@>=1.0.0
          args:
            target: "."
      gate:
        threshold: 0
        on_failure: warn

    - id: auto-fix
      name: Automatic Fixes
      depends_on: [audit]
      condition: "params.auto_fix && stages.audit.score < 90"
      commands:
        - ref: lint-fix@>=1.0.0
          args:
            target: "."
        - ref: type-fix@>=1.0.0
          condition: "context.typescript_detected"
      sequential: true

    - id: verify
      name: Verify Fixes
      depends_on: [auto-fix]
      condition: "stages.auto-fix.completed"
      workflows:
        - ref: ship@>=1.0.0
          args:
            target: "."
      gate:
        threshold: 80
        on_failure: warn

Field Reference

Interface Block

The interface block identifies the pipeline and is consistent with ADL, CDL, and WDL.

FieldTypeRequiredDescription
namestringYesKebab-case identifier. Pattern: ^[a-z][a-z0-9]*(-[a-z0-9]+)*$
versionstringYesSemantic version. Pattern: ^\d+\.\d+\.\d+$
displayNamestringYesHuman-readable name (3-50 characters)
descriptionstringYesPipeline purpose and scope (20-500 characters)
domainDomainYesPrimary domain classification
subdomainstringNoDomain refinement (kebab-case)
tagsstring[]NoSearchable discovery tags

Triggers Block

Triggers define when the pipeline executes. Six trigger types are supported.

FieldTypeRequiredDescription
typeenumYesTrigger type: git_push, pull_request, schedule, webhook, manual, pipeline
branchesstring[]NoBranch patterns (glob supported). For git_push and pull_request triggers
tagsstring[]NoTag patterns. For git_push trigger
pathsobjectNoFile path filters with include/exclude arrays (glob patterns)
actionsstring[]NoPR actions: opened, synchronize, reopened, closed, labeled, etc.
cronstringNoCron expression for schedule trigger
timezonestringNoTimezone for schedule (default: UTC)
eventstringNoEvent name for webhook trigger
secretstringNoHMAC verification secret for webhook
allowedbooleanNoEnable manual triggering
parametersParameter[]NoInput parameters for manual trigger (name, type, options, default)

Trigger Types:

TypeDescriptionKey Fields
git_pushTriggered on push to branchbranches, tags, paths
pull_requestTriggered on PR eventsactions, branches, paths
scheduleCron-based schedulingcron, timezone
webhookExternal HTTP webhookevent, secret, payload_filter
manualManual invocationallowed, parameters
pipelineTriggered by another pipelinepipeline, condition

Environment Block

Environment variables and secrets for the pipeline.

FieldTypeRequiredDescription
variablesVariable[]NoEnvironment variables with name, value, and optional stage scoping
secretsSecret[]NoSecret references with name, required flag, stage scoping, and provider config

Stages Block

Stages are the primary execution units in a pipeline.

FieldTypeRequiredDescription
idstringYesUnique stage identifier (kebab-case)
namestringYesHuman-readable stage name
depends_onstring[]NoStage dependencies (empty = root stage)
conditionstringNoEnable condition expression
timeoutnumberNoTimeout in milliseconds
parallelbooleanNoRun items in parallel (default: false)
workflowsWorkflowRef[]NoWorkflow references with ref, args, condition, timeout
commandsCommandRef[]NoCommand references with ref, args, condition, timeout
agentsAgentRef[]NoDirect agent references by subagent_type identifier (ref, model, args, condition, timeout)
stepsStep[]NoInline shell steps with name, command, env, retries
sequentialbooleanNoForce sequential execution of items
gateGateNoPass/fail gate with threshold, aggregate, on_failure
artifactsArtifact[]NoStage-specific artifact preservation
approvalApprovalNoHuman approval requirement for this stage
envRecordNoStage-specific environment overrides
inputsobjectNoInput parameters from dependency stage outputs
outputsOutput[]NoStage outputs (name, value or command expression)
artifacts_fromstring[]NoImport artifacts from other stages by stage ID

Approvals Block

Human approval requirements for stages.

FieldTypeRequiredDescription
requiredbooleanNoWhether approval is required (default: false)
approversstring[]NoList of approvers (team mentions, emails, platform-specific)
min_approvalsnumberNoMinimum approvals needed (default: 1)
timeout_hoursnumberNoHours before auto-reject (default: 72)
auto_reject_on_changebooleanNoReject if source code changes (default: true)
allow_self_approvalbooleanNoAllow triggerer to approve (default: false)
notificationNotificationNoApproval request notification configuration

Approval Timeout Behavior:

BehaviorDescription
rejectAuto-reject after timeout (default)
approveAuto-approve after timeout
extendNotify and extend timeout
pausePause pipeline indefinitely

Rollback Block

Automatic failure recovery configuration.

FieldTypeRequiredDescription
enabledbooleanNoEnable automatic rollback (default: false)
strategyenumNoRollback strategy: revert_to_last_success, revert_to_previous, custom, none
triggersRollbackTrigger[]NoConditions that trigger rollback (condition + action pairs)
actionsRecord<string, Action>NoNamed rollback actions with steps
preserve_logsbooleanNoPreserve logs on rollback (default: true)
notify_on_rollbackbooleanNoSend notification on rollback
max_rollback_attemptsnumberNoMaximum rollback retry count

Rollback Strategies:

StrategyDescription
revert_to_last_successRestore last successful deployment
revert_to_previousRestore immediate previous state
customExecute custom rollback actions
noneNo automatic rollback

Notifications Block

External system notification configuration.

FieldTypeRequiredDescription
channelsChannel[]NoNotification channels: slack, email, github_status, webhook, pagerduty, teams
templatesRecord<string, string>NoMessage templates for events (started, success, failure, rollback)
rate_limitobjectNoRate limiting with max_per_hour and deduplicate options

Channel Types:

TypeDescription
slackSlack webhook notifications
emailEmail notifications
github_statusGitHub commit status checks
webhookGeneric HTTP webhook
pagerdutyPagerDuty incident creation
teamsMicrosoft Teams notifications

Notification Events: started, stage_started, stage_complete, approval_required, approved, rejected, success, failure, rollback, timeout

Artifacts Block

File preservation configuration.

FieldTypeRequiredDescription
namestringYesArtifact identifier
pathstringNoFile glob pattern
sourcestringNoStage output reference
formatstringNoOutput format: json, yaml, raw
retention_daysnumberNoDays to retain (default: 30)
compressionstringNoCompression type: gzip, none
requiredbooleanNoFail if artifact missing
conditionstringNoConditional preservation expression

State Block

Cross-run state persistence.

FieldTypeRequiredDescription
persistencebooleanNoEnable state persistence
ttlstringNoTime to live (e.g., "30d", "168h")
trackedstring[]NoAutomatically tracked values (timestamps, counters)
customCustomState[]NoUser-defined state values with name, value, and trigger condition
conditionsConditionsNoState-based behavior (pause_on_consecutive_failures, require_manual_after_rollback)

Postflight Block

Actions executed after all stages complete. Handles tracker persistence, token metric collection, and conditional handlers.

FieldTypeRequiredDescription
trackerPostflightTrackerNoValidation tracker integration for persisting pipeline results (project, workflow_type, token metrics, field mappings)
on_successPostflightAction[]NoActions to run when all gates pass (description, command, condition)
on_failurePostflightAction[]NoActions to run when any gate fails (description, command, condition)
alwaysPostflightAction[]NoActions to run regardless of outcome (description, command, condition)

Postflight Tracker

Configuration for saving pipeline results to the UluOps validation tracker.

FieldTypeRequiredDescription
enabledbooleanNoEnable tracker persistence (default: true)
projectstringNoTracker project name. Supports template expressions (e.g., {{ pipeline.interface.name }})
workflow_typestringNoWorkflow type identifier for the tracker run. Defaults to pipeline.interface.name
include_token_metricsbooleanNoCollect token usage metrics from agent-metrics buffer (default: true)
token_metrics_commandstringNoCommand to extract token metrics. Must output tracker-compatible format
field_mappingsFieldMappingsNoMaps pipeline output fields to tracker fields (score_source, status_source, model_source, recommendations_source)
verify_savebooleanNoAfter saving, verify that total_issues matches the saved count (default: true)

Stage Dependency Graph

Pipelines build a DAG (Directed Acyclic Graph) from stage dependencies. Independent stages run in parallel automatically.

yaml
stages:
  - id: lint          # Root
  - id: test          # Root
  - id: typecheck     # Root
  # All three run in parallel

  - id: build
    depends_on: [lint, test, typecheck]
    # Waits for all three
text
  lint    test    typecheck
    \      |      /
     \     |     /
        build

Conditions create runtime-determined paths:

yaml
stages:
  - id: validate
  - id: deploy-staging
    depends_on: [validate]
    condition: "trigger.branch != 'main'"
  - id: deploy-prod
    depends_on: [validate]
    condition: "trigger.branch == 'main'"
Warning

Cycle Detection — The runtime detects circular dependencies and fails validation. For example, A → C → B → A would be rejected.

Composition Rules

Note
Pipelines can reference Workflows (WDL), Commands (CDL), and Agents (ADL)Pipeline stages can contain workflow references, command references, and direct agent references (by subagent_type), composing them into multi-stage orchestrations.
Note
Pipelines can contain inline shell stepsSimple operations can be expressed as inline steps without requiring a formal CDL command definition.
Note
Stages form a DAG via depends_onStage dependencies create a Directed Acyclic Graph. Independent stages run in parallel; cycles are detected and rejected at validation time.
Note
Triggers are exclusive to pipelinesOnly PDL definitions have triggers. Workflows and commands are invoked programmatically or by a pipeline.
Note
Approvals and rollback are pipeline-level concernsHuman approval gates and automatic rollback strategies exist only in PDL, not in WDL or CDL.
Note
Postflight handles tracker persistenceThe postflight block integrates with the UluOps validation tracker to persist pipeline results, collect token metrics, and run conditional cleanup actions.

Revision History

VersionDateChanges
1.2.02026-03-26
  • Added postflight block with tracker integration (project, workflow_type, token metrics, field mappings)
  • Added postflight conditional handlers: on_success, on_failure, always
  • Added direct agent references in stages (agents field with subagent_type identifiers)
  • Added stage inputs, outputs, and artifacts_from for cross-stage data flow
1.0.02026-01-14
  • Initial PDL specification
  • Trigger types: git_push, pull_request, schedule, webhook, manual, pipeline
  • Stage orchestration with DAG-based dependency resolution
  • Human approval workflows with multi-level support
  • Rollback strategies: revert_to_last_success, revert_to_previous, custom
  • Notification channels: slack, email, github_status, webhook, pagerduty, teams
  • Artifact preservation with retention policies
  • Cross-run state persistence