Operator Catalogue
Cameleon ships with 13 operators across three standard libraries. This page is the functional reference — what each operator does, what it expects, what it produces.
For implementation details (run/rollback signatures, code), see the technical docs in doc/architecture/libs/.
Overview
| Operator | Library | Description | Inputs | Outputs | Firing | Config |
|---|---|---|---|---|---|---|
| Source | std-io | Emits a static configured value | — | out_data DataString | ANY | value |
| Sink | std-io | Consumes data (terminal output) | in_data DataString | — | ANY | — |
| FileLoader | std-io | Loads a file via browser dialog | — | out_data Binary | ANY | accept |
| Fork | std-struct | Duplicates input to two outputs (AND-split) | in_data Any | out_a out_b Any | ANY | — |
| Join | std-struct | Waits for all inputs, passes first through (AND-join) | in_a in_b Any | out_data Any | ALL | — |
| Merge | std-struct | First arrived passes through (XOR-join) | in_a in_b Any | out_data Any | ANY | — |
| Gate | std-struct | Routes input based on a boolean condition (XOR-split) | in_data Any, in_condition DataBool | out_true out_false Any | COND | — |
| Barrier | std-struct | Waits for all inputs, routes each to paired output | in_a in_b Any | out_a out_b Any | ALL | — |
| Transform | std-data | Converts any data to string | in_data Any | out_data DataString | ANY | — |
| Format | std-data | Concatenates two strings with separator | in_main in_meta DataString | out_data DataString | ALL | separator |
| JSONParse | std-data | Parses a JSON string into an object | in_data DataString | out_data DataJSON | ANY | — |
| JSONStringify | std-data | Serializes an object to JSON string | in_data DataJSON | out_data DataString | ANY | pretty |
| Template | std-data | Replaces {{key}} placeholders with values | in_template DataString, in_data DataJSON | out_data DataString | ALL | — |
Firing policies : - ANY — fires when at least one input is NEW (or no inputs for sources) - ALL — fires when all inputs are NEW - COND — fires when a custom condition is met (see operator details)
I/O — std-io
Entry and exit points of a pipeline. Data sources and sinks.
Source
Emits a static value configured in advance. This is the most common entry point of a composition — it injects an initial value into the pipeline without receiving anything.
No inputs — Source fires when all its outputs are EMPTY (ready to receive).
| Output | Type | Label |
|---|---|---|
out_data | DataString | data |
Config
| Parameter | Type | Default |
|---|---|---|
value | string | "Hello from Source" |
Sink
Consumes data and logs it. This is the terminal output of a pipeline — nothing comes out of a Sink. Use it to observe results in the CVM Log.
| Input | Type | Label |
|---|---|---|
in_data | DataString | data |
No outputs, no config.
FileLoader
Opens a file picker dialog and loads the selected file as binary data. Browser only — does not work in CLI mode. Async: the operator stays in RUNNING state until the user selects a file.
Supports cancellation via the CVM abort signal.
No inputs — FileLoader fires like a source.
| Output | Type | Label |
|---|---|---|
out_data | Binary | data |
Config
| Parameter | Type | Default |
|---|---|---|
accept | string (MIME filter) | "/" |
Control Flow — std-struct
Routing, merging, and synchronization. Pure token routing — no data transformation. All plug types are Any, meaning they accept any data type.
Aligned with standard workflow patterns (van der Aalst, WCP).
Fork
Duplicates a single input to two outputs. Both branches receive the same data. This is the AND-split pattern (WCP-2): all branches are activated.
| Input | Type | Label |
|---|---|---|
in_data | Any | data |
| Output | Type | Label |
|---|---|---|
out_a | Any | A |
out_b | Any | B |
Firing : ANY — fires as soon as in_data is NEW.
Join
Synchronization barrier — waits for both inputs before producing output. Passes in_a through to out_data; in_b is consumed but its value is discarded. This is the AND-join pattern (WCP-3).
| Input | Type | Label |
|---|---|---|
in_a | Any | A |
in_b | Any | B |
| Output | Type | Label |
|---|---|---|
out_data | Any | data |
Firing : ALL — fires only when both in_a AND in_b are NEW.
Merge
First-arrived passes through. If both inputs arrive simultaneously, in_a has priority. This is the XOR-join pattern (WCP-5): only one branch is consumed per firing.
| Input | Type | Label |
|---|---|---|
in_a | Any | A |
in_b | Any | B |
| Output | Type | Label |
|---|---|---|
out_data | Any | data |
Firing : ANY — fires as soon as at least one input is NEW.
Gate
Conditional routing — examines a boolean condition and routes the input data to one of two outputs. This is the XOR-split pattern (WCP-4).
| Input | Type | Label |
|---|---|---|
in_data | Any | data |
in_condition | DataBool | condition |
| Output | Type | Label |
|---|---|---|
out_true | Any | true |
out_false | Any | false |
Firing : COND — custom rule: fires only when both in_data AND in_condition are NEW. This is stricter than ALL because Gate uses a canFire() override.
Routing rule : if in_condition is truthy, data goes to out_true; otherwise to out_false. The unused output stays EMPTY.
Barrier
Synchronized passthrough — waits for all inputs, then routes each to its paired output. This is equivalent to Join + Fork but preserves the identity of each input: in_a goes to out_a, in_b goes to out_b.
Extension Cameleon — no standard WCP equivalent.
| Input | Type | Label |
|---|---|---|
in_a | Any | A |
in_b | Any | B |
| Output | Type | Label |
|---|---|---|
out_a | Any | A |
out_b | Any | B |
Firing : ALL — fires only when both in_a AND in_b are NEW.
Data — std-data
Data transformation and formatting. Converts, formats, parses, and templates data flowing through the pipeline.
Transform
Converts any data to a string representation. Simple type conversion — equivalent to calling String(value).
| Input | Type | Label |
|---|---|---|
in_data | Any | data |
| Output | Type | Label |
|---|---|---|
out_data | DataString | data |
Firing : ANY.
Format
Concatenates two strings with a configurable separator. Useful for building labels, log lines, or display strings from two parts.
| Input | Type | Label |
|---|---|---|
in_main | DataString | main |
in_meta | DataString | meta |
| Output | Type | Label |
|---|---|---|
out_data | DataString | data |
Firing : ALL — waits for both inputs.
Config
| Parameter | Type | Default | |
|---|---|---|---|
separator | string | `" \ | "` |
JSONParse
Parses a JSON string into a structured object. If the input is not valid JSON, the operator transitions to FAILED state.
| Input | Type | Label |
|---|---|---|
in_data | DataString | data |
| Output | Type | Label |
|---|---|---|
out_data | DataJSON | data |
Firing : ANY.
Error : FAILED if input is not valid JSON.
JSONStringify
Serializes a structured object to a JSON string. Optionally formats with indentation for readability.
| Input | Type | Label |
|---|---|---|
in_data | DataJSON | data |
| Output | Type | Label |
|---|---|---|
out_data | DataString | data |
Firing : ANY.
Config
| Parameter | Type | Default |
|---|---|---|
pretty | boolean | false |
When pretty is true, the output is indented with 2 spaces.
Template
String interpolation — replaces {{key}} placeholders in a template string with values from a JSON object. Missing keys are replaced with an empty string.
| Input | Type | Label |
|---|---|---|
in_template | DataString | template |
in_data | DataJSON | data |
| Output | Type | Label |
|---|---|---|
out_data | DataString | data |
Firing : ALL — waits for both the template and the data.
Example : template "Hello {{name}}" + data {"name": "Alice"} → "Hello Alice".