Skip to content
SENS Platform Docs

Telemetry Flow Contracts V1

Deprecated. flow-graph.v1 is retained only to read historical deprecated template versions. It cannot be executed, copied, newly created, released, or activated. New behavior is defined by Telemetry Flow Contracts V2.

The authoritative TypeScript and runtime contracts are exported by @sens-platform/contracts; JSON Schema 2020-12 schema IDs are owned by @sens-platform/flow-engine.

ContractVersion or subjectPurpose
BlockManifestV1manifest v1Immutable named ports and execution kind
FlowBlockLibraryResponseDtoHTTP v1Executable references plus visible JSON Schemas
FlowGraphV1flow-graph.v1Editable DAG with concrete port edges
CompiledFlowPlanV1compiled-flow-plan.v1Plan with custom dependency and schema checksums
RawStoredEventV1sens.ingestion.raw-stored.v1Reference to a committed raw row
FlowReplayRequestedEventV1sens.flow.replay.requested.v1Reference to one queued, pinned replay
MeasurementIntentV1v1Side-effect-free normalized measurement intent
FlowActionIntentV1v1Side-effect-free email or attribute intent
flow action eventsens.flow.actions.v1Reference to a committed Action job
FlowDeadLetterEventV1sens.flow.dead-letter.v1Safe IDs and retry classification for persistence
ScriptLoadRequestV1sens.flow.sandbox.execute.v1Compile artifact initialization release gate
ScriptExecutionRequestV1sens.flow.sandbox.execute.v1Bounded QuickJS execution request/reply

Internal events carry event ID, schema version, source, occurrence time, tenant, correlation context, and idempotency identity. Payloads, script source, recipients, and rendered email bodies are excluded from logs.

The file-backed control-stream budgets are 1 GiB for Raw Stored, 128 MiB for Actions, and 32 MiB each for Replay and Dead Letters. Together with the 2-GiB Raw Ingestion stream, all declared maxima total 3,422,552,064 bytes and remain below the NATS server’s 3.8-GB file-store ceiling and the chart’s 4-GiB default PVC request.

SENS_RAW_STORED_V1 uses work-queue retention with a 7-day MaxAge, 1-GiB MaxBytes, and the single logical consumer group flow-worker-v1. A confirmed Flow acknowledgement removes the reference immediately. Unacknowledged references remain only until a stream limit is reached. Replay remains on the separate SENS_FLOW_REPLAYS_V1 stream. A future independent Raw Stored reader must use a separate stream or explicit fan-out contract instead of competing for this work queue.

Direct edges require exact schemaRef equality. Structural similarity is not compatibility; conversion requires an explicit adapter node. Released flow and script contents are immutable.

Custom outputs may either reuse a visible existing schema reference, which keeps them directly connectable to standard blocks, or publish an inline schema. IDs for inline schemas are allocated by the server and cannot be selected by the caller:

sens://schemas/custom-flow-block/{blockId}/versions/{version}/outputs/{port}/v1
sens://schemas/custom-flow-block/{blockId}/versions/{version}/parameters/v1

Each compiled custom dependency pins block version ID, artifact checksum, manifest checksum and all schema checksums. Release and runtime both reject a status, scope or checksum mismatch. Required outputs must exist; absent optional outputs remain valid.

Replay and Dead Letter events intentionally contain no Raw payload, script source, recipient list, rendered mail content or device-attribute value. Replay requests require an HTTP Idempotency-Key; mutable resources use numeric ETags through If-Match as documented in the OpenAPI contract.