Using Blocks
Once a Block has been created, you can add it to any workflow and use it like any other node. This page covers how to find Blocks, connect them, and understand what happens when they execute.
Adding a Block to Your Workflow
- Open the Blocks tab in the Flow Studio sidebar.
- Browse or search the available Blocks. You will see both project-scoped and workspace-scoped Blocks.
- Click a Block to add it to your canvas.
The Block appears as a single node with its defined input and output handles.
Use tags and the search bar to find Blocks quickly when your library grows.
Connecting Inputs and Outputs
Block handles are typed. You connect them the same way you connect any other node:
- Drag from an upstream node's output to one of the Block's input handles.
- Drag from the Block's output handles to a downstream node's input.
Connections are validated by type -- you can only link matching types (image to image, prompt to prompt, video to video). Required inputs must be connected before the Block can execute.
| Input Type | What to Connect |
|---|---|
| Image | An Asset node, Image Generator output, or another Block's image output |
| Prompt | A Prompt Generator node or another Block's prompt output |
| Video | A Video Generator output, Asset node (video type), or another Block's video output |
Execution
When you execute a workflow containing Blocks, each Block runs its internal pipeline as a self-contained unit.
How Execution Works
- The Block waits until all upstream nodes connected to its inputs have completed.
- External inputs are resolved and injected into the Block's internal nodes.
- Internal nodes execute in dependency order (topological sort), just like a regular workflow.
- Results from the designated output nodes are extracted and made available on the Block's output handles.
- Downstream nodes connected to the Block's outputs receive the results and continue execution.
Execution Status
During execution, the Block node displays an animated border to indicate progress. You see the overall Block status on the canvas, but internal node statuses are not shown -- the Block runs as a black box from the parent workflow's perspective.
| Status | Meaning |
|---|---|
| Idle | Block is ready but has not been executed |
| Executing | Internal pipeline is running |
| Completed | All internal nodes finished successfully |
| Error | An internal node failed during execution |
Output Previews
After a Block completes, its output handles display floating thumbnail previews of the generated results. These 64x64px thumbnails appear to the right of the Block node, giving you a quick visual check without opening the Block or inspecting downstream nodes.
When output previews are visible, the text-based output rows are hidden and the internal pipeline visualization switches to a larger display mode.
Credit Consumption
Credits consumed by a Block's internal nodes are accumulated and counted toward the workflow's total. The Block header shows an estimated credit cost before execution, and the actual cost is tracked in your Execution History.
Nesting Blocks
Blocks can contain other Blocks, letting you compose multi-level pipelines. For example, you might have a "Brand Image" Block that uses a "Style Transfer" Block internally.
Nesting Rules
- Maximum depth: 3 levels -- A Block can contain a Block, which can contain another Block, but no deeper.
- No circular references -- A Block cannot contain itself, directly or indirectly. XainFlow detects circular references before execution and prevents them.
- Isolated execution -- Each nested Block runs in its own isolated context. Internal results do not leak between nesting levels.
If a Block exceeds the 3-level nesting limit or contains a circular reference, execution will fail with an error. Restructure your Blocks to stay within the limit.
Pipeline Visualization
Every Block node displays a compact pipeline visualization in its body. This horizontal row of icons shows the internal nodes in their execution order, connected by thin lines. Each icon represents a node type (image generator, prompt, video generator, etc.) and shows a tooltip on hover.
This gives you a quick sense of what a Block does without opening the editor.
Data Isolation
Blocks are designed to be safe and predictable:
- No side effects -- Internal execution results stay inside the Block. They do not appear in the parent workflow's execution results.
- No ID collisions -- Internal node IDs are automatically scoped to prevent conflicts, even when the same Block is used multiple times in one workflow.
- Clean state -- Every execution starts fresh. Internal nodes are reset before each run, so previous results never carry over.