Use case: ETL
An open standard for your own ETL blocks
An extract, transform or load step you write today belongs to the tool you wrote it for. OpenFlange describes the step itself as a pipe, with its ports, parameters and licence in one small file, so the block is yours and any tool that implements the standard can run it.
The problem
An ETL step is written for a tool, not for the data.
The logic is usually a few lines: read a file, fix the types, drop the bad rows. What ties it to one product is everything around those lines.
The plugin API
The step extends the tool’s own operator, component or node type. Its inputs and outputs exist only as that tool’s objects.
A pipe declares named ports with kinds. There is no base class to inherit from.
The runtime
The step runs only inside the tool’s worker, with its context object and its way of handing data to the next step.
One contract, whether the step runs in-process, as a subprocess or over HTTP.
The configuration format
Parameters live in the tool’s project files or forms. Moving the step means entering them again, by hand, somewhere else.
Parameters are declared in the manifest, with types and defaults.
Change the tool and the step is written again, although what it does to the data has not changed.
Extract, transform, load
Each stage is a pipe with a declared contract.
A pipe is a directory with a file called OPENFLANGE.md. Its header says what the step takes, what it gives, which parameters it accepts and under which licence it is published. The excerpts below come from the standard library; your own blocks declare the same things.
Extract
A source has outputs and no inputs.
std:file-sourcereads an NDJSON file and emits records; the path is a parameter, and reading it needs afilesystem.readgrant. CSV text becomes records withstd:csv-decode.In the catalogue:
std:file-sourcestd:csv-decodestd:http-sourcestd/0.1/file-source/OPENFLANGE.md — excerptid: file-source license: Apache-2.0 outputs: out: {kind: records} parameters: path: {type: string, required: true}Transform
A transformation takes records and gives records.
std:castconverts fields to JSON types, exactly or not at all. WithonError: reject, records it cannot convert leave through a second, optional output instead of disappearing.In the catalogue:
std:caststd:filterstd:validate-schemastd/0.1/cast/OPENFLANGE.md — excerptid: cast license: Apache-2.0 inputs: in: {kind: records} outputs: out: {kind: records} rejected: {kind: records, required: false, description: "Items with un-castable members, wrapped as {item, errors}."} parameters: fields: {type: object, required: true, description: "Map of member name to string|integer|number|boolean."} onError: {type: string, enum: [fail, reject], default: fail}Load
A sink has inputs and no outputs.
std:file-sinkwrites records to an NDJSON file and needs afilesystem.writegrant for the path. Loading into your own database is a pipe you write; the standard defines its contract, not the connector.In the catalogue:
std:file-sinkstd:csv-encodestd:stdoutstd/0.1/file-sink/OPENFLANGE.md — excerptid: file-sink license: Apache-2.0 inputs: in: {kind: records} parameters: path: {type: string, required: true} append: {type: boolean, default: false}
Composition
The pipeline only says which output feeds which input.
Four standard pipes connected in pipeline.yaml. Each input names the output it reads from, and the grants say which directories the source and the sink may touch. Records that fail the schema leave through the pipeline’s rejected output.
spec: openflange.org/pipeline/v0.1
nodes:
extract:
pipe: std:file-source
parameters:
path: ./data/orders.ndjson
grants:
filesystem: {read: ["./data"]}
typed:
pipe: std:cast
inputs:
in: {from: extract.outputs.out}
parameters:
fields: {quantity: integer, amount: number}
checked:
pipe: std:validate-schema
inputs:
in: {from: typed.outputs.out}
parameters:
schema:
type: object
required: [id, amount]
load:
pipe: std:file-sink
inputs:
in: {from: checked.outputs.valid}
parameters:
path: ./out/orders.ndjson
grants:
filesystem: {write: ["./out"]}
outputs:
rejected: {from: checked.outputs.rejected}Illustration, not a published example
This file was written for this page. It uses standard pipes only and passes openflange validate in the reference runner.
Replace any node with your own pipe that has the same ports, and the rest of the file stays as it is.
Same block, four callers
Write the block once. Call it from where the work is.
The contract does not change with the caller. What exists today differs from one caller to the next, and each card says so.
From a terminal
The reference runner executes a pipe or a whole pipeline as an ordinary command: records in on standard input, records out on standard output.
bashprintf '%s\n' '{"id":1,"amount":"19.90"}' \ | openflange run std:cast --param 'fields={"amount":"number"}' # {"id":1,"amount":19.90}Over HTTP
Serve the same pipe, and any HTTP client opens a session and streams records in and out.
bashopenflange serve std:cast # POST …/sessions, POST input, GET outputIn a query (TugQL)
Pass the result of a query through a block instead of waiting for the query language to grow a function. The table form is available in the
tugqlGo package (dal-go/dalgo, merged to main, not yet tagged); the scalar form is proposed.TugQL — draft syntaxpipes ( lower = 'openflange/lowercase@^0.1' mask = 'openflange/mask-email@^0.1' ) with Emails as ( from Customers as c select c.Id, c.Email ) | lower | mask from Emails as e select e.Id, e.EmailOn a canvas (DataTug)
DataTug is being built to draw the same pipelines as boxes and arrows and to run them with your databases as sources. It is one implementation of the standard, not a requirement.
Vendor-neutral
Small specifications. No vendor in the middle.
Each document fixes one thing and is versioned on its own. For one ETL block you need the first; for a pipeline, the first two.
Pipe specification
The contract of one block: ports with kinds, parameters, permissions and licence.
Pipeline specification
How blocks are connected, checked before they run, and executed.
Standard library
The portable blocks a runner provides under the
std:prefix.Portable tests
Tests that travel with a block and run on any runner.
Lockfile
Pins every reference, so the next run uses exactly the same blocks.
Changes to the standard are proposed and decided in public, by RFC and pull request: see governance. The text is licensed CC BY 4.0, schemas and code Apache-2.0. No account, registry or hosted service is required.
Every standard pipe is listed with its ports, parameters and a worked example in the standard pipes catalogue on openflange.dev.
Scope
What the standard is not.
It standardises the block and the connection between blocks. Everything else stays with the tools you already use.
Not a scheduler
It does not decide when a pipeline runs, and it does not retry it overnight. Start it from cron, CI or the scheduler you already have.
Not a warehouse
It does not store or query your data. Records stream in and out; where they rest is your choice.
Not a catalogue of connectors
The standard library is a small set of generic pipes for files, HTTP, CSV, JSON, filtering and windows, not hundreds of connectors to named products. A connector is a pipe you write, or one that somebody publishes.
The same use case on the other two sites
To build, test and lock an ETL pipeline from the command line, continue on openflange.dev. To look at published blocks and their contracts before you run them, go to openflange.com.
One problem, four entry points
ETL across OpenFlange
- openflange.org
The standard
An open standard for your own ETL blocks: each step is a pipe with a declared contract.
- openflange.com
The blocks
Building blocks for your ETL: extract, transform and load steps you can read before you run.
- openflange.dev
The platform
A platform for your ETL: build, test and lock a pipeline from the command line.
- datatug.app
DataTug
Visual builder and out-of-the-box runner for ETL. Pipelines in DataTug are in development.