Tool nodes¶
A tool node wraps one tool from the registry and runs it once per execution.
align = g.add_node("clustalo")
Creation installs the tool¶
add_node():
waits for the container backend (Docker) to be ready;
adds the tool to the project and pulls its image (
bv add/bv sync), restoring from the on-disk image cache when present;reads the tool’s manifest (
bv show --format json) and stores it on the node.
The manifest is what the rest of the system reasons over: the tool’s typed inputs and outputs drive connector generation, and its command template drives execution. See Tools and the registry for the manifest format.
What happens when it runs¶
During execute(), a tool node:
receives its inputs (mapped from upstream outputs by the edge connectors);
is assigned a fresh output directory
results/<tool>_output_N,Nauto-increments by scanning the filesystem, so repeated runs of the same tool never collide;runs the tool in its container via
bvinside a temporary sandbox, then harvests the declared outputs back into that output directory;returns a dictionary mapping each output
nameto its produced path (a directory path fortype = "dir"outputs, a file path otherwise).
Cardinality determines composition¶
A tool input declared cardinality = "one" consumes exactly one item per run. If
an upstream produces a collection and the next tool’s input is one, you wrap
that tool in a gather node so it runs once per item, the single most
common structural decision when building a pipeline. cardinality = "many" means
the tool accepts a list directly and no gather node is needed.
Overriding the command¶
By default a node runs the manifest’s entrypoint with its argument template. Two
overrides change that; {slot} placeholders map to the node’s input/output names.
Different binary, for images that expose several programs:
g.add_node("trimal", entrypoint_override="readal")
Different argument template, to change flags or argument order:
g.add_node("colabfold",
args_override="--num-recycle 0 {fasta} {output_dir}")
Both, common when invoking a non-default binary:
g.add_node("trimal",
entrypoint_override="readal",
args_override="-in {alignment} -out {trimmed} -fasta")
Overrides replace the corresponding manifest field for that node only; everything else (image, typed I/O) is unchanged.