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:
go install github.com/openflange/openflange-go/cmd/openflange@v0.0.1v0.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.
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.
# 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.
---
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.
openflange validate ./pipes/lowercaseIt answers:
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.
"Alice@Example.COM"printf '%s\n' '"Alice@Example.COM"' \
| openflange run ./pipes/lowercase"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:
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.
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:
openflange validate ./pipeline.yaml --planPLAN ./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:
"Alice@Example.COM"printf '%s\n' '"Alice@Example.COM"' \
| openflange run ./pipeline.yaml"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.
spec: openflange.org/test/v0.1
tests:
- name: lowercases mixed case
inputs:
text: {values: ["Alice@Example.COM"]}
expect:
outputs:
text:
values: ["alice@example.com"]openflange test ./pipes/lowercaseThe timing differs from run to run:
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).
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.