As lighting projects evolve from basic chasers into full-scale concert rigs, node graphs can easily turn into tangled webs of duplicate signal chains. If you need three independent sound-reactive strobe pulse lines, building three identical sets of audio bandpass filters, envelope followers, and math multipliers clutters the canvas and makes show maintenance difficult. **Subgraphs** (reusable function graphs) let you package entire node networks into neat, modular building blocks with custom inputs and outputs.

![Subgraphs Group Inputs and Group Outputs Nodes - Defining custom interface sockets for reusable function graphs](https://unilighter.cc/info/docs/node-graphs/subgraphs/node_subgraphs_72158c6a.png)

---

## 🧱 The Subgraph Interface Architecture

A reusable subgraph operates like a programming function: it receives parameters through its inputs, executes an internal graph, and streams results through its outputs.

### 1. Group Inputs Node (`GroupInputsNode`)
- **The Entry Boundary**: Represents the input parameters passed into your custom composite node.
- **Declaring Custom Sockets**: Click **+ Add Input** to declare an exposed socket.
- **Parameter Naming & Types**: Assign a descriptive parameter name (e.g. *Rate*, *Pulse Width*, *Base Color*, *Sensitivity*, *Sequence Offset*) and select its data type:
  - `Number`: Scalar float or integer value.
  - `Sequence`: Numeric array (`number-array`) up to 64 elements.
  - `Number or Sequence`: Polymorphic socket accepting either a scalar or a sequence dynamically.
  - `Color`: RGB/HSL color data.
  - `Boolean`: On/off flag.
  - `Trigger`: Momentary impulse pulse.
- **Default Fallbacks**: Set default numeric, sequence, or color values used whenever an exterior wire is disconnected.

### 2. Group Outputs Node (`GroupOutputsNode`)
- **The Exit Boundary**: Represents the calculated signals returning from your internal graph.
- **Declaring Output Pins**: Click **+ Add Output** to declare the output pins your collapsed node will expose to exterior graphs (e.g. *Strobe Pulse*, *Pan Angle*, *Tilt Angle*, *Chasing Pattern*, *Master Output*). Supports `Number`, `Sequence`, `Number or Sequence`, `Color`, `Boolean`, and `Trigger`.

---

## 📦 Encapsulating & Reusing Graphs

- **Clean Single-Card Abstraction**: In exterior parent graphs, a subgraph appears as a compact, self-contained node card displaying only your named custom sockets.
- **Encapsulated Scope**: Internal math equations, intermediate delay lines, envelope followers, and routing nodes stay cleanly hidden inside the subgraph.
- **Project Portability**: Save custom function graphs into your local project library. Using the **Import Graph** modal, you can drop your battle-tested function nodes (such as a custom moving head Lissajous ballyhoo generator, procedural sequence chaser, or multi-band audio colorizer) into any new show project in seconds.

---

## 💡 Practical Recipe: Building a Sound-to-Light Strobe Macro

1. Open a new node graph named `Macro - Kick Strobe`.
2. Add a **Group Inputs Node** with two inputs: `Sensitivity` (`Number`, default `0.5`) and `Decay Time` (`Number`, default `120ms`).
3. Wire incoming audio through an [Audio Input Node](https://unilighter.cc/info/for-ai/docs/node-graphs/audio.md), into a [Frequency Meter](https://unilighter.cc/info/for-ai/docs/node-graphs/frequency-meter.md) tuned to kick drum frequencies (`45–90 Hz`).
4. Pass the filtered energy into a [Gate Node](https://unilighter.cc/info/for-ai/docs/node-graphs/gate.md), connecting the `Sensitivity` input to the gate threshold and `Decay Time` to the release envelope.
5. Connect the gate output into a **Group Outputs Node** with an output socket named `Strobe Intensity`.
6. In your live performance graph, instantiate this composite macro. You now have a tidy, single-card Kick Strobe node with just two intuitive slider controls!

Read more in the **[Visual Node Graphs Guide](https://unilighter.cc/info/for-ai/docs/node-graphs.md)**.

