Skip to main content

Data Flow

Data connections define how outputs from one metaframe become inputs to another. Connections are declared in metapage.json or configured via the metapage editor.

Loading diagram...

Connection parameters

A connection has two optional parameters:

  1. Source glob — which outputs to forward from the source. Empty or ** means all outputs.
  2. Target path — how to name/place the data in the target. Empty means keep the original path.

Output filtering (source glob)

The source glob uses glob pattern matching:

PatternDescriptionExample match
** or emptyAll outputsEverything
*.jsonFiles with specific extensiondata.json but not data/info.json
**/*.jsonExtension in any directoryBoth data.json and data/info.json
data/*Files in a specific directorydata/file.txt but not data/sub/file.txt
**/report*Name pattern in any directoryreport.csv, data/report_final.pdf

Filter behavior examples:

Output nameFilterForwarded?
any(empty)
any**
foo.bar*.bar
dir1/foo.bar*.bar
dir1/foo.bar**/*.bar
dir1/foo.bar**/foo*

Input mapping (target path)

TypeDefinitionResult
EmptyLeave target path emptyFiles keep their original names and paths
Directory prefix (ends with /)e.g. incoming/Files are placed under that directory in the target
File rename (no trailing /)e.g. result.csvSource output is renamed to this name

Full examples

ConnectionSource outputTarget inputDescription
*.json → data/results.jsondata/results.jsonSend all JSON to a folder
report.csv → summary.csvreport.csvsummary.csvRename a specific file
** → (empty)data/file.txtdata/file.txtPass through unchanged
**/*.csv → reports/june/sales.csvreports/june/sales.csvNested CSV to folder

Data types by metaframe type

Container (Docker) metaframes

Container inputs and outputs are files:

  • Inputs arrive at /inputs/ inside the container ($JOB_INPUTS)
  • Outputs are read from /outputs/ when the container exits ($JOB_OUTPUTS)
  • Large files are stored in cloud storage; only a reference URL is routed through the message layer

JavaScript metaframes

JavaScript frames send and receive values directly via the metapage module API:

// Receive inputs
export function onInputs(inputs) {
const value = inputs["myKey"]; // inputs is a plain object
}

// Send a single output
setOutput("result", 42);

// Send multiple outputs
setOutputs({
result: true,
data: [1, 2, 3],
});

Supported output types: strings, numbers, booleans, JSON objects/arrays, ArrayBuffer, typed arrays, File, Blob.