FlowDSL
Studio
Spec

Packets Reference

Packet schema format, reference syntax, and validation in FlowDSL.

A packet is a typed schema for data flowing along an edge. Packets use JSON Schema Draft-07 and can be defined natively or referenced from an AsyncAPI document.

Native packet definition

yaml
components:
  packets:
    EmailPayload:
      type: object
      title: Email Payload
      description: An incoming email from the support inbox
      properties:
        messageId:
          type: string
          description: Unique email identifier (e.g., IMAP UID)
        from:
          type: string
          format: email
        to:
          type: string
          format: email
        subject:
          type: string
          maxLength: 500
        body:
          type: string
        receivedAt:
          type: string
          format: date-time
        headers:
          type: object
          additionalProperties: true
      required: [messageId, from, subject, body, receivedAt]
      additionalProperties: false

Supported JSON Schema Draft-07 keywords

KeywordSupportedNotes
typeYesstring, number, integer, boolean, object, array, null
propertiesYesObject field definitions
requiredYesArray of required field names
enumYesAllowed values
formatYesemail, date-time, uri, uuid
minimum / maximumYesNumber bounds
minLength / maxLengthYesString length bounds
patternYesRegex pattern
itemsYesArray item schema
additionalPropertiesYestrue, false, or schema
$refYesReferences within components.packets
oneOf / anyOf / allOfYesSchema composition

$ref within components

Reference other packets within the same document:

yaml
components:
  packets:
    Address:
      type: object
      properties:
        street: { type: string }
        city: { type: string }
        country: { type: string, minLength: 2, maxLength: 2 }
      required: [street, city, country]

    Order:
      type: object
      properties:
        orderId: { type: string }
        shippingAddress:
          $ref: "#/components/packets/Address"
        billingAddress:
          $ref: "#/components/packets/Address"

AsyncAPI packet reference

Reference a message schema from a linked AsyncAPI document:

yaml
asyncapi: "./events.asyncapi.yaml"

edges:
  - from: OrderReceived
    to: ValidateOrder
    delivery:
      mode: durable
      packet: "asyncapi#/components/messages/OrderPlaced"

The asyncapi#/... syntax is a JSON Pointer path into the AsyncAPI document. The runtime resolves it to the message's payload schema.

Packet reference on a node port

yaml
nodes:
  ValidateOrder:
    inputs:
      in:
        packet: OrderPayload          # Native packet reference
    outputs:
      out:
        packet: "asyncapi#/components/messages/OrderValidated"  # AsyncAPI reference

Naming convention

ElementConvention
Packet namesPascalCase
Property namescamelCase

Runtime validation

The runtime validates packets:

  1. At startup: Verifies all referenced packet names exist.
  2. At runtime: Validates each packet against its JSON Schema before delivery. Invalid packets are rejected and moved to the dead letter queue with a VALIDATION error code.

Next steps

Copyright © 2026