Bioflow AI

Workflow Connections and Validation

Connect node ports, configure CODE, subgraphs and ForEach, and resolve common workflow validation errors

A workflow connection represents a data dependency: an upstream output port connects to a downstream input port, which consumes that data during analysis. This guide covers the connection rules for manually edited, agent-built and imported workflows.

Connect inputs to results

  1. Choose the execution scope. Sample-level workflows process an individual sample; project-level workflows handle project data and cross-sample aggregation. Subgraphs must use the same scope as their parent.
  2. Add data sources. Examples include File Input, Pair-end Reads Input, String Value, Text File and reference genomes.
  3. Add analysis nodes. Follow each tool's port descriptions to connect files, directories or strings to the appropriate inputs. Paired-end reads typically connect through separate r1 and r2 outputs.
  4. Complete inputs and parameters. Each input port on a tool or ordinary subgraph needs one connection. Insert processors to select files, collect files or bind script parameters where needed.
  5. Connect subsequent analysis or result nodes. Use Sample Mark / Project Mark to register reusable results, or Image Preview to display an image.
  6. Save and resolve validation errors. Fix errors before saving or running. Deleting nodes, removing edges or changing subgraph interfaces also requires repairing affected inputs.

A paired-end analysis followed by another tool might look like this:

Pair-end Reads Input.r1 ──→ Tool's R1 input
Pair-end Reads Input.r2 ──→ Tool's R2 input
Tool's results directory ──→ Select File in Folder.folder_path
Select File in Folder.file_path ──→ Next tool's file input

“R1 input” and “results directory” are illustrative names. Each tool definition determines its actual ports; use the ports displayed on your node.

Agent changes, saves and pre-execution checks use the same rules. The canvas can temporarily contain an unfinished graph; that does not mean it has passed validation. A workflow with missing required inputs cannot be saved.

Rules for every connection

  • Connect existing ports. Both nodes and their output/input ports must exist. Recheck old edges after changing a tool or subgraph port.
  • Follow the direction. Connect an output to an input, never an input to an input or an output to an output.
  • Avoid duplicate bindings. An upstream output can connect to the same downstream input only once. Subgraph expansion must not produce duplicate bindings either.
  • Keep the graph acyclic. A connection such as A → B → C → A is rejected. Use ForEach to repeat analysis over a collection of files.
  • Outputs may be unused or branch. An ordinary output may have no consumer or feed several different inputs. ForEach's collection output has additional restrictions described below.

How many incoming connections are allowed?

Limits apply to each input port, not to the node as a whole.

NodeInput rule
ToolExactly one connection per declared input port; tools without input ports need none
Ordinary SubgraphExactly one connection per public input port; subgraphs without public inputs need none
Most ProcessorsAt least one connection per input port; validation allows several upstream sources on the same port
ForEach file-collection processor (collect_file_collection)Exactly one connection to folder_path
NCBI Reference GenomeConnect at least one of species_name and ncbi_tax_id; both may be connected
Bash / Python / R CODEZero or more inputs; every incoming connection must originate from Bind Parameter
Downstream SummaryAt least one connection to input_files; multiple upstream sources are allowed; no output ports
Image PreviewAt most one connection to image_path; it may remain unconnected
NoteNo data connections
Other resources and String ValueNo input ports; they provide outputs directly

For example, connect several files to Copy Files to Folder's files input, then connect its folder_path output to a tool's directory input. Do not connect several files directly to the same tool input port.

The current canvas prevents dragging another edge onto an already connected input port. You can create processor fan-in through the agent or workflow import; backend validation still applies the rules in the table.

Connect common processors

ProcessorInput → outputUsage
Select File in Folderfolder_path → file_pathSelect a file from an upstream directory using file_name
Read File Contentfolder_path → valueRead text from a file in a directory and pass its content to a string input
Join Pathbase_path → pathAppend relative_path to an upstream path
Copy Files to Folderfiles → folder_pathCollect files into the output directory named by folder_name
Collect Mount Directoriesdirs → mount_dir_listCollect tool working directories for a tool directory input that supports mount-list expansion
Rename Fileold_file → renamed_fileRename a file using new_file_name
Compressinput_path → compressed_pathSet the compression format and output file name
Decompresscompressed_path → output_pathDecompress a file or extract an archive
Bind Parameterfile → file_with_paramSpecify a CODE input parameter using parameter
Sample Mark / Project Markfile → noneRegister a result for the current sample or project
ForEach file-collection processorfolder_path → collectionSelect files with pattern, then connect a subgraph

Passing the connection-count check does not mean every file operation is suitable for several upstream inputs. Use Copy Files to Folder when collecting files, and Collect Mount Directories when collecting mount directories.

Parameter rules

ParameterRequirement and example
Read File Content's file_nameA nonempty relative file name or glob, such as report.tsv or *.txt; no absolute path, ., .. path component or backslash
Join Path's relative_pathA nonempty relative path, such as results/report.tsv; no absolute path, ., .. path component or backslash
Rename File's new_file_name, Text File's file_nameA single nonempty file name, such as samples.tsv; no directory path, ., .. or backslash
Compresscompressed_file_name must be a file name with a suffix matching compression_format; for example, results.tar.gz with .tar.gz
Text File's contentAt most 5 MiB of UTF-8 content
ForEach's patternMust not be empty or whitespace-only; use a glob relative to the directory, such as *.fasta
ForEach's subfolder_prefix1–64 characters; starts with an ASCII letter or digit, followed by ASCII letters, digits, ., _ or -; defaults to item
Mark's mark_name1–50 characters; starts with a lowercase letter, followed by lowercase letters, digits or underscores; for example, aligned_bam
Sample Mark Collection's mark_namesAt least one name; each name follows the same Mark naming rules

Compress supports .zip, .tar, .tar.gz, .tar.bz2, .tar.xz, .gz, .bz2 and .xz. The stream formats .gz, .bz2 and .xz are for regular files. Use an archive format such as .tar.gz to package a directory.

Bind parameters before CODE inputs

Bash, Python and R nodes receive inputs through input_files. Each upstream node must be Bind Parameter (bind_param). Do not connect a resource, tool output or subgraph interface directly to CODE.

File Input.file_path ──→ Bind Parameter.file
                         parameter = --input-file
Bind Parameter.file_with_param ──→ Python CODE.input_files
Python CODE.output_folder ──→ Select File in Folder.folder_path

For several file parameters, add the corresponding Bind Parameter nodes and connect them to CODE's input_files. Choose distinct options that match the script, such as --input-file for Python or -f for Bash. The Python / R runners require options to start with - and reject duplicate options. A public subgraph input should likewise bind to an internal Bind Parameter's file input before reaching CODE.

Scripts that do not need file inputs can leave input_files unconnected. Passing connection validation confirms the input source, not whether the script will run successfully.

Connect subgraphs through interfaces

A subgraph needs an interface definition. Its parent connects only to public inputs and outputs, not directly to internal nodes.

InterfaceRule
Public inputBinds to at least one existing internal input port; it may feed several internal nodes, but cannot repeat the same target
Public outputSpecifies one existing internal output port as its source
Port identityIDs are unique within the input list and within the output list; display names may change
Internal inputAn interface binding counts as an incoming connection; a tool input cannot be supplied by both an interface and an internal edge
Execution scopeMatches the parent workflow; sample-level and project-level scopes cannot be mixed
NestingAt most 32 levels; interfaces and internal connections at every level must pass validation

An ordinary subgraph may have no public inputs or outputs, depending on its internal structure. All internal nodes must still satisfy their own input rules. A subgraph used by ForEach must declare at least one public output.

After changing internal ports, check both interface bindings and parent edges. For example, deleting a node referenced by an interface requires removing or rebinding that interface port.

Repeat analysis over files with ForEach

ForEach uses a file-collection processor and an ordinary subgraph. Connect collection to the subgraph input that varies per file; connect shared data to the remaining inputs.

File Input (FASTA directory).file_path ──→ ForEach.folder_path
                                          pattern = *.fasta
ForEach.collection ──→ Analysis subgraph's fasta input (one file per run)
Reference genome output ──→ Analysis subgraph's reference input (shared)
Analysis subgraph.results_folder ──→ Downstream aggregation or file processing

Follow these rules:

  1. The file-collection processor's folder_path accepts exactly one upstream directory.
  2. collection connects only to one input of an ordinary subgraph. It cannot feed a Tool, CODE or another processor directly, or branch to several targets.
  3. A subgraph accepts at most one file collection. The connected port is the per-item input, regardless of its position in the interface list. Other inputs are shared and still require one connection each.
  4. The collection output may remain unused while constructing the graph. Connecting it to a subgraph activates batch rules.
  5. The batch subgraph must declare at least one public output. Its parent can use only results_folder, not the ordinary subgraph's original output ports. Reconnect any existing downstream edges.
  6. The port ID collection is reserved for the batch input and cannot identify a shared input on that subgraph. The collection processor's own collection cannot be exposed as a subgraph output; expose the batch results_folder instead.
  7. The batch subgraph and its nested subgraphs cannot contain another collection / ForEach, Sample Mark or Project Mark. Register results with a Mark outside the batch boundary.

Use the same “file-collection processor → ordinary subgraph” structure in imported JSON. Do not manually create internal foreach nodes or fixed-path run nodes.

Execution scope and Marks

RuleSample-level workflowProject-level workflow
Register an outputUse Sample MarkUse Project Mark
Sample Mark CollectionNot allowedCollects Mark results across project samples
A sample: reference in File InputMay refer to the current sample's input or resultNot allowed; use Sample Mark Collection for cross-sample aggregation

A Mark's file input must be connected. Mark names cannot repeat within a graph. With project context, validation also checks whether the name is already occupied by a corresponding project or sample resource. Choose another name or resolve the existing mapping before submitting.

Sample Mark Collection has two outputs with different uses: collection_manifest is a JSON file describing the collected results; mount_collection is a mount collection for container tools and should connect directly to a tool directory input that supports it. Do not treat the latter as an ordinary file for CODE or file processors.

Presentation nodes

  • Note provides annotations and has no data connections. Its optional anchor must refer to an existing non-Note node in the current graph.
  • Image Preview accepts one image_path connection to display an image. It cannot supply data to other nodes.
  • Neither Note nor Image Preview can be a public subgraph output. Note cannot receive an interface binding either.

Resolve validation errors

Validation can report several issues at once. Each error identifies its type, message and relevant node, edge or subgraph location. Use those locations to repair each issue.

Error typeCommon causeFix
input.missingA required tool, processor or subgraph input is unconnected, or both NCBI inputs are emptyComplete the connections; valid interface bindings can supply internal subgraph inputs
input.multipleA tool / subgraph input has several suppliers, or Image Preview has too many inputsKeep one upstream source; collect files with an appropriate processor before a tool input
edge.node / edge.portAn edge references a deleted node or nonexistent portSelect an existing node and its current port
edge.duplicateA repeated edge or duplicate binding after subgraph expansionRemove the repeated edge or interface target
graph.cycleConnections form a dependency cycleRemove the back edge; use ForEach for per-file repetition
code.sourceCODE receives a resource, tool or interface input directlyInsert Bind Parameter before CODE
interface.port / subgraph.interfaceA binding is invalid or the interface definition is missingRepair public input/output bindings
collection.* / foreach.*Invalid collection target, count, batch output or internal nodeReconfigure the ForEach structure as described above
node.context / subgraph.scope / mark.storageScope mismatch, duplicate Mark name or occupied project resourceAdjust the scope, node type or Mark name
edge.presentation / note.anchor / interface.presentationAn invalid presentation connection or missing anchorRemove the presentation data output, or repair the anchor or interface
graph.parseMissing parameters, invalid fields or malformed imported dataCorrect the field identified in the error
tool.uid / tool.missing / tool.definitionA tool reference or definition is unavailableSelect an available tool and refresh its ports
graph.empty / node.id / node.duplicate / node.type / node.internalEmpty graph, invalid node identity, unsupported type or internal nodeAdd nodes, correct IDs and use supported editor node types
subgraph.depth / graph.structureExcessive nesting or invalid expanded structureReduce nesting and check the relevant subgraph interfaces

Importing workflow JSON

Node IDs must be nonempty and unique within a graph. Different nested subgraphs may reuse local IDs. Edges reference actual node IDs and use the port identifiers below; display names cannot replace IDs.

FieldExample
sourcereads
sourceHandlereads-out-r1: <source-node-ID>-out-<output-port-name>
targetalign
targetHandlealign-in-read1: <target-node-ID>-in-<input-port-name>

Subgraph interface targets use node_id and a port name in handle, such as handle: "read1", without the node prefix shown above. For edge.handle_format, check that edge port identifiers follow this format.

What remains to check after validation?

Passing validation means the graph structure, port connections, input counts and checked parameters/context satisfy the rules. Validation does not run tools, CODE or containers. It does not establish that external files exist, a glob matches files, file content suits the downstream tool or all tool parameters work at runtime.

Distinguish file paths, directory paths and string content: an existing port does not guarantee compatible data formats. Follow the port descriptions, then inspect run logs and results to confirm the actual analysis behavior.

On this page