For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Run pipelines

A pipeline is a processing graph that runs inside the executor server, not in your process. You describe it as JSON, hand it to ExecutorClient, and the executor loads each node, wires them together, and runs the data through. Your script controls the lifecycle and reads the output; it never touches the samples in between.

Understand the model

A pipeline is two lists: the nodes that do the work, and the pipes that connect them.

Each node is a compiled operator loaded from a shared library, and falls into one of three roles:

Role
Takes input
Produces output
Examples

Source

No

Yes

eegstream, nidaqstream, csvfilestream, signalgenerator

Processor

Yes

Yes

fft, bandpower, firfilter, iirfilter

Sink

Yes

No

websocket, csvrecorder, logger

A pipe names a source node and a destination node by id. Every pipeline needs at least one source and one sink; a graph of processors alone has nothing to run on and nowhere to put the result.

Nodes declare their parameters, inputs, and outputs in a manifest, which is what Manage operators and pipelines installs and lists. The executor validates a definition against those manifests, so a misspelled parameter or a pipe between incompatible nodes is caught at validatePipeline rather than at run time.

Why it runs out of process

The executor owns the graph for the same reason the bridge owns the device: the work is C++, it must keep running whether or not your script is alive, and several clients can watch one pipeline. Your process sends lifecycle commands and receives logs.

That has a consequence worth knowing early — a pipeline outlives the client that created it. Disconnecting does not stop it. Call destroyPipeline or it keeps running.

Write a pipeline definition

A definition is a plain object with nodes and pipes. This one takes live EXG from a device, runs an FFT, reduces it to band powers, and serves the result over a WebSocket:

Field
Meaning

id

Name for this node within the pipeline; pipes and signals refer to it

module_path

Absolute path to the operator's shared library

config

Parameters for that operator, as its manifest declares them

module_path carries the platform's own extension — .dylib on macOS, .so on Linux, .dll on Windows. Build the path at run time rather than hardcoding one, or the same definition fails on another machine.

Note: The eegstream node reaches the device through the same BXI interface bridge the SDK uses, at zmqAddress. It does not open its own transport, so a pipeline and an ordinary EXG stream can read one device at once.

Swap the source to run without hardware

Replacing the source node with signalgenerator gives the same graph on synthetic data, which is how the processing half gets tested without a device attached:

Nothing else in the definition changes. Because the pipes name nodes by id, repointing { "source": "gen", "destination": "fft" } is the whole edit.

Method reference

Method
Payload
Response data

createPipeline

{ pipelineId, config, deviceId? }

{ pipelineId, state, nodeCount, logEndpoint, logFile }

validatePipeline

{ config }

{ valid, message?, type?, details? }

startPipeline

{ pipelineId }

{ pipelineId, state }

stopPipeline

{ pipelineId }

{ pipelineId, state }

destroyPipeline

{ pipelineId }

{ pipelineId, state }

signalPipeline

{ pipelineId, signal, nodeIds?, args? }

{ delivered }

listPipelines

{ status? }

{ pipelines, total }

getPipelineInfo

{ pipelineId }

{ pipelineId, state, nodeCount, logEndpoint, logFile, nodes?, config? }

A pipeline is in one of five states: created, running, stopped, destroyed, or error.

Each method also has a shorter alias — create, validate, start, stop, destroy, signal, list, info — kept for backwards compatibility with existing frontend code. They are marked deprecated and forward to the methods above. Use the full names in new code.

Create and run

startPipeline then returns { pipelineId: 'eeg-recording', state: 'running' }.

createPipeline instantiates the graph without running it; startPipeline begins execution. Pass deviceId to bind the pipeline to a specific device when more than one is connected.

Validate first

validatePipeline checks a configuration without instantiating it, which is how to surface errors in a user interface before committing.

jsonData must be a JSON string. Handing it the configuration object directly does not raise — the call succeeds and reports the pipeline as invalid with Pipeline missing or invalid 'nodes' array, which reads like a problem with your graph rather than with the argument.

Note: A validatePipeline call that fails validation still returns success: true. The verdict is data.valid; success only says the request reached the executor and came back.

Signal running nodes

Omit nodeIds to broadcast to every node.

The response reports only whether the signal was delivered, not what the node did with it. Watch the pipeline log stream to confirm the effect.

Which signals a node accepts is declared in its operator metadata. Read it with operatorRegistry.info(). See Manage operators and pipelines.

Query pipelines

A node stuck in created while the others run is the usual sign of a failed start; the pipeline log stream carries the reason.

getPipelineInfo returns per-node state and the original configuration, which listPipelines omits.

Stream per-pipeline logs

Each pipeline owns a ZeroMQ PUB socket carrying its node logs and lifecycle events. Pass onPipelineLog and the client subscribes on createPipeline and unsubscribes on destroyPipeline.

entry.source is "node" for node logs and "pipeline" for lifecycle events. Node logs carry the node identifier in entry.data?.nodeId.

Subscribe manually to a pipeline this client did not create:

The second argument is the socket address from logEndpoint, not a port number.

Pipeline logs are also written to disk, at the path returned as logFile:

Each line is one JSON entry in the same format as the socket messages.

Destroy pipelines

Warning: A pipeline that is not destroyed keeps its nodes, sockets, and device claims allocated in the executor server, which outlives the SDK process. Destroy every pipeline you create, including on the error path.

Complete example

Next steps

Last updated

Was this helpful?