Skip to content

Complete Pipeline Template DSL Reference ​

This is the exhaustive syntax and compatibility reference. For a task-oriented introduction that connects the template to TPF's Functional Core, Imperative Shell model, start with the Pipeline Template Guide.

Version 3 describes a pipeline in domain terms. A type says what business value is moving through the pipeline; a step says how that value changes. Protobuf tags, generated bindings, and transport representations are compiler-owned infrastructure.

The pipeline template defaults to version 3 when version is omitted. Declare version: 3 when the dialect should remain clear to readers and tooling.

Version 3 generates protobuf contracts and Java domain records from the same normalized type model. Java records and wrappers preserve nominal identity; aliases remain transparent. Generated sealed union APIs and their protobuf adapters preserve declared discriminator semantics.

yaml
version: 3

types:
  OrderId:
    wraps: uuid

  Currency:
    wraps: string

  Description:
    alias: string

  Money:
    fields:
      - [amount, decimal]
      - [currency, Currency]

  PaymentApproved:
    fields:
      - [orderId, OrderId]
      - [authorizationId, string]

  PaymentDeclined:
    fields:
      - [orderId, OrderId]
      - [reason, string]

  PaymentRequiresReview:
    fields:
      - [orderId, OrderId]
      - [reason, string]

  PaymentOutcome:
    variants:
      approved: PaymentApproved
      declined: PaymentDeclined
      requiresReview: PaymentRequiresReview

Domain types ​

Every entry in types declares exactly one kind of type.

DeclarationMeaning
fieldsA product type: this value contains all of these fields.
wrapsA nominal domain value over one semantic scalar.
aliasA transparent name for another type.
variantsA closed sum type: this value is one declared alternative.

A named type normally maps to the Java type generated under the application's basePackage. An independently distributed definition can instead supply the canonical Java class with java:

yaml
types:
  DocumentFile:
    java: org.pipelineframework.blocks.document.DocumentFile
    fields: [[sourceId, string], [fileName, string], [contentType, string], [content, payload_ref]]

This is still one canonical v3 type. The compiler validates its fields and uses the bound class at ordinary Java and representation-provider boundaries; it does not treat the class as an untyped payload or create a parallel package type system.

Contributed protocol types ​

Version 3 can reference framework- or extension-owned protocol vocabulary without copying its declaration into the application:

yaml
types:
  Decision:
    variants:
      call: <acme.tools.ProtocolCall>
      complete: Recommendation

<namespace.TypeName> is a build-time type reference. The compiler resolves it from the framework catalog or static Connector Provider artifact metadata, imports that immutable definition into the normalized v3 type model, and then applies the same union, assignability, generation, adapter, serialization, and release-contract rules as an application-authored type. It is not a generic type expression or a dynamic payload escape.

A short reference such as <ProtocolCall> is accepted only when exactly one registered contribution has that type name. Use the qualified identity in durable source when multiple providers publish the same short name. Unknown references, ambiguous short names, duplicate identities, and collisions with application-authored names fail compilation.

Only referenced contributions and their dependencies enter the application contract. Installing an unused provider does not change generated domain types or release identity. Provider metadata encodes the same record, wrapper, alias, and union shapes documented on this page; it is not an external schema-import language. Provider construction, configuration, connections, credentials, and execution are not involved in type resolution.

Product types ​

Use fields for a named business record. A compact singular field is a YAML tuple in the exact form [name, type]; the singular object form is { name, type }. Use { name, repeated: type } for an ordered, finite, zero-or-more field that preserves duplicates.

yaml
types:
  PaymentRequest:
    fields:
      - [orderId, OrderId]
      - [amount, decimal]
      - name: lineItems
        repeated: PaymentLineItem

Field names are unique within a product type. A singular or repeated field can reference a semantic scalar or another named type. type and repeated are mutually exclusive; repeated: true is not valid v3 syntax.

For singular fields, presence and value nullability are independent. A ? after the field name controls whether the key may be absent; a ? after the type controls whether an explicitly present value may be null:

yaml
types:
  Customer:
    fields:
      - [name, string]
      - [nickname?, string]
      - [middleName, string?]
      - [note?, string?]
DeclarationPresenceValueCanonical JSON states
[name, string]requirednon-nullvalue only
[nickname?, string]optionalnon-nullabsent or value
[middleName, string?]requirednullablenull or value; key required
[note?, string?]optionalnullableabsent, null, or value

The verbose equivalent uses explicit normalized terms:

yaml
- name: nickname
  type: string
  presence: optional
  nullability: non_null

Do not combine compact ? markers with verbose semantic properties on the same field. Compact and verbose forms normalize identically. The normalized IDL and hashed canonical contract contain REQUIRED/OPTIONAL and NON_NULL/NULLABLE; authored punctuation does not survive normalization. An unmarked field keeps the existing strongest semantics: required presence and a non-null value.

Generated Java keeps unmarked required/non-null fields as T. Any other singular state uses CanonicalFieldValue<T>, whose Absent, NullValue, and Value cases preserve the distinction. Generated constructors enforce the declared state. Nullable protobuf fields use a compiler-owned oneof with a value arm and a google.protobuf.NullValue arm; no selected arm means absent. Compiler-owned tags and names are persisted in pipeline.idl.json and reserved when retired.

Generated REST record DTOs enforce these same input states through the shared Jackson codecs: optional/non-null fields reject explicit JSON null, and nullable fields preserve null separately from absence. A required nullable field still requires its key. The generated transport DTO's Java representation does not override the canonical contract.

Defaults are not part of this feature. In particular, an absent field is not silently materialized as a default value. Repeated fields retain their existing missing-to-empty-list behavior and cannot currently declare presence or nullability modifiers.

Verbose repeated fields may bound their finite collection size with inclusive minItems and maxItems constraints:

yaml
- name: lines
  repeated: InvoiceLine
  minItems: 1
  maxItems: 100

Both bounds are non-negative integers, minItems cannot exceed maxItems, and neither property is valid on a singular field. Bounds constrain the collection only; they do not alter element types or field-presence semantics. In the current required repeated-field model, a missing or null collection normalizes to an empty immutable list, so a positive minItems rejects it. Generated Java constructors, canonical JSON validation, model-facing JSON Schema, release metadata, and provider manifests enforce the same inclusive bounds.

Compatibility diagnostics name their surface. For example, adding a required field is safe for the protobuf wire because it adds a tag, but it breaks canonical data produced by the previous contract because those payloads lack the new required key. Changing required to optional or non-null to nullable widens canonical input while changing generated Java APIs; the reverse transitions break existing canonical payloads.

For the matrix below, RNN, ONN, RN, and ON mean required/non-null, optional/non-null, required/nullable, and optional/nullable. Rows are the previous contract and columns are the current contract. This is backward canonical-data compatibility: can every payload accepted by the previous contract still be accepted?

Previous \ CurrentRNNONNRNON
RNNunchangedwideningwideningwidening
ONNbreaking: absentunchangedbreaking: absent; null widenedwidening
RNbreaking: nullbreaking: null; absence widenedunchangedwidening
ONbreaking: absent/nullbreaking: nullbreaking: absentunchanged

The normalized-IDL classification follows the same accepted-value relationship. Protobuf presence changes retain the same field tag and are wire compatible. Non-null to nullable retains the value tag and adds a null-marker tag, so it is wire compatible. Nullable to non-null is wire-readable but lossy: old explicit-null marker values become an unselected value field. Every state transition changes the generated Java/domain contract under the conservative source-compatibility policy; transitions to or from RNN also change between T and CanonicalFieldValue<T>.

Other record evolution is classified separately:

ChangeProtobuf wireCanonical dataGenerated Java/domain
add required singular fieldcompatiblebreakingbreaking constructor/component surface
add optional singular fieldcompatiblecompatiblebreaking constructor/component surface
remove field with reserved tags/namescompatible for readersbreaking for closed record JSONbreaking
singular ↔ repeatedlossybreaking scalar/array shapebreaking T/List<T> shape
tighten repeated-field boundsunchangednarrowing/breakingconstructor validation narrows
loosen repeated-field boundsunchangedwideningconstructor validation widens
change typedepends on protobuf wire type; review requiredbreakingbreaking

repeated describes multiplicity inside one domain value. Generated Java records expose it as an immutable, non-null List<T>; generated protobuf uses a repeated field; and generated JSON Schema uses an array whose missing value normalizes to an empty array. Order and duplicates are preserved. Adding a repeated field is therefore compatible with an older pinned IDL snapshot and with protobuf/JSON readers: old payloads observe the field as empty. Changing an existing field between singular and repeated is incompatible.

Repeated fields do not imply reactive cardinality. Expanding a List<T> into a Multi<T> or collecting a Multi<T> into a list is application logic and must be explicit in the step implementation, for example:

java
public Multi<PaymentLineItem> process(PaymentRequest request) {
    return Multi.createFrom().iterable(request.lineItems());
}

public Uni<PaymentRequest> process(Multi<PaymentLineItem> items) {
    return items.collect().asList()
        .map(collected -> new PaymentRequest(orderId, amount, collected));
}

The corresponding steps declare ONE_TO_MANY and MANY_TO_ONE. TPF does not insert a collection-to-stream or stream-to-collection conversion.

Paged resumable sources ​

Paging is an opt-in execution modifier on the first source-producing ONE_TO_MANY step:

yaml
steps:
  - name: Read payments
    service: com.example.payments.PagedPaymentSource
    cardinality: ONE_TO_MANY
    input: PaymentFile
    output: Payment
    paging:
      maxRecords: 1000

maxRecords is a positive bound on logical source records consumed by one page. Rejected or skipped records count; a format header does not. Users submit one source and never author provider checkpoints.

The source service must implement PagedSourceOperation. It receives the pinned source identity, an optional opaque checkpoint, and the record limit, then returns a demand-aware Flow.Publisher and a completion stage. The provider interprets and validates its checkpoint and immutable or versioned snapshot on every open. Completion becomes valid only after the publisher completes normally and provider resources are released. A failed or cancelled page cannot advance. An empty non-exhausted page must return a different checkpoint.

The first release requires terminal Object Publish with a PagedStreamingObjectPublishMapper and a filesystem or S3 target that supports page-part composition. The mapper supplies once-only group prefix and suffix chunks and folds bounded metadata across pages. The compiler rejects paging with MATERIALIZED_MULTI, a later MANY_TO_ONE aggregate, a non-resumable source, or an incompatible target or mapper.

External representations ​

A v3 domain type can optionally declare a named external representation for a framework component. The pipeline and business functions continue to use the generated canonical domain type; the component performs the explicit conversion at its boundary.

yaml
types:
  PaymentOutput:
    fields:
      - [id, uuid]
      - [amount, decimal]
    mappings:
      persistence:
        type: org.example.persistence.PaymentOutputEntity
        mapper: org.example.persistence.PaymentOutputPersistenceMapper

mappings is a generic named-type declaration. A mapping key is not limited to a predefined spelling by the DSL, and a mapping can omit either class name for a future representation resolver. Consumers define their own readiness rules. In this release, the persistence consumer requires both values, supports concrete record domain types, and requires the declared mapper to implement Mapper<GeneratedDomain, Representation>.

The mapper's toExternal direction is used only when writing the persistence representation. Its fromExternal direction remains part of the same generic mapper contract for readers and later boundaries; a persistence write does not round-trip the saved entity back into the pipeline.

The file representation is mapper-free. It applies to a record containing one payload_ref field and declares type: java.nio.file.Path on both sides of an ordinary step. Input options bound the materialized size. Output options name an Object Publish target, bound the published size, and may override the v1 filename-derived object key. The generated facade preserves the step's normal ONE_TO_ONE or ONE_TO_MANY cardinality.

At the service boundary, the mapping changes what the author implements:

Step cardinalityAuthored service
ONE_TO_ONEReactiveService<Path, Path> returning Uni<Path>
ONE_TO_MANYReactiveStreamingService<Path, Path> returning Multi<Path>

The YAML step still names the canonical input and output contracts:

yaml
steps:
  - name: Render pages
    service: com.example.documents.RenderPagesService
    cardinality: ONE_TO_MANY
    input: SourceDocument
    output: RenderedPage

For Object Ingest, selection.mode: together can construct one canonical input from several listed objects. Use selection.keys for differently named fields, or selection.into for one repeated payload_ref field. TPF generates the projection in both cases; the first authored service receives the canonical record directly. Complete configuration and Java examples are in Object Ingest and Publish.

For HTTP access to an owned payload_ref, version 3 also accepts top-level httpPayloads. Each route names a record's singular payload_ref field, allowed content types, an authorisation scope, and a bound object target for upload or bound object source for download. Uploads require maxBytes; downloads omit it. REST/COMPUTE streams multipart bodies directly; REST/FUNCTION requires an S3 object provider and uses delegated transfer. See Generated owned-payload boundaries for the request shape and security contract.

Preview representation support ​

Version 3 representation support is experimental and intentionally narrow. Generated protobuf adapters are the normal transport boundary for generated v3 domain values. The persistence consumer supports an explicit mapping for a generated record when both the representation and Mapper<GeneratedDomain, Representation> are available to the compiling module. CSV Payments also proves the same generic mapper contract at an OpenCSV row boundary before the first canonical business step. The file consumer is the mapper-free payload-reference boundary for ordinary Path services.

JSON, REST, checkpoint, object-publish, and broker boundaries retain their current application-owned or transport-owned conversion paths. They do not yet infer or generate a json representation from mappings. A declared mapping is therefore not a user-selectable conversion mode and does not promise support from every component.

Nominal wrappers ​

Use wraps when the underlying representation has a distinct business identity. OrderId and CustomerId can both wrap uuid without becoming interchangeable.

yaml
types:
  OrderId:
    wraps: uuid
  CustomerId:
    wraps: uuid

A wrapper is assignable only to the same wrapper. Conversion to or from the wrapped scalar is explicit at a generated or application-owned boundary; it is never an implicit substitution in a step contract.

Wrappers may declare target-neutral constraints beside wraps. Constraints are part of the semantic type model and are enforced by the generated Java wrapper constructor; they are not protobuf options, JSON Schema rules, or application validation annotations.

yaml
types:
  CurrencyCode:
    wraps: string
    minLength: 3
    maxLength: 3
    pattern: "[A-Z]{3}"
  ContactEmail:
    wraps: string
    format: email
  PositiveAmount:
    wraps: decimal
    minimumExclusive: 0
  AccountingMethod:
    wraps: string
    allowedValues: [Cash, Accrual]

String wrappers support minLength, maxLength, pattern, and format: email. Length is measured in Unicode code points. A pattern requires the entire string value to match and must be paired with maxLength; generated Java validates that bound before attempting the match, limiting pattern processing for boundary data. The DSL does not define Java regular expressions as its permanent pattern language: the Java target currently compiles the declared pattern with Java regex support, and another target must either support the pattern or report a clear limitation until TPF defines a portable profile. format: email checks a practical mailbox shape—one non-edge @, no whitespace, a non-empty local part, and non-empty dot-separated domain labels. It does not establish ownership, DNS validity, or deliverability.

Numeric wrappers (int32, int64, float32, float64, and decimal) support minimum, minimumExclusive, maximum, and maximumExclusive. Bounds are semantic decimal values.

allowedValues defines a non-empty closed set for any scalar wrapper except payload_ref, whose canonical JSON representation is an object. Values must use the wrapper's canonical JSON scalar type: strings remain strings, booleans remain booleans, and numbers remain numbers. Values must also satisfy every other declared constraint. TPF canonicalizes numeric equality, removes duplicates, and sorts the set deterministically, so equivalent declarations produce identical release metadata and hashes regardless of author order. JSON Schema enum and const imported from MCP normalize to this same canonical constraint; they do not introduce MCP-specific type semantics.

Changing wrapper constraints is a semantic compatibility change. TPF classifies it as unchanged, narrowing, widening, or incomparable; this release rejects every change other than unchanged even though protobuf wire tags and shapes stay the same.

Aliases ​

Use alias for a better name without creating a new nominal identity.

yaml
types:
  Description:
    alias: string
  PaymentNarrative:
    alias: Description

An alias is assignable as its resolved target. Alias chains are allowed when they are acyclic.

Discriminated unions ​

Use variants for a closed set of business outcomes. The variant key is the discriminator and is part of the domain contract; it does not derive from a payload class name.

yaml
types:
  PaymentOutcome:
    variants:
      approved: PaymentApproved
      declined: PaymentDeclined
      requiresReview: PaymentRequiresReview

A union value is assignable to its union contract. A concrete variant can be introduced into that union. When a downstream step declares a concrete variant as its input, the compiler routes only that variant from an earlier union-producing step; this does not make the union contract itself substitutable for every concrete variant. Variants reference named payload types, including contributed <Type> references; inline payload records and payload-less variants are intentionally outside this DSL.

A union declares a contract, not a routing graph. Branch applicability remains type-based and linear. Use a union contract where a step consumes the complete outcome set; use accepts only when a branch deliberately narrows that set.

When a branch-aware step declares a union as its input, omitting accepts means it accepts every declared variant. An explicit list narrows the accepted payload contracts and must be a subset of that union.

In version 3, an explicit contract.output (or a nested definition's output) can complete the surviving branches without a final identity merge service. Every reachable branch-end type must satisfy that output contract. At the end of the definition, the Quarkus runtime extracts a concrete result from a union or introduces it into the declared return union as required. A return union with several tags for the same concrete payload needs an explicit terminal operation to select the tag. Unrelated values pass through the remaining steps; the output declaration does not jump past an applicable operation.

An explicitly authored final terminal: true step still covers every alternative reachable after earlier branches. Templates without an explicit version 3 output contract retain that requirement. See ADR-0082 for the definition-boundary semantics.

A step can also declare a concrete variant directly when it only handles that outcome. This is equivalent to a type-based branch from the preceding union; use accepts when the step keeps the union contract as its input and wants to name the accepted alternatives explicitly.

yaml
steps:
  - name: Classify payment
    input: PaymentRequest
    output: PaymentOutcome

  - name: Process declined payment
    input: PaymentDeclined
    output: PaymentResult
yaml
steps:
  - name: Classify payment
    input: PaymentRequest
    output: PaymentOutcome

  - name: Handle approval
    input: PaymentOutcome
    accepts: [PaymentApproved]
    output: PaymentResult

  - name: Complete payment
    input: PaymentOutcome
    accepts: [PaymentDeclined, PaymentRequiresReview]
    terminal: true
    output: PaymentResult

TPF records the union name, declared discriminator, and payload contract in generated branching, replay, and checkpoint-handoff metadata. This makes an observed alternative identifiable without exposing protobuf field numbers. Routing remains payload-type based: if two declared variants intentionally share a payload type, they route together under accepts; discriminators are not accepted as routing predicates.

Native Command followed by an interaction ​

A native unary (ONE_TO_ONE) Command can complete a meaningful effect and then await a separate interaction using await: with a transport adapter. The Command produces its trusted immediate result before the modifier registers the interaction. Recovery reuses that recorded result. Configure canonical record persistence through the persistence aspect.

A provider whose effect itself settles through a callback uses the existing native Command await.callback contract: register completion before dispatch and join callback settlement with effect settlement. A callback-capable operation continues to require that callback contract.

Select which operation outcomes await ​

For a v3 LOCAL unary definition with a flat union operation output, await.accepts selects the concrete canonical outcome that needs an answer. await.output names that outcome's completed type. This selector applies to the operation output; the step's own accepts still selects its input.

For example, TurnOutcome contains TurnState, Review, and Result. The completed output TurnCompletion contains TurnState, AnsweredReview, and Result:

yaml
- name: Evaluate policy
  service: com.example.EvaluatePolicyService
  cardinality: ONE_TO_ONE
  input: ValidatedTurn
  output: TurnCompletion
  await:
    operationOutput: { type: TurnOutcome }
    accepts: [Review]
    output: AnsweredReview
    timeout: PT15M
    correlation: { strategy: interactionId }
    transport: { type: interaction-api }

The service returns TurnOutcome. A Review payload becomes trusted Await context, and the admitted answer produces AnsweredReview. Continuing state and terminal Result outcomes pass through immediately. The compiler checks that the final output contains exactly these transformed canonical leaves. Selected Await currently supports one selected concrete outcome and one concrete completion type. All steps in that definition must be ONE_TO_ONE, with scalar admission. Callback and streaming selection are rejected. Selected Await also rejects operation-output unions with multiple variants sharing one concrete payload type.

A persistence aspect can observe both selected record types at their producing operations:

yaml
aspects:
  persistence:
    enabled: true
    scope: GLOBAL
    position: AFTER_STEP
    config:
      targetTypes: [Review, Result]
      pluginImplementationClass: org.pipelineframework.plugin.persistence.PersistenceService

targetTypes expands canonical aliases and unions. In v3 LOCAL pipelines, the generated observer extracts a matching payload from a direct value or flat union, invokes the typed plugin, and preserves the pipeline value. A selected union payload must have one Java record case. Other outcomes pass through. Each producing operation retains its own observer occurrence, including across nested definition scopes. Configure the types' persistence mappings as usual. These output observations execute before the Await modifier; terminal outputs use normal definition completion.

For selective Await, a custom AwaitCompletionProjector<I, C, O> receives the selected request payload as I. Its O is the selected completed type named by await.output. The generated adapter wraps that value in the step's final union. For example, selecting Review and completing AnsweredReview uses a projector whose output is AnsweredReview.

Deferred completion with unions ​

An operation decorated with await: uses the same branch plan as every other step. accepts determines which union alternatives invoke the authored operation. The operation's immediate await.operationOutput—not the original union input—is the trusted request and projector input:

yaml
- name: Clarify
  service: com.example.CreateClarificationRequestService
  cardinality: ONE_TO_ONE
  input: PreparationDecision
  accepts: [ClarificationRequired]
  output: Prepared
  await:
    operationOutput:
      type: PendingClarification
      java: com.example.PendingClarification
    timeout: PT8H
    correlation: { strategy: interactionId }
    completion:
      type: com.example.ClarificationAnswer
      projector: com.example.ClarificationProjector
    transport: { type: interaction-api }

ClarificationProjector must implement AwaitCompletionProjector<PendingClarification, ClarificationAnswer, Prepared>. The projector must be a public concrete class with a public no-argument constructor. Raw, wildcard, unresolved, or incompatible generic arguments fail compilation.

When accepts selects only some union alternatives, the omitted alternatives do not invoke the decorated operation. They bypass it and continue unchanged through ordinary v3 pipeline flow.

await.operationOutput.java is required when the canonical operation-output type does not otherwise provide the authored service binding. A Java binding is always a compiler-checked representation; it never requests an implicit conversion.

Wire identity and compatibility ​

Names, field names, and variant discriminators are the DSL-facing identities. The compiler allocates protobuf tags and records them in the sibling IDL lock file (pipeline.idl.json for pipeline.yaml). YAML never contains field or variant numbers.

Representation mappings are application/build configuration, not domain wire identity. Changing a declared representation class or mapper does not change protobuf tags or automatically constitute a v3 compatibility change.

The compiler preserves tags and reservations as types evolve. Changing a field representation, a wrapper representation, an alias target, or a variant discriminator changes the contract and is checked before generation. A generated target must preserve nominal identity and discriminator semantics; a target that cannot do so reports a clear diagnostic instead of silently flattening the type.

Generated protobuf contracts ​

Version 3 emits a shared pipeline-types.proto. Records become protobuf messages, and authored camel-case field names are rendered as deterministic snake_case protobuf fields. Each eligible singular scalar has proto3 explicit presence; named messages and payload_ref already have message presence.

A wrapper is a distinct message with value = 1, so two wrappers over the same scalar remain distinct on the wire. An alias emits no message and resolves transitively to its target protobuf type. A union becomes a message with oneof value; each discriminator becomes a snake_case oneof field, while the authored discriminator remains the semantic identity in pipeline.idl.json.

The generator reserves removed protobuf names and tags from the committed IDL state. Source declaration order does not affect retained or newly allocated tags.

Generated Java domain types ​

Run PipelineContractGenerator from org.pipelineframework:pipelineframework-compiler in the same generate-sources lifecycle as protobuf generation. Declare that artifact explicitly on the generator classpath. It invokes the independent protobuf and Java target generators from the same resolved v3 type model and committed IDL state.

Generated Java sources live under <basePackage>.domain. A record field keeps its YAML declaration order in the generated Java record constructor. A wrapper is a distinct one-component record, so two wrappers over the same scalar cannot be exchanged accidentally. Aliases generate no class and use their resolved target type.

The generated PipelineDomainProtoAdapters class converts generated records, wrappers, and unions to and from the generated protobuf types. It is public application-facing generated code, but its exact class and method shape remains provisional while the Java target continues to evolve.

Unmarked required/non-null record components use T and reject Java null. Every optional or nullable singular component uses CanonicalFieldValue<T>: Absent means no canonical key, NullValue means an explicitly present null, and Value carries T. The generated compact constructor enforces the declared state, independently of protobuf presence. Repeated components retain their separate list semantics: their generated compact constructor normalizes Java null to List.of() and defensively copies supplied values with List.copyOf(...). A wrapper such as Currency(null) remains invalid. For constrained wrappers, the generated compact constructor is the Java invariant boundary. payload_ref is handled separately as the framework PayloadReference contract type.

Each v3 union generates a sealed Java interface. Its nested variant records carry the declared payload and expose the exact YAML discriminator through discriminator(). The adapter maps those variants directly to the generated protobuf oneof cases; it does not flatten them into their payloads.

For unary local services whose Java signature uses those exact generated domain records, wrappers, or unions, TPF uses the generated adapters directly. Application-owned Java types remain representation boundaries and continue to need the normal explicit mapper path. Branch-aware v3 templates keep the existing accepts and terminal model; a union remains a closed contract rather than a predicate or graph language. Native Query and Command steps and streaming cardinalities have their own supported bindings. Nested Await requires a LOCAL ONE_TO_ONE invocation chain. Selective Await additionally requires a flat union operation output and one selected concrete outcome, as described above. See Await runtime setup for ordinary streaming Await.

Pipeline contracts ​

Logical contracts use the names declared in types. They are distinct from Java implementation types.

yaml
contract:
  input: PaymentRequest
  output: PaymentOutcome

steps:
  - name: Validate Payment
    service: com.example.payment.ValidatePaymentService
    cardinality: ONE_TO_ONE
    output: ValidatedPayment

  - name: Process Payment
    service: com.example.payment.ProcessPaymentService
    cardinality: ONE_TO_ONE
    output: PaymentOutcome

contract.input supplies the first omitted step input. In a linear chain, each later omitted input inherits the preceding concrete output. An explicit input is an assertion and must agree with the inherited contract. contract.output, when present, asserts the final concrete output.

Physical boundaries remain under root input and output, so they can coexist with logical contracts:

yaml
input:
  subscription:
    publication: payment-requests
output:
  checkpoint:
    publication: payment-outcomes
contract:
  input: PaymentRequest
  output: PaymentOutcome

Propagation never guesses across a union, a branch, or a predecessor without one concrete output. Those contracts stay explicit.

Local and packaged pipeline composition ​

For the complete packaged-composition journey, see the Blocks Guide.

pipelines declares compile-time local definitions. Installed block artifacts can contribute the same definition shape from an ordinary Maven or Gradle dependency. A pipeline step invokes either source as an ordinary typed step; the compiler links the definition into the root release contract, and the runtime returns its result to the caller without creating another execution or publishing another terminal output.

xml
<dependency>
  <groupId>org.pipelineframework.blocks</groupId>
  <artifactId>document-text-extraction</artifactId>
  <version>1.0.0</version>
</dependency>
yaml
steps:
  - name: Extract document
    pipeline: document-text-extraction
    input: DocumentFile
    output: ExtractedDocument

Package definitions have qualified identities such as org.pipelineframework.document/document-text-extraction. In an application, the short name is accepted only when it is unique and does not collide with a local definition. Inside a block package, a short reference resolves to that package's own definition; use a qualified identity for an explicit cross-package reference. Removing the dependency makes the reference fail at compilation. Schema v3 release metadata records the artifact version, definition resource, and definition fingerprint; changing them changes the consuming contract hash.

Packaged definitions may contain authored service steps, nested pipeline: calls, and operation-first Query or Command steps. A Block declares the external capabilities required by each definition in its schema 1 package manifest; it does not declare application connector bindings:

json
{
  "schemaVersion": 1,
  "namespace": "org.pipelineframework.graphql",
  "artifact": {
    "groupId": "org.pipelineframework.blocks",
    "artifactId": "graphql",
    "version": "1.0.0"
  },
  "definitions": [{
    "name": "graphql-mutation",
    "resource": "META-INF/pipeline/graphql.yaml",
    "requires": {
      "graphql.write": { "kind": "COMMAND" }
    }
  }]
}

Inside that definition, using names the requirement and the remaining fields are ordinary v3 operation-first fields:

yaml
- name: Execute mutation
  kind: command
  using: graphql.write
  operation: execute.mutation
  operationVersion: 1
  input: <tpf.graphql.GraphQlMutationRequest>
  output: <tpf.graphql.GraphQlResponse>

The application grants the capability at compilation, once per qualified Block definition:

yaml
connectors:
  primary-graphql:
    provider: graphql.smallrye
    version: 1
    config: { connection: primary-graphql }

blockBindings:
  org.pipelineframework.graphql/graphql-mutation:
    graphql.write:
      using: primary-graphql
      commandIdGenerator: com.example.GraphQlMutationCommandId
      duplicatePolicy: RETURN_RECORDED
      policy:
        requiredExecutionPosture: AUTOMATED
        minimumMachineConfirmation: PROVIDER_ACKNOWLEDGED

blockBindings is compile-time input: it is removed before ordinary v3 parsing and does not become runtime configuration. Query mappings contain only using. Command mappings must explicitly select commandIdGenerator, duplicatePolicy, and policy; a Block is forbidden from supplying those authority choices. The selected provider operation must match the Block step's kind, provider and operation major versions, cardinality, and canonical input/output Java contracts exactly.

An imported operation-first Query may also expose a finite callable catalogue through requirements declared by the same Block definition:

yaml
- name: Decide
  kind: query
  using: decision.model
  operation: decide
  operationVersion: 1
  input: DecisionState
  output: Decision
  config:
    instructions: Select one declared callable or complete.
    modelInputExcludes:
      - state.effectScope
      - nextEffectKey
    callContext:
      state: state
  callables:
    lookup:
      using: domain.read
      operation: lookup
      operationVersion: 1
      kind: query
      input: LookupRequest
    update:
      using: domain.write
      operation: update
      operationVersion: 1
      kind: command
      input: UpdateRequest
      trustedArguments:
        effectKey: nextEffectKey

- name: Invoke proposal
  input: <tpf.llm.AgentCall>
  output: <tpf.connector.OperationObservation>
  operation: { mode: dynamic, from: Decide }

modelInputExcludes, callContext, and trustedArguments are independent projections from the original typed Query input. Paths traverse record fields only. Excluded values remain available to context and trusted-argument extraction. Trusted targets must be top-level fields of the callable input, are removed from the model tool schema, and cause rejection if the model nevertheless returns them. TPF merges trusted values before validating and materializing the complete canonical callable input.

The dynamic step may reference only a catalogue source in the same definition. The linker resolves every alias and rewrites every requirement to the application's binding. Generated adapters embed native dynamic descriptors and execute through ordinary Query/Command support; neither the runtime nor the model discovers or reinterprets authority.

Blocks still cannot package connector bindings, legacy query: or command: declarations, inline connectors, Await, checkpoint handoff, remote Operators/delegates, or runtime/dynamic catalogue discovery. Application bindings retain endpoint, credentials, tenant/account selection, authorization, and Command policy. Imported Query, Command, and dynamic operation steps normalize to the same descriptors and runtime support used by local steps; there is no Block execution subsystem.

The GraphQL Connector and Blocks proof applies this split to a persisted Query and Mutation catalogue while leaving documents, connections, tenant selection, and Command policy in the consuming application.

Bounded recursion ​

yaml
pipelines:
  process-attempt:
    input: AttemptState
    output: AttemptResult
    steps:
      - name: Decide
        service: com.example.DecideService
        cardinality: ONE_TO_ONE
        input: AttemptState
        output: Decision
      - name: Try again
        pipeline: self
        cardinality: ONE_TO_ONE
        input: Decision
        accepts: [AttemptState]
        output: AttemptResult
        java: { input: com.example.domain.AttemptState, output: com.example.domain.AttemptResult }


steps:
  - name: Run attempt
    pipeline: process-attempt
    cardinality: ONE_TO_ONE
    input: AttemptState
    output: AttemptResult
    java:
      input: com.example.domain.AttemptState
      output: com.example.domain.AttemptResult

The Decision union carries either AttemptState or AttemptResult. The Try again step passes an AttemptState into a fresh invocation of process-attempt. An AttemptResult bypasses the call and completes the definition. Steps following a recursive call process the returned value in the caller.

pipeline: self refers to the enclosing definition. The explicit name pipeline: process-attempt has the same meaning inside that definition. At the top level, self calls the root. Each concrete type can select one ordinary operation or call to another definition, and one call back into the enclosing definition. Two self-calls must select disjoint concrete types.

Operations in a LOCAL unary call chain can suspend for Await. In PadelPot the root calls the personal agent. The policy Command can produce a Review and wait for its owner. Completion resumes the agent with AnsweredReview. Its answer policy can emit TurnState for another bounded turn or finish and return to the root. A later visit to the same review operation has its own interaction identity.

The runtime bounds recursive depth with pipeline.max-recursive-depth (default 64). A value of 0 allows composition but rejects the first recursive call. Reaching the configured depth is valid; attempting the next call fails immediately with a non-retryable PipelineRecursionLimitExceededException.

Java bindings and mappers ​

Step input and output always name logical pipeline contracts. For an inspectable local service or operator, TPF infers Java execution types from the signature and resolved mappers. Use java to assert that inference, resolve an ambiguity, or supply the coordinator-side binding when the service is outside the compiling module.

yaml
- name: Process Payment
  service: com.example.payment.ProcessPaymentService
  input: PaymentRecord
  output: PaymentOutcome
  java:
    input: com.example.domain.PaymentRecord
    output: com.example.domain.PaymentOutcome

For a remote or framework-owned step without an inspectable local Java contract, java provides the required coordinator-side binding. For deferred completion, the compiler separately validates the service's immediate await.operationOutput and the step's final top-level output.

Compilation visibility is topology-scoped

Java-type and mapper discovery runs in the annotation-processing compilation unit currently being built. It sees only services and mappers on that module's compile classpath; sibling modules in the same repository are not automatically visible.

The runtime mapping chooses generated roles and logical placement. The Maven build topology chooses the classpath for each generated role. Evaluate discovery independently for every compiling module; provide java.input / java.output and the required mapper whenever that module cannot inspect the service or representation boundary. See Runtime layouts and build topologies.

A Java binding identifies a domain type. A mapper performs a representation conversion and remains explicit at a real conversion boundary.

BoundaryRequired declaration
Object ingest into the first business stepinput.emits.mapper for non-grouped object ingest; grouped selection.mode: together drives selection-based projection and does not need an emits.mapper
Service outside the compiling modulejava.input / java.output, plus inboundMapper / outboundMapper when the generated client crosses representations
Object publish from the terminal business stepterminal outboundMapper and output.consumes.mapper

Do not add a mapper only to restate an inspectable local service signature. Add one whenever the boundary changes representation.

Deliberately small language ​

The DSL does not provide inline union payloads, payload-less variants, optional shorthand, generic type expressions, recursive types, units of measure, arbitrary smart constructors, predicate routing, or workflow-graph semantics. Keep business-state modeling explicit through named product types, wrappers, aliases, and closed unions.

See the Pipeline Compilation Guide for build-time validation and generated artifacts.

Diagram