Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

Use case: ETL

Draft v0.1 · Experimental

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.

  1. Extract

    A source has outputs and no inputs. std:file-source reads an NDJSON file and emits records; the path is a parameter, and reading it needs a filesystem.read grant. CSV text becomes records with std:csv-decode.

    std/0.1/file-source/OPENFLANGE.md — excerpt
    id: file-source
    license: Apache-2.0
    outputs:
      out: {kind: records}
    parameters:
      path: {type: string, required: true}
  2. Transform

    A transformation takes records and gives records. std:cast converts fields to JSON types, exactly or not at all. With onError: reject, records it cannot convert leave through a second, optional output instead of disappearing.

    std/0.1/cast/OPENFLANGE.md — excerpt
    id: 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}
  3. Load

    A sink has inputs and no outputs. std:file-sink writes records to an NDJSON file and needs a filesystem.write grant for the path. Loading into your own database is a pipe you write; the standard defines its contract, not the connector.

    std/0.1/file-sink/OPENFLANGE.md — excerpt
    id: 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.

Extract, transform and load as four connected pipesstd:file-sourceExtractstd:castTransformstd:validate-schemaTransformstd:file-sinkLoadoutput: rejected
Extract, transform and load as four connected pipesstd:file-sourceExtractstd:castTransformstd:validate-schemaTransformstd:file-sinkLoadoutput:rejected
std:file-source reads the file, std:cast and std:validate-schema transform the records, std:file-sink writes the valid ones. Invalid records leave through a separate output.
pipeline.yaml — illustration
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.

Pipeline specification

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.

    bash
    printf '%s\n' '{"id":1,"amount":"19.90"}' \
      | openflange run std:cast --param 'fields={"amount":"number"}'
    # {"id":1,"amount":19.90}
    Available — v0.0.1 (experimental)CLI reference
  • Over HTTP

    Serve the same pipe, and any HTTP client opens a session and streams records in and out.

    bash
    openflange serve std:cast
    # POST …/sessions, POST input, GET output
    Available — v0.0.1 (experimental)HTTP Pipe Protocol
  • In 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 tugql Go package (dal-go/dalgo, merged to main, not yet tagged); the scalar form is proposed.

    TugQL — draft syntax
    pipes (
      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.Email
    Available from sourceSyntax on tugql.org
  • On 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.

    In development

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.

    Maturity: Experimentalv0.1
  • Pipeline specification

    How blocks are connected, checked before they run, and executed.

    Maturity: Experimentalv0.1
  • Standard library

    The portable blocks a runner provides under the std: prefix.

    Maturity: Experimentalv0.1
  • Portable tests

    Tests that travel with a block and run on any runner.

    Maturity: Experimentalv0.1
  • Lockfile

    Pins every reference, so the next run uses exactly the same blocks.

    Maturity: Experimentalv0.1

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.

    You are here
  • 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.

    In development