Stream Processing
Build continuous data pipelines with declarative YAML — filter, map, aggregate, enrich, and route data across streams, time-series, KV, and queues without leaving Flo.
Flo ships a built-in stream processing engine. Jobs are defined in YAML, submitted with the CLI or an SDK, and executed entirely inside the Flo node — no external cluster required. The engine reads from Flo streams or time-series measurements, transforms records through a chain of operators, and writes results to stream, time-series, KV, or queue sinks.
Why Built-In Processing?
Traditional architectures pair a storage layer (Kafka, Redis) with a separate processing framework (Flink, Spark Streaming). This means two clusters to deploy, two failure domains to monitor, and serialization overhead at every boundary.
Flo eliminates that gap:
- Zero-copy reads — source records are read directly from the Unified Append Log, no network hop
- In-node execution — every job runs on shard 0, which holds the jobs, and reads and writes other shards' data in-process
- Integrated KV —
kv_lookupreads Flo KV and a KV sink writes it, no external store - Single deployment — one binary, one config, one monitoring surface
Core Concepts
Jobs
A job is a long-running processing pipeline defined by a YAML file. Each job specifies:
| Field | Description |
|---|---|
kind | Always Processing |
name | Human-readable job name (default: unnamed-job) |
namespace | The namespace the job lives in. Optional; if given, it must be the one the job is submitted to (-n) |
batch_size | Records a stream source reads per tick (default: 100, at most 1000) |
sources | Where to read data from |
sinks | Where to write results to |
operators | Transformation chain applied to every record |
Records
The fundamental data unit flowing through a pipeline is a ProcessingRecord:
- key — empty when read from a source; set by
keybyorflatmap - value — payload bytes (typically JSON)
- event_time_ms — the point's timestamp for a time-series source; the time it was read for a stream source
- tags — labels set by
classify, used for tag-based routing
Pipeline Topology
Pipelines are linear chains: source → operator₁ → operator₂ → … → sink. All operators in a chain run on the same shard thread, one record at a time.
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ Source │───▶│ Filter │───▶│ KeyBy │───▶│ Aggregate│───▶│ Sink │
│ (stream) │ │ │ │ │ │ │ │ (stream) │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
Job Definition (YAML)
Server-side job definitions use nested YAML or JSON. The examples below use YAML.
Minimal Pipeline
The simplest pipeline: read a stream, write to another stream, no transformation:
kind: Processing
name: user-events-pipe
namespace: analytics
batch_size: 100
sources:
- name: input
stream:
name: payment-events
namespace: analytics
sinks:
- name: output
stream:
name: enriched-events
namespace: analytics
The job polls payment-events on a fixed interval (poll_interval_ms, default 1000 ms), reading up to batch_size records per tick, and appends every record to enriched-events.
Full Example with Operators
kind: Processing
name: order-analytics
namespace: production
batch_size: 200
sources:
- name: orders
stream:
name: raw-orders
namespace: production
batch_size: 500
sinks:
- name: output
stream:
name: order-totals
namespace: production
operators:
- type: filter
name: completed-only
condition: "value_contains:completed"
- type: keyby
name: by-customer
key_expression: "$.customer_id"
- type: aggregate
name: running-total
function: sum
field: "$.amount"
Each completed order updates its customer's running total, and the new total is appended to order-totals.
Sources
Sources define where the pipeline reads data. Two source kinds are supported: stream and time-series (ts).
Stream Source
Reads every partition of a Flo stream, tracking a durable cursor so a restart resumes where it left off:
sources:
- name: events
stream:
name: click-events
namespace: production
batch_size: 500 # per-source override (records read per tick)
poll_interval_ms: 1000 # how often to read from the source (default: 1000)
The cursor moves in the same log entry as the sink writes of the records it moved past, so each record is written exactly once, across restarts and leader changes. A record is not retried once the cursor has moved past it: if an operator fails on it, or a sink's target refuses its write for good, the error is logged and counted and the record is skipped.
:::note
Leave partitions: out: a stream source reads every partition, and all is the only value accepted. To process part of a stream, filter on a field, or write that part to its own stream.
:::
Time-Series Source
Polls a TS measurement at a configurable interval, up to 512 points per poll (fewer when its sinks have less room), emitting data points as JSON records:
sources:
- name: cpu-metrics
ts:
measurement: cpu_usage
namespace: production
field: value # field to read (default: "value")
tags: # optional: the series' full tag set
host: web-01
poll_interval_ms: 1000 # polling interval (default: 1000)
lateness_ms: 30000 # how late a point may arrive and still be read (default: 30000)
Each emitted record looks like:
{"measurement": "cpu_usage", "value": 72.5, "timestamp_ms": 1700000000000}
tags names one series exactly: all of its tags, not a subset.
Late points
A time-series source reads points in time order, and it reads only up to lateness_ms behind the newest point its field has, across all of the field's series. A point that arrives up to that late, from a host whose clock lags or that sends in batches, is still ahead of the source and gets read. Once the field has had no write at all, late or not, for lateness_ms, the source reads everything up to the newest point.
The window adds latency: a record reaches the source's sinks up to lateness_ms after its point was written, while the field keeps being written. Size it to how late your writers' points arrive, which is your send interval plus the clock skew between hosts. For example, a collector that sends every 10 s from hosts within 1 s of each other needs about 11 s. lateness_ms: 0 reads up to the newest point at once, and misses any point that arrives behind it.
A point that arrives more than the window behind is not read by a source that has passed it. Every point that arrives behind its field's newest is counted at each of these edges it trails by: 0s, 1s, 5s, 15s, 30s, 1m, 5m and 1h. The counter flo_ts_late_points_total{behind="30s"} counts them per shard, since the server started. A source with a window between two edges is covered by the next edge up, so a window on an edge, like the default 30 s, reads its count exactly. The count covers every field and every writer on the shard, not only what one source skipped. flo processing status shows a running job's count against its window's edge: Late points: at least 3, more than 30s behind their field's newest. That counts the points of the job's source fields that arrived more than the edge behind their field's newest point. Not every one of them was missed: a source still behind reads a late point that is ahead of its cursor. The count is kept with the field, so it covers every series of the field, including ones a tag filter leaves out, and points that arrived before the job started. A field read by several of the job's sources counts once. A job with several TS sources reports against the largest edge among them. A window past 1h has no edge, so no count is shown.
To read every point regardless of when it arrives, use flo ts read or flo ts query rather than a processing source.
Multi-Source Merge
Each source runs as its own pipeline with its own copy of the operators, and all of them write to the job's sinks. Operator state, such as an aggregate's totals, is kept per source, not merged:
sources:
- name: clicks
stream:
name: click-events
- name: checkouts
stream:
name: checkout-events
sinks:
- name: merged
stream:
name: unified-events
Sinks
Sinks define where the pipeline writes results. Four sink kinds are supported.
A sink writes each record exactly once. A pipeline's writes for a batch of records, to whatever shards hold their targets, go in one log entry with the source cursor they move it to, and reach each target in the order they were made.
- A full queue keeps the job's writes it has no room for, in order, and takes them as it drains: none is lost, and none overtakes an earlier one. A client's enqueue isn't held back by them. Past 16 MiB kept for one queue, or 128 MiB on its shard, the pipeline waits, and so does every job writing to that shard.
flo processing statussays so, naming the queue when the job's own write is the one waiting:RUNNING (waiting for room on shard 2 (orders)), orwaiting for room on shard 2when another job's write is ahead of it. Drain the queue to let them go on. A queue's caps ([queues]settings) are those of the node leading the queue's shard when the write arrives, so a job's writes are held to the same caps as a client's enqueue there. A write keeps the caps it arrived under, so raising them later doesn't release writes already kept; drain the queue. - A pipeline waits for its writes to be taken. A shard's writes to other shards wait in an outbox until they're taken. Each outbox is capped per node, sized at boot from the node's memory, and the server logs the sizes once (
channel outboxes: 256 MiB a shard, 64 MiB a channel, …). At its cap, the pipelines writing there wait, and say why the shard it goes to isn't taking them, if they know:waiting: the outbox to shard 3 is full (64 MiB of 64 MiB): it hasn't answered for 10 s. For the shard's total it'swaiting: this shard's outboxes are full (…).flo_shard_channel_outbox_bytesshows the backlog. - A pipeline says what it waits behind. A shard that can't take writes tells the shards sending to it why, and the pipeline names it:
waiting: writes to shard 3 are queued: it is halted, orit cannot flush to disk. A full target there readswaiting for room on shard 3 (orders). A shard reports only its own state, never a backlog of its own toward another shard. A pipeline also waits while a sink's shard is halted (waiting: sink shard 3 is halted) or its own shard's log is full (waiting for room in this shard's log). - A full target holds every write from that shard to its shard until it has room. Writes from one shard to another arrive in order, so the ones behind a full queue wait with it, whatever they're for. Only the queue's own consumers make room: dequeues and acks on its shard, a purge, or expiry. If those consumers wait for another write the same job makes to that shard, the two wait on each other until the queue drains some other way. Give such a queue room, or send that write from another job. Flo's own messages between shards never wait behind writes, so nothing inside Flo waits on this.
- A sink's namespace must exist. A sink doesn't create one; until it's created the pipeline reads nothing, its status says
waiting for namespace <name>, the server logs theflo namespace createthat ends the wait, andflo_processing_pipelines_waiting_namespacecounts it. - A write refused for good is lost to that sink. One a client's write would be refused for (a key the server keeps for itself, a queue message over 64 KiB) is refused before it's sent, counted in
flo_processing_records_dropped_totaland logged. One the target itself refuses is counted by reason on the shard that holds it, inflo_shard_channel_sink_refusals_total, and logged there naming the target and the shard the job runs on. These counts aren't kept per job.
Limits
One record may make at most 64 sink writes, of 1 MiB in all: each sink writes once per record, and a time-series sink with a fields: map once per field. A job whose sinks and fields make more than that for every record is refused at submit; use fewer sinks or fields, or split the job. An operator that emits several records for one (a flatmap) multiplies them, which the submit can't see. A record past the limit is skipped: counted once in flo_processing_records_dropped_total and in flo_processing_records_too_large_total, logged, and named in the job's status with where it was in its source.
A poll reads up to batch_size records, a page after another as each batch of writes is logged.
Stream Sink
Appends records to a Flo stream:
sinks:
- name: output
stream:
name: enriched-events
Time-Series Sink
Extracts tags and numeric fields from JSON record payloads and writes them as time-series data points:
sinks:
- name: cpu-ts
ts:
measurement: proc_cpu_metrics
tags:
host: hostname # TS tag "host" ← JSON field "hostname"
fields:
cpu: cpu_percent # TS field "cpu" ← JSON field "cpu_percent"
Given the input {"hostname":"web-01","cpu_percent":72.5}, the sink writes a point to proc_cpu_metrics with tag host=web-01 and field cpu=72.5, stamped with the time it is written. Only top-level JSON fields are read, and a tag's value must be a JSON string. measurement defaults to the sink's name.
value_field Shorthand
If the JSON payload contains a single number to use as the value, use value_field instead of a full fields: map. It is written as the point's value field; a payload that is just a number is used as it is:
sinks:
- name: temp
ts:
measurement: proc_temp
value_field: temperature
tags:
sensor: sensor
KV Sink
Writes each record's value to Flo KV under its key:
sinks:
- name: profiles
kv:
key_prefix: user # prepended to record key
separator: ":" # between prefix and key (default: ":")
ttl_ms: 86400000 # optional TTL in ms (one day)
Records from a source have no key, so put a keyby (or flatmap) before a KV sink. Without one, every record overwrites the single key user:, or, with no key_prefix, the record is dropped and counted in flo_processing_records_dropped_total. A key longer than a KV key may be is dropped and counted the same way.
A job with a time-series source and a KV sink is refused at submit: time-series records have no key.
Queue Sink
Enqueues records into a Flo queue (name defaults to the sink's name):
sinks:
- name: tasks
queue:
name: task-queue
priority: 5 # 0-255, lower is taken first
Tag-Based Routing
Sinks can subscribe to tagged records instead of receiving the full pipeline output. Tags are set by the classify operator and matched with AND logic — a record reaches a sink only when it carries all of the sink's declared match tags.
Up to 32 distinct tag names per pipeline.
Tags survive filter, passthrough and classify only. keyby, map, flatmap, aggregate and an enriching kv_lookup build new records without tags, so put classify after them.
operators:
- type: classify
name: route-events
rules:
- condition: "json:level=error"
tag: errors
- condition: "json:$.latency_ms>5000"
tag: slow
sinks:
- name: main
stream:
name: results
- name: failures
queue:
name: dead-letter
match: [errors]
- name: slow-errors
stream:
name: slow-error-stream
match: [errors, slow] # AND — must have BOTH tags
Sinks without match receive all records from the main operator chain. A single match: value is also accepted as sugar: match: errors is equivalent to match: [errors].
Operators
Operators are the transformation steps between source and sink. They are declared in the operators: array and execute in order. Flo includes eight built-in operator types.
filter — Expression-Based Filter
Drops records that don't match a condition. Supported expressions:
Record-level:
| Expression | Matches when… |
|---|---|
value_contains:<substring> | Record value contains the substring |
key_contains:<substring> | Record key contains the substring |
key_equals:<exact> | Record key equals the exact string |
key_prefix:<prefix> | Record key starts with the prefix |
value_prefix:<prefix> | Record value starts with the prefix |
not_empty | Record value is non-empty |
key_not_empty | Record key is non-empty |
min_length:<n> | Record value length ≥ n |
JSON field — json:<path><op><value>:
| Expression | Matches when… |
|---|---|
json:<path>=<value> | Field equals value |
json:<path>!=<value> | Field does not equal value |
json:<path>^=<value> | Field starts with value (prefix) |
json:<path>*=<value> | Field contains value (substring) |
json:<path>!^=<value> | Field does not start with value |
json:<path>!*=<value> | Field does not contain value |
json:<path>><value> | Field > value (numeric) |
json:<path>>=<value> | Field >= value (numeric) |
json:<path><<value> | Field < value (numeric) |
json:<path><=<value> | Field <= value (numeric) |
Compound: join up to 8 expressions with AND (all must match) or OR (any matches). AND and OR can't be mixed in one condition; use classify rules for anything richer.
A JSON condition matches only a record whose value is JSON with the field present and comparable. A missing field, a value that isn't JSON, or a field of another type matches nothing, including != and !*=. The numeric comparisons need a number on the right.
Writing a condition:
- Values are written without quotes:
json:status=done, notjson:status="done". - No spaces around the operator:
json:amount>100, notjson:amount > 100. The operator is=, never==. ANDandORare uppercase with a space on each side; a lowercaseand/oris part of the text being matched.- Paths are
$.a.bora.b; arrays can't be indexed. =against a string field compares text (json:code=5matches"5"and5); a boolean field matches onlytrueorfalse.value_contains:,key_prefix:and the rest need something after the colon.
A condition that isn't one of these is refused when the job is submitted (and by flo validate processing), naming it and where it is:
bad condition "valeu_contains:x": unknown condition at operators[0]
operators:
- type: filter
name: keep-important
condition: "value_contains:important"
- type: filter
name: high-value-approved
condition: "json:amount>10000 AND json:status=approved"
keyby — JSON Key Extraction
Re-keys records by extracting a field from the JSON value using JSONPath expressions. Downstream operators like aggregate group by this key.
operators:
- type: keyby
name: by-user
key_expression: "$.user_id"
Supports nested paths: "$.metadata.region".
If the value isn't valid JSON or the field doesn't exist, the record passes through with its original key (empty, for a record straight from a source).
map — Declarative Field Projection
A 1:1 transformation that restructures JSON records by projecting, renaming, and adding fields:
operators:
- type: map
name: extract-user
user_id: "$.data.user_id" # JSONPath extraction
amount: "$.transaction.amount" # nested field
source: "payment-service" # constant string
Rules:
- Values starting with
$.are JSONPath extractions from the input; a missing path givesnull - All other values are treated as string constants, written as they are (not escaped)
- Output is always a JSON object with the declared fields; a record whose value isn't JSON is dropped
flatmap — Array Explosion
A 1:N transformation that explodes a JSON array into individual records:
operators:
- type: flatmap
name: explode-items
array_field: "$.order.items"
element_key: "$.sku" # optional: extract key from each element
Each element of the array at $.order.items becomes a separate downstream record. If the field is missing or not an array, the record is dropped.
aggregate — Declarative Aggregation
Accumulates numeric values extracted from JSON records. Records are grouped by key — chain a keyby operator before aggregate; without one, every record falls in one group with the empty key. Totals are kept in memory and start again from zero when the server restarts or the job moves to another node.
Functions: sum, count, avg, min, max
Window modes:
| Mode | Config | Behavior |
|---|---|---|
| Running | (no window config) | Emits updated aggregate on every record |
| Count-based | window: count, window_count: <n> | Emits after every N records per key |
window_size: <n> is the older name for window_count and still works; a later release removes it. Give one or the other, not both.
window: tumbling is refused at submit: the engine has no event-time windows yet.
Output format: {"key": <group-key>, "value": <result>, "count": <n>} (the key is the grouping key set by a preceding keyby, or the record's key otherwise)
operators:
# Running total (emits on every record)
- type: aggregate
name: running-total
function: sum
field: "$.amount"
# Average every 100 records per key
- type: aggregate
name: batch-avg
function: avg
field: "$.latency_ms"
window: count
window_count: 100
kv_lookup — KV-Backed Enrichment & Filtering
Looks up keys in Flo KV storage to filter or enrich streaming records. The lookup key is constructed from a template that interpolates JSON fields from the record.
Template syntax: Mix literal text with ${<jsonpath>} placeholders:
| Template | Resolved key (for {"account_id":"alice"}) |
|---|---|
"account:${$.account_id}" | account:alice |
"${$.account_id}" | alice |
"user.${$.org}.${$.user_id}" | user.acme.u1 |
A placeholder resolves only a JSON string; a number or a missing field leaves the key unresolved, and filter mode drops the record.
namespace (optional) reads another namespace's keys, such as shared reference data; by default the lookup reads the job's own namespace.
Modes:
| Mode | Behavior |
|---|---|
filter (default) | Drop the record if the constructed key is not found in KV |
enrich | Attach the KV value to the record as the JSON field enrich_field (default: _kv); records with no match pass through unchanged |
operators:
- type: kv_lookup
name: check-account
lookup_key: "account:${$.account_id}"
mode: filter
Enrich example — adds a "tier" field to each record:
operators:
- type: kv_lookup
name: enrich-user
lookup_key: "user:${$.user_id}"
mode: enrich
enrich_field: tier
classify — Tag-Based Record Labeling
Evaluates rules against each record and sets tag bits for matching conditions. Records continue flowing — classify never drops or forks, it only labels. Downstream sinks filter by AND-matching their match list against the record's tag bitfield.
Rules use the same condition expressions as filter, and a rule whose condition isn't one is refused the same way.
operators:
- type: classify
name: route-payments
default_tag: unmatched # optional: tag when no rules match
rules:
- condition: "json:type^=payment"
tag: payments
- condition: "json:type*=transfer"
tag: transfers
- condition: "json:amount>10000"
tag: high-value
A single record can match multiple rules and carry multiple tags. This enables multi-way routing: a payments sink, a high-value sink, and a high-value, payments sink can all coexist.
Records that match no rules pass through untagged by default. Set default_tag to route unmatched records to a specific sink.
passthrough — Identity / Debug Tap
Emits every record unchanged. Useful for testing and as a pipeline placeholder:
operators:
- type: passthrough
name: debug-tap
Chaining Operators
Operators execute in declaration order. Records flow through each operator sequentially:
operators:
- type: filter
name: completed-only
condition: "value_contains:completed"
- type: keyby
name: by-customer
key_expression: "$.customer_id"
- type: map
name: extract-fields
order_id: "$.order.id"
total: "$.order.total"
- type: aggregate
name: customer-total
function: sum
field: "$.total"
Order matters: keyby comes before map here because the map's output keeps only order_id and total, so $.customer_id would no longer be there to key by.
Pipeline Patterns
Stream to Stream (Passthrough)
The simplest pipeline — data flows unmodified from source to sink:
kind: Processing
name: mirror
sources:
- stream: { name: events }
sinks:
- stream: { name: events-copy }
Stream to Time-Series (Metrics Extraction)
Convert JSON event streams into queryable time-series data:
kind: Processing
name: cpu-pipeline
namespace: metrics
sources:
- stream: { name: cpu-json }
sinks:
- ts:
measurement: proc_cpu_metrics
tags:
host: hostname
fields:
cpu: cpu_percent
Time-Series to Stream (Alerting Feed)
Poll TS measurements and produce JSON records for downstream consumers:
kind: Processing
name: ts-to-alerts
namespace: metrics
sources:
- ts:
measurement: cpu_usage
field: value
tags:
host: web-01
sinks:
- stream: { name: cpu-alerts }
Time-Series to Time-Series (Derived Metrics)
Build derived metrics from raw measurements:
kind: Processing
name: derive-temperature
namespace: metrics
sources:
- ts:
measurement: raw_temperature
field: value
sinks:
- ts:
measurement: derived_temp
value_field: value
When the source is a time-series measurement, the sink writes the source point's value and tags as they are, under the field named by value_field; operators can filter points but not change the value.
KV-Enriched Pipeline
Filter or enrich events using data stored in Flo KV:
kind: Processing
name: account-filter
namespace: production
sources:
- stream: { name: transactions }
sinks:
- stream: { name: valid-transactions }
operators:
- type: kv_lookup
name: check-account
lookup_key: "account:${$.account_id}"
namespace: production
mode: filter
Job Lifecycle
Submitting a Job
flo processing submit pipeline.yaml -n analytics
# Output: Job submitted: job-<id>
On submission, the job enters the RUNNING state and begins polling its sources immediately.
Checking Status
flo processing status job-1 -n analytics
Prints the job's id, name, status, batch size, the records it has processed since the server started, and when it was created. Status is answered by the shard's leader, which runs the job's pipelines. So a running job's status also says what it is waiting for and the last record it skipped, what the pipelines have read and written since they started there, and, for a job with a TS source, its late points (Late points):
Job: job-<id>
Name: order-analytics
Status: RUNNING
Batch size: 200
Processed: 15420 records
Created: 1700000000000ms
On this node: 15420 in, 15420 out over 61200ms; ticks avg 340us
A job with a TS source adds its late points:
Late points: at least 3, more than 30s behind their field's newest
Listing Jobs
flo processing list -n analytics
flo processing list -n analytics -o json
Stopping a Job
Stops the job: its pipelines stop reading, and it stays listed as STOPPED:
flo processing stop job-1 -n analytics
Cancelling a Job
Cancels the job; it stays listed as CANCELLED:
flo processing cancel job-1 -n analytics
Removing a Job
A stopped, cancelled or failed job keeps its definition, and counts toward the server's limit of 10,000 jobs, until it is removed. Removing it frees that slot; afterwards its id is not found:
flo processing cancel job-1 -n analytics
flo processing remove job-1 -n analytics
A running job is refused: stop or cancel it first. A submit past the limit is refused, and the refusal says to remove a job.
Job States
| State | Description |
|---|---|
RUNNING | Processing records |
STOPPED | Stopped with flo processing stop |
CANCELLED | Cancelled with flo processing cancel |
FAILED | Can't run: shown as FAILED: <reason> |
A job is FAILED when the server can't build it, for example when a stored job no longer parses after an upgrade, or an operator can't start. flo processing status and list show why:
Status: FAILED: "partitions" must be all: a stream source reads every partition; …
A failed job keeps its definition and source cursors. Submit a corrected job, and remove the failed one to free its slot.
Namespaces
A job lives in the namespace it is submitted to (-n), and is listed, inspected, stopped and changed only from there: from any other namespace its id is not found.
- A job writes only into its own namespace. A sink that names another namespace is refused at submit; so is a top-level
namespace:that differs from-n. - A job may read other namespaces: a source or a
kv_lookupcan name one, for shared reference data or to gather from several namespaces into one. - Sources, sinks and lookups that name no namespace use the job's.
- The same job name in different namespaces are independent jobs.
- On a server of more than one shard, a stream or queue sink outside
defaultmust be stored on the job's own shard. Where a stream or queue is stored follows from its name and namespace, so one stored on another shard is refused at submit, naming the sink. Use thedefaultnamespace for it, or run one shard (--shards 1). KV and time-series sinks, and sinks indefault, have no such limit.
To move data from namespace A into B, submit the job in B and have it read from A.
# These are two separate, independent jobs
flo processing submit job.yaml -n production
flo processing submit job.yaml -n staging
Persistence
Submit, stop, cancel and remove go through Raft, so jobs survive a restart:
- A
RUNNINGjob's pipelines are rebuilt on restart and keep consuming - Each pipeline resumes from its source cursor, which moves through Raft with the sink writes it covers, so no record is written twice or skipped by a restart
- Stopped and cancelled jobs stay idle, and removed jobs stay removed
- A stored job the server can't rebuild is kept as
FAILEDwith its reason, never dropped; its cursors are kept until it's removed - New job IDs don't collide with pre-restart IDs
What does not survive a restart: aggregate totals and the processed-record count, both kept in memory.
Processing Metrics
With metrics enabled, the server exports these on /metrics. Counts start from zero when the server starts.
| Metric | Description |
|---|---|
flo_processing_active_jobs | Jobs submitted and not yet stopped or cancelled |
flo_processing_jobs_submitted_total | Jobs submitted |
flo_processing_jobs_completed_total | Jobs stopped |
flo_processing_jobs_cancelled_total | Jobs cancelled |
flo_processing_records_processed_total | Records read from sources |
flo_processing_records_dropped_total | Records a sink could not write: refused before it was sent, or too large |
flo_processing_records_too_large_total | Records whose sink writes don't fit one entry (64 writes, 1 MiB) |
flo_processing_sink_batches_total | Batches of sink writes proposed, each with the source cursor it moves to |
flo_processing_ticks_held_total | Pipeline polls that couldn't read: waiting for a namespace, a halted sink shard, a full outbox, a shard that is halted, can't flush or has a full target, or the log |
flo_shard_channel_outbox_bytes{shard_id} | Bytes of writes this shard sent to other shards that they haven't yet taken |
flo_processing_pipelines_waiting_namespace | Pipelines waiting for a sink's namespace to be created |
flo_shard_channel_sink_refusals_total{shard_id,reason} | Sink writes a target on this shard refused for good, by reason |
flo_processing_errors_total | Operator chains that failed |
flo_processing_failed_jobs{shard_id} | Jobs held as FAILED on each shard; also processing_failed_jobs per shard on /status |
Not Supported Yet
The job format reserves these for event time, time windows and stateful operators, which the engine doesn't run yet. A job using one is refused at submit (and by flo validate processing), naming the key and what to use today:
| Where | Key or type | Today |
|---|---|---|
| source | event_time_field, max_delay_ms | Records are taken in the order they arrive |
| aggregate | window: tumbling, sliding or session | window: count with window_count, or no window for a running aggregate |
| aggregate | window_size_ms, window_slide_ms, session_gap_ms | window: count with window_count |
| operator | type: dedup, join, no_event_for | — |
"window": tumbling isn't supported yet; use window: count with window_count, or no window for a running aggregate at operators[2]
Changing in a later release
These work today and will be refused by a later release, with the edit to make:
partitions: allon a stream source: remove it; a job reads every partition.poll_interval_mson a stream source: remove it; a job will read as records arrive.window_sizeon a count window: usewindow_count.
Related Docs
- Streams — source and sink behavior for stream-backed pipelines
- Time-Series — TS query and write semantics
- KV — KV storage used by
kv_lookupoperator and KV sinks - Queues — queue sinks for task pipelines
- Actions — worker-hosted action registration and invocation
- Workflows — multi-step orchestration over actions