Workflow Protocol

This document describes the versioned workflow protocol used by the Template Editor and Simulator. It defines interoperable node types and their required fields, excluding any UI-specific properties such as coordinates.

Version

version: string literal. Current: "1.0"

Node Types

DataSource

  • nodeId: string
  • displayName: string
  • type: "DataSource"
  • interval: number (seconds between emissions)
  • valueMin: number
  • valueMax: number
  • destinationNodeId: string (must reference an existing node)

Queue

  • nodeId: string
  • displayName: string
  • type: "Queue"
  • timeWindow: number (aggregation window in seconds)
  • aggregationMethod: one of: sum | average | count | first | last
  • capacity: number (optional)
  • destinationNodeId: string

ProcessNode

  • nodeId: string
  • displayName: string
  • type: "ProcessNode"
  • inputNodeIds: string[] (non-empty)
  • outputs: array of objects with formula (string) and destinationNodeId (string)

Sink

  • nodeId: string
  • displayName: string
  • type: "Sink"

Scenario

A Scenario contains: version and nodes. All cross-references are validated: every destinationNodeId and inputNodeId must reference an existing node in the same graph.

JSON Schema

Generate a machine-readable JSON Schema with the script: yarn protocol:jsonschema. The output is written to lib/workflow/protocol.schema.json.