# Nodes

Nodes are the building blocks when populating the [Pipeline](https://docs.luxonis.com/software/depthai-components/pipeline.md).
Each node provides a specific functionality on the DepthAI, a set of configurable properties and inputs/outputs. After you create
a node on a pipeline, you can also configure it as desired and link it to other nodes.

On the table of contents (left side of the page) all nodes are listed under the Node entry. You can click on them to find out
more.

## Inputs and outputs

Each node can have zero, one or multiple inputs and outputs. For example, SystemLogger node has no inputs and 1 output and
EdgeDetector has 2 inputs and 1 output (as shown below). Script node can have any number of inputs/ouputs.

Each node's output has its pool; block in RAM where it stores messages. Each node's input has its queue for message pointers
(doesn't store the message itself, just a pointer to it).

### Node input

Node input queue is a queue for Messages. It can be linked with other node's output (that's how you link up nodes). Node inputs
are configurable - with input.setBlocking(bool) and input.setQueueSize(num), eg. edgeDetector.inputImage.setQueueSize(10). If the
input queue fills up, behavior of the input depends on blocking attribute.

Let's say we have linked ColorCamera preview output with NeuralNetwork input input.

If input is set to blocking mode, and input queue fills up, no new messages from ColorCamera will be able to enter the input
queue. This means ColorCamera will block and wait with sending its messages until it can push the message to the queue of
NeuralNetwork input. If ColorCamera preview is connected to multiple inputs, the same behavior implies, with the messages being
pushed sequentially to each input.

If blocking is disabled, new messages will push out old messages. This eliminates the risk of pipeline freezing, but can result in
dropped messages (eg. ImgFrame).

### Node output

Node outputs Messages. Some nodes have a configurable output message pool. Output message pool is a reserved memory region (to
reduce memory fragmentation) that holds output messages. After the node creates an output message (for example ImgFrame), it will
send it to other nodes as specified when linking the inputs/outputs of the node. Currently, some nodes (VideoEncoder,
NeuralNetwork, ImageManip, XLinkIn) can have the pool size configured. The size of the pool specifies how many messages can be
created and sent out while other messages are already somewhere in the pipeline.

> **Pipeline freezing**
> When all the messages from pool are sent out and none yet returned, that's when the node will block (freeze) and wait until a
message is released (not used by any node in the pipeline).

### depthai.Node

Kind: Class

Abstract Node

#### depthai.Node.Connection

Kind: Class

Connection between an Input and Output

##### inputGroup: str

Kind: Class Variable

##### inputName: str

Kind: Class Variable

##### outputGroup: str

Kind: Class Variable

##### outputName: str

Kind: Class Variable

##### inputId

Kind: Property

##### inputId.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### outputId

Kind: Property

##### outputId.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### depthai.Node.DatatypeHierarchy

Kind: Class

##### datatype: DatatypeEnum

Kind: Class Variable

##### descendants: bool

Kind: Class Variable

##### __init__(self, arg0: DatatypeEnum, arg1: bool)

Kind: Method

#### depthai.Node.Id

Kind: Class

Node identificator. Unique for every node on a single Pipeline

#### depthai.Node.Input

Kind: Class

##### depthai.Node.Input.Type

Kind: Class

Members:

SReceiver

MReceiver

###### MReceiver: typing.ClassVar[Node.Input.Type]

Kind: Class Variable

###### SReceiver: typing.ClassVar[Node.Input.Type]

Kind: Class Variable

###### __members__: typing.ClassVar[dict[str, Node.Input.Type]]

Kind: Class Variable

###### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __getstate__(self) -> int: int

Kind: Method

###### __hash__(self) -> int: int

Kind: Method

###### __index__(self) -> int: int

Kind: Method

###### __init__(self, value: typing.SupportsInt)

Kind: Method

###### __int__(self) -> int: int

Kind: Method

###### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### __setstate__(self, state: typing.SupportsInt)

Kind: Method

###### __str__(self) -> str: str

Kind: Method

###### name

Kind: Property

###### value

Kind: Property

##### group: str

Kind: Class Variable

##### name: str

Kind: Class Variable

##### type: Node.Input.Type

Kind: Class Variable

##### waitForMessage: bool|None

Kind: Class Variable

##### getBlocking(self) -> bool: bool

Kind: Method

Get input queue behavior

Returns:
True blocking, false overwriting

##### getParent()

Kind: Method

##### getQueueSize(self) -> int: int

Kind: Method

Get input queue size.

Returns:
Maximum input queue size

##### getReusePreviousMessage(self) -> bool: bool

Kind: Method

Equivalent to getWaitForMessage but with inverted logic.

##### getWaitForMessage(self) -> bool: bool

Kind: Method

Get behavior whether to wait for this input when a Node processes certain data
or not

Returns:
Whether to wait for message to arrive to this input or not

##### setBlocking(self, blocking: bool)

Kind: Method

Overrides default input queue behavior.

Parameter ``blocking``:
True blocking, false overwriting

##### setQueueSize(self, size: typing.SupportsInt)

Kind: Method

Overrides default input queue size. If queue size fills up, behavior depends on
`blocking` attribute

Parameter ``size``:
Maximum input queue size

##### setReusePreviousMessage(self, reusePreviousMessage: bool)

Kind: Method

Equivalent to setWaitForMessage but with inverted logic.

##### setWaitForMessage(self, waitForMessage: bool)

Kind: Method

Overrides default wait for message behavior. Applicable for nodes with multiple
inputs. Specifies behavior whether to wait for this input when a Node processes
certain data or not.

Parameter ``waitForMessage``:
Whether to wait for message to arrive to this input or not

##### possibleDatatypes

Kind: Property

##### possibleDatatypes.setter(self, arg0: collections.abc.Sequence [ Node.DatatypeHierarchy ])

Kind: Method

#### depthai.Node.InputMap

Kind: Class

##### __bool__(self) -> bool: bool

Kind: Method

Check whether the map is nonempty

##### __contains__(self, arg0: str) -> bool: bool

Kind: Method

##### __delitem__(self, arg0: str)

Kind: Method

##### __getitem__(self, arg0: str) -> Node.Input: Node.Input

Kind: Method

##### __iter__(self) -> collections.abc.Iterator[str]: collections.abc.Iterator[str]

Kind: Method

##### __len__(self) -> int: int

Kind: Method

##### __setitem__(self, arg0: str, arg1: Node.Input)

Kind: Method

##### items(self) -> collections.abc.Iterator[tuple[str, Node.Input]]: collections.abc.Iterator[tuple[str, Node.Input]]

Kind: Method

#### depthai.Node.Output

Kind: Class

##### depthai.Node.Output.Type

Kind: Class

Members:

MSender

SSender

###### MSender: typing.ClassVar[Node.Output.Type]

Kind: Class Variable

###### SSender: typing.ClassVar[Node.Output.Type]

Kind: Class Variable

###### __members__: typing.ClassVar[dict[str, Node.Output.Type]]

Kind: Class Variable

###### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __getstate__(self) -> int: int

Kind: Method

###### __hash__(self) -> int: int

Kind: Method

###### __index__(self) -> int: int

Kind: Method

###### __init__(self, value: typing.SupportsInt)

Kind: Method

###### __int__(self) -> int: int

Kind: Method

###### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

###### __repr__(self) -> str: str

Kind: Method

###### __setstate__(self, state: typing.SupportsInt)

Kind: Method

###### __str__(self) -> str: str

Kind: Method

###### name

Kind: Property

###### value

Kind: Property

##### group: str

Kind: Class Variable

##### name: str

Kind: Class Variable

##### type: Node.Output.Type

Kind: Class Variable

##### canConnect(self, input: Node.Input) -> bool: bool

Kind: Method

Check if connection is possible

Parameter ``in``:
Input to connect to

Returns:
True if connection is possible, false otherwise

##### getConnections(self) -> list[Node.Connection]: list[Node.Connection]

Kind: Method

Retrieve all connections from this output

Returns:
Vector of connections

##### getParent()

Kind: Method

##### isSamePipeline(self, input: Node.Input) -> bool: bool

Kind: Method

Check if this output and given input are on the same pipeline.

See also:
canConnect for checking if connection is possible

Returns:
True if output and input are on the same pipeline

##### link(self, input: Node.Input)

Kind: Method

Link current output to input.

Throws an error if this output cannot be linked to given input, or if they are
already linked

Parameter ``in``:
Input to link to

##### unlink(self, input: Node.Input)

Kind: Method

Unlink a previously linked connection

Throws an error if not linked.

Parameter ``in``:
Input from which to unlink from

##### possibleDatatypes

Kind: Property

##### possibleDatatypes.setter(self, arg0: collections.abc.Sequence [ Node.DatatypeHierarchy ])

Kind: Method

#### depthai.Node.OutputMap

Kind: Class

##### __bool__(self) -> bool: bool

Kind: Method

Check whether the map is nonempty

##### __contains__(self, arg0: str) -> bool: bool

Kind: Method

##### __delitem__(self, arg0: str)

Kind: Method

##### __getitem__(self, arg0: str) -> Node.Output: Node.Output

Kind: Method

##### __iter__(self) -> collections.abc.Iterator[str]: collections.abc.Iterator[str]

Kind: Method

##### __len__(self) -> int: int

Kind: Method

##### __setitem__(self, arg0: str, arg1: Node.Output)

Kind: Method

##### items(self) -> collections.abc.Iterator[tuple[str, Node.Output]]: collections.abc.Iterator[tuple[str, Node.Output]]

Kind: Method

#### properties: Properties

Kind: Class Variable

#### getAssetManager()

Kind: Method

#### getInputRefs()

Kind: Method

#### getInputs(self) -> list[Node.Input]: list[Node.Input]

Kind: Method

Retrieves all nodes inputs

#### getName(self) -> str: str

Kind: Method

Retrieves nodes name

#### getOutputRefs()

Kind: Method

#### getOutputs(self) -> list[Node.Output]: list[Node.Output]

Kind: Method

Retrieves all nodes outputs

#### getParentPipeline()

Kind: Method

#### id

Kind: Property

Id of node
