Skip to content

Block Reference

This reference summarizes the current canonical Flow contract. Every connection uses the logical rows channel. “Configured” below describes the specification; runtime output exists only after an execution.

Sources and execution

Block Purpose and rows Key configuration Runtime and safety notes
data_source Starts rows from inline JSON, a workspace file, or SQLite. No input; rows output. source_type; inline data; file path, format, encoding/delimiter/sheet; or SQLite database plus table/query. A bounded preview is observation, not a full Flow run. File and database paths stay within workspace rules; query mode accepts read queries beginning with SELECT or WITH.
script Runs native code against input rows and emits parsed or captured output rows. Language, source mode, source/path, working directory, timeout, environment, inputs, output mode. Separate approval, containment, bounded output, and source identity apply. See Script.

Deterministic row transforms

Row expressions use restricted Python evaluation with row fields available by name and the full row available as r or row.

Block Purpose Key configuration Runtime notes
row_filter Keep rows whose expression is truthy. expression Empty expression keeps all rows. Per-row evaluation errors are counted and drop that row rather than failing the Flow.
row_transform Replace each row with a returned object. expression Errors or non-object results keep the original row and increment error evidence.
row_expand Emit zero or more objects for each input row. expression returning a list Invalid results emit no rows for that input and increment error evidence.
row_aggregate Group rows and calculate aggregates. group_by; aggregations using sum, avg, count, max, or min Output fields use aggregate-derived names. Unknown aggregations are skipped and logged.
row_enrich Call an HTTP endpoint per row and merge a response field. URL, method, input-field mapping, output field, timeout Remote I/O can fail; per-row failures are recorded without necessarily aborting the entire Flow.
row_rank Sort rows by one field. sort_by; order asc or desc Missing key or incompatible mixed values leave ordering unchanged rather than inventing an order.
row_route Keep matching or non-matching rows. expression; matched_only Evaluation errors count as non-matches. This is row selection, not a separate visual edge channel.

Model and Memory work

Block Purpose Key configuration Runtime notes
session_summarize Summarize a durable session into rows and Memory-oriented output. Target tokens, kind, source, tags, optional session ID. Requires session evidence and can create Memory consequences; completion alone is not an exact persisted-record link.
model_call Invoke the shared model provider per row or once for a batch. Model, role, prompt, output field, mode, temperature, context/retrieval options. Provider output is non-deterministic and can fail. See Model Call.
memory_sink Write row content to durable Memory and pass rows through. Content field, kind, source, confidence, tags, tag fields, max rows, vector. Persistence must be proven separately. See Memory Sink.

Structured control flow

Control markers pass the rows stream through while the engine changes instruction order. Wire them as one ordered chain.

Block Purpose Required relationship
if_condition Evaluate one condition against row_count and rows. Must close with endif; may contain one else.
else Begin the alternate branch. Must follow an unmatched if_condition.
endif Close the current If/Else structure. Must match an earlier if_condition.
loop_start Repeat the enclosed body. times and accumulate; must close with loop_end.
loop_end Close the current loop. Must match an earlier loop_start.
break Exit the nearest active loop. Invalid outside a loop.

Validation catches unbalanced markers and cycles before execution. It does not prove that a runtime expression, provider, file, or external service will succeed.