> For the complete documentation index, see [llms.txt](https://docs.aitheon.com/aitheon-core/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aitheon.com/aitheon-core/main-elements/sub-graphs.md).

# Sub-graphs

Aitheon Core works with nodes. Some of these nodes are made to simplify the interface and contain other nodes. These are **sub-graphs**.

A sub-graph is an element of the entire system that connects with other elements - sub-graphs and[ **nodes**](/aitheon-core/main-elements/nodes.md). We may think about sub-graphs as folders on a computer that we can connect with other folders and files - nodes. Sub-graphs may contain other sub-graphs and nodes.

Use sub-graphs to organize your services and automations on the graph table visually. Build services, add nodes to them, connect them for your business purposes.

### Sub-graph Types

1. Each service you have already activated will be a **Service Sub-graph** in Core **(1)**.  &#x20;

![](https://11324685-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFodfgQtPYjVLJ1kJJi%2F-MPdm1jIyWp5vWX_NU-d%2F-MPdngMAZ8AMgnTDmRbe%2Fgraph.png?alt=media\&token=08ac49e3-7513-4599-81c5-0083fe78c86b)

These sub-graphs have ready-to-use settings **(2)** and a [**service node** ](/aitheon-core/main-elements/nodes.md#nodes-types)inside that allows you to make immediate automation connections.

There are several sub-types of this **Service sub-graph** type for specific services. For example, inside the **Smart Infrastructure Service Sub-graph,** there are such sub-graphs (after its sub-services):

* **Infrastructure Sub-graph** (created automatically when you add infrastructure to Smart Infrastructure Service)
* **Floor Sub-graph** (created automatically inside the Infrastructure Sub-graph when you add a floor to the Infrastructure)
* **Station Sub-graph** (created when you add a station)
* **Controller Sub-graph** (created for your devices, added to a particular station, as an example)

2\. Also, you can make your own sub-graph, and it will have a corresponding common subtitle: &#x20;

![](https://11324685-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFodfgQtPYjVLJ1kJJi%2F-MPdm1jIyWp5vWX_NU-d%2F-MPdml35tui1zwZqZA0c%2Femptys.png?alt=media\&token=cfaad7dd-6d05-4c39-b6be-957f3eaba7e1)

### Sub-graph Status

Above the sub-graph there is a status line. It displays statuses of the nodes inside the sub-graph.&#x20;

![](https://11324685-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFodfgQtPYjVLJ1kJJi%2F-MPdj6mtNsp6zz2UxdLo%2F-MPdkiXzq-TM5Ti2AVe0%2Fsubgr%20status.png?alt=media\&token=60f48e7c-7d94-40f6-b727-2a2acb3af3d9)

An empty sub-graph has an EMPTY status **(1)**.

A green dot with a number shows how many nodes inside the sub-graph are working **(2)**, a yellow dot shows the number of stopped nodes, and an empty dot is the number of empty sub-graphs inside the current sub-graph.&#x20;

### Sub-graph Settings

You can set up settings for a sub-graph.&#x20;

Click three dots at the top-right corner of your sub-graph.

Now you can go to **Settings** or **Remove** your sub-graph. Notice that you can remove only non-Service sub-graphs.

In the **Settings** window, you can add and manage [**inputs and outputs**](/aitheon-core/main-elements/inputs-and-outputs.md) parameters.  &#x20;

![](https://11324685-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFodfgQtPYjVLJ1kJJi%2F-MIdKJ0WV3wSiw9nT6k0%2F-MIdLfC9xeIfa6A3wHC6%2Fsettings%20new%20sub-gr.png?alt=media\&token=a7b734de-6c9e-42c5-bc9a-5d6601cee0a7)

You can add as many inputs and outputs as you need **(1)**. Give a good name for your input or output since it's easier to understand all the flows when inputs and outputs explain themselves.

The **Multiple** option **(2)** allows you to put multiple inputs of defined type in one place.&#x20;

The **Placement** option defines where an input or output point locates on the sub-graph **(3)**. If you choose **Center**, you will get two points of your input or output, both on the left and right sides.

{% hint style="info" %}
Normally inputs are on the left side, while outputs are on the right side. But if needed you can make it your way for clearer connections appearance.
{% endhint %}

Select a proper [**Socket** ](/aitheon-core/main-elements/inputs-and-outputs.md)for the input or output message **(4)**.

You can delete an input or output if you don't need it anymore **(5)**.&#x20;

### Sub-graph Content

Double click on a sub-graph to open it. If you open a new sub-graph, it will be empty, but [**Service Sub-graphs**](/aitheon-core/main-elements/sub-graphs.md#sub-graph-types) contain ready-to-use nodes and settings.  &#x20;

![](https://11324685-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFodfgQtPYjVLJ1kJJi%2F-MIdKJ0WV3wSiw9nT6k0%2F-MIdNc4kiaY3ObXDujLS%2Finside.png?alt=media\&token=f21d2cdd-a3af-4965-b01d-83e2f6a4f208)

There is one node named **Communications Service Node** **(1)** inside our service sub-graph **Communications.**

We can see what kinds of [**inputs** ](/aitheon-core/main-elements/inputs-and-outputs.md)may go into the Item Manager sub-graph **(2)** and what [**outputs** ](/aitheon-core/main-elements/inputs-and-outputs.md)we may receive from it **(3).**&#x20;

If a sub-graph (or a node) has to take or send some more possible messages (inputs and outputs), **Create input** and **Create output** options appear **(4)**. You may use them at once, just connecting with needed input and output sockets - socket type will be [**AnyData**](/aitheon-core/main-elements/inputs-and-outputs.md#common).

Between these inputs and outputs, some computing work takes place. In this particular sub-graph, this work is done by one node. To configure this [**node**](/aitheon-core/main-elements/nodes.md)**,** press three dots at its top-right corner **(5)**.&#x20;

Use [**TOOLBOX**](/aitheon-core/main-elements/toolbox.md) to add other nodes, sub-graphs, and other elements **(6)**.&#x20;

You may watch the ongoing log for this sub-graph with **SHOW RUN INFO** **(7)** and stop or run this sub-graph.

At the top-left corner **(8)** you can see the path to this part of Core and come back at a higher level.&#x20;
