# Connecting Nodes

> Wire data between apps in your flow.

**URL:** https://inference.sh/docs/flows/connecting
**Last updated:** 2026-09-20

---

Wire data between apps in your flow.

---

## Visual connections

Each node has ports:
- **Output ports** on the right
- **Input ports** on the left

Drag from an output to an input to connect.

```
┌──────────┐          ┌──────────┐
│ Image Gen│          │ Upscale  │
│          │          │          │
│   image ●┼──────────┼─▶ image  │
└──────────┘          └──────────┘
```

---

## Data mapping

Click a node to configure its inputs:

| Input | Source |
|-------|--------|
| `image` | `{{image_gen.output.image}}` |
| `scale` | `2` |

---

## Mapping syntax

| Pattern | Example | Meaning |
|---------|---------|---------|
| From flow input | `{{input.image}}` | User-provided input |
| From another node | `{{node_name.output.field}}` | Output from previous step |
| Static value | `2` or `"text"` | Fixed value |

---

## Example

Image enhancement flow:

```
Input (image)
    ↓
Upscale (image → {{input.image}}, scale → 2)
    ↓
Enhance (image → {{upscale.output.image}})
    ↓
Output (result → {{enhance.output.image}})
```

---

## Gate branching

In the v2 editor, a gate node has one input handle and one output handle.

Wire the value to test into the gate's input. The gate's **field** must name that input key. Connect the steps that should run when the condition is true to the gate's output.

```
Classifier ──▶ [gate: status equals approved] ──▶ Process
```

When the condition is false, the gate is marked `failed`, the steps that depend on it are marked `blocked` and do not run, and the flow run still completes. A gate does not change the data that passes through it.

→ [Creating a Flow: Gate nodes](/docs/flows/creating#gate-nodes-v2-editor)  
→ [Flows API: Gate nodes](/docs/api/rest/flows#gate-nodes)

---

## Selector nodes

A selector node has one input handle and one output handle. Wire an upstream array field into the input. At run time the selector picks one element (`first`, `last`, or `index`).

```
List apps ──▶ [selector: first] ──▶ Process item
```

The selector's **field** must name the input key you connect. Connect the output handle to downstream steps.

→ [Creating a Flow: Selector nodes](/docs/flows/creating#selector-nodes-v2-editor)  
→ [Flows API: Selector nodes](/docs/api/rest/flows#selector-nodes)

---

## Merge synchronization

A merge node runs when all of its upstream nodes have completed. Use it after parallel branches that should converge:

```
        ┌──▶ Step A ──┐
Input ──┤             ├──▶ [merge] ──▶ Final step
        └──▶ Step B ──┘
```

With graph actions, give each branch its own input key (for example `branch_a`, `branch_b`). The merge node's output is its inputs map. Downstream steps can read the whole map or one key.

→ [Creating a Flow: Merge nodes](/docs/flows/creating#merge-nodes-v2-editor)  
→ [Flows API: Merge nodes](/docs/api/rest/flows#merge-nodes)

---

## Constant values

A constant node has an output handle and no input handle. Use it when an input should receive a fixed value:

```
[constant: 2] ───────────▶ Upscale (scale input)
Input (image) ───────────▶ Upscale (image input)
```

This is an alternative to typing a static value in the app's input mapping (for example `scale → 2`).

→ [Creating a Flow: Constant nodes](/docs/flows/creating#constant-nodes-v2-editor)  
→ [Flows API: Constant nodes](/docs/api/rest/flows#constant-nodes)

---

## Test connections

Run the flow after each new connection.

Catch issues early.

---

## Next

→ [Deploying as App](/docs/flows/deploying)
