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.

openflange CLI: Available — v0.0.1 (experimental)

Quickstart

Install the CLI, turn one line of logic into a reusable step, check it, run it, and connect it to a second step. About five minutes once Go is installed.

Install the CLI

You need Go 1.27 or newer, a terminal and a text editor. One command builds the openflange binary of release v0.0.1 and puts it in your Go bin directory:

bash
go install github.com/openflange/openflange-go/cmd/openflange@v0.0.1

v0.0.1 is experimental

v0.0.1 is the first release and is experimental: the format may still change before 1.0 (changelog). Prebuilt binaries and a Homebrew formula are planned. For the latest development version, use @main instead of @v0.0.1.

Check that it is on your PATH. The second line is what it printed on the Linux machine where this guide was checked; yours shows your own Go version and platform.

bash
openflange version
# openflange 0.0.1 (go1.27.1 linux/amd64)

You can also clone the repository and build it there. You will want the clone anyway: step 4 copies a pipe from it, and every example runs from it.

bash
# or, from a clone (git checkout v0.0.1 for the release):
git clone https://github.com/openflange/openflange-go
cd openflange-go
go build -o openflange ./cmd/openflange && export PATH="$PWD:$PATH"

The steps in this guide run inside the runner itself (Starlark), so there is no other language to install.

1. Write a pipe

A pipe is a directory with one file in it: OPENFLANGE.md. The header is the contract; the rest is your documentation.

pipes/lowercase/OPENFLANGE.md
---
spec: openflange.org/pipe/v0.1
id: lowercase
version: 0.1.0
inputs:
  text: {schema: {format: json-schema, definition: {type: string}}}
outputs:
  text: {schema: {format: json-schema, definition: {type: string}}}
implementation:
  type: expression
  language: starlark
  expression: text.lower()
---
# Lowercase
Implements the [OpenFlange](https://openflange.org/) specification.

Read it top to bottom: it takes one input called text, gives one output called text, both strings, and the work is the expression text.lower(). The link to openflange.org is required, and it must be a visible link.

Create the directory pipes/lowercase and save the file there. In a hurry? openflange init ./my-pipe scaffolds a working pipe of the same shape, with a test.

2. Validate it

Check the contract before running anything. Mistakes are reported with a code and a location.

bash
openflange validate ./pipes/lowercase

It answers:

text
valid: ./pipes/lowercase (1 node, 2 edges)

3. Run it

One input and one output means stdin and stdout. Each line is one JSON value, so a string keeps its quotes.

Input (stdin)
"Alice@Example.COM"
Command
printf '%s\n' '"Alice@Example.COM"' \
  | openflange run ./pipes/lowercase
Output (stdout)
"alice@example.com"

4. Connect two pipes

Add a second pipe, mask-email, that hides the middle of the address. It is a short Starlark script with its own manifest, so copy it from your clone of the repository instead of typing it:

bash
cp -r openflange-go/examples/email/pipes/mask-email pipes/

Then write the file that connects them. Each input says which output it reads from.

Two pipes with named ports. The input email goes into lowercase (port text to port text), then into mask-email (port email to port email). Alice@Example.COM becomes alice@example.com, then a***e@example.com."Alice@Example.COM""alice@example.com""a***e@example.com"input: emaillowercasetexttextmask-emailemailemailoutput: email
Two pipes with named ports. The input email goes into lowercase (port text to port text), then into mask-email (port email to port email). Alice@Example.COM becomes alice@example.com, then a***e@example.com."Alice@Example.COM""alice@example.com""a***e@example.com"input: emaillowercasetexttextmask-emailemailemailoutput: email
pipeline.yaml
spec: openflange.org/pipeline/v0.1
nodes:
  lowercase:
    pipe: ./pipes/lowercase
    inputs:
      text: {from: inputs.email}
  mask:
    pipe: ./pipes/mask-email
    inputs:
      email: {from: lowercase.outputs.text}
    parameters:
      character: "*"
outputs:
  email: {from: mask.outputs.email}

Validate the whole graph and print the plan the runner will execute:

bash
openflange validate ./pipeline.yaml --plan
text
PLAN ./pipeline.yaml
INPUTS
  email  records
NODES (execution order)
  1. lowercase  ./pipes/lowercase  [starlark, local-go]
       pipe    lowercase@0.1.0
       in      text <- inputs.email
       out     text -> mask.inputs.email
  2. mask  ./pipes/mask-email  [starlark, local-go]
       pipe    mask-email@0.1.0
       params  character="*" preserveFirst=1 preserveLast=1
       in      email <- lowercase.outputs.text
       out     email -> outputs.email
       out     rejected -> (not connected)
OUTPUTS
  email  values  <- mask.outputs.email
EDGES
  inputs.email -> lowercase.inputs.text  application/x-ndjson
  lowercase.outputs.text -> mask.inputs.email  application/x-ndjson
  mask.outputs.email -> outputs.email  application/x-ndjson
CONVERSIONS
  (none)
valid: ./pipeline.yaml (2 nodes, 3 edges)

Then run it:

Input (stdin)
"Alice@Example.COM"
Command
printf '%s\n' '"Alice@Example.COM"' \
  | openflange run ./pipeline.yaml
Output (stdout)
"a***e@example.com"

The rules of mask-email for short and invalid addresses are in the email-masking example.

5. Test it

A test is a small YAML file beside the manifest: inputs in, expected outputs out. It travels with the pipe, so anyone who reuses it can re-run it.

pipes/lowercase/tests/lowercase.test.yaml
spec: openflange.org/test/v0.1
tests:
  - name: lowercases mixed case
    inputs:
      text: {values: ["Alice@Example.COM"]}
    expect:
      outputs:
        text:
          values: ["alice@example.com"]
bash
openflange test ./pipes/lowercase

The timing differs from run to run:

text
pipes/lowercase/tests/lowercase.test.yaml
  ok    lowercases mixed case
ok 1 test passed in 1 file (8ms)

6. Lock it

Record exactly what each reference resolved to, commit that file, and run against it. A locked run refuses anything that has changed since (E_LOCK, exit status 2).

bash
openflange resolve
# ok: 2 references locked in openflange.lock.yaml (2 added, 0 changed)
printf '%s\n' '"Alice@Example.COM"' | openflange run ./pipeline.yaml --locked
# "a***e@example.com"

Prefer a visual designer?

DataTug is the tool to build pipelines visually and to execute them using different databases as sources: design the pipeline on a canvas, feed it from a query against SQL Server, PostgreSQL, SQLite, DuckDB or another database, preview each step’s output, and materialise the result into a DuckDB dataset. It reads and writes the same OPENFLANGE.md and pipeline.yaml files as this guide.

In development OpenFlange does not need DataTug. It is the first visual implementation, and any tool can implement the standard.

Illustration of the email-masking pipeline on a visual canvas: a SQL query source feeds lowercase, then mask-email, and the result is materialised into a DuckDB dataset.SQL queryyour databaselowercasetext → textmask-emailemail → emailDuckDB datasetmaterialised result
Illustration of the email-masking pipeline on a visual canvas: a SQL query source feeds lowercase, then mask-email, and the result is materialised into a DuckDB dataset.SQL queryyour databaselowercasetext → textmask-emailemail → emailDuckDB datasetmaterialised result
Illustration, not a product screenshot: the same two pipes on a canvas, fed by a SQL query and materialised into a DuckDB dataset.