> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Routes Overview

> Add, configure, and monitor Routes in the Coreflux HUB—view status, edit configuration, and inspect route logs

<Frame caption="Routes section in the Coreflux HUB — route cards with live connection status, configuration, and monitoring tools">
  <img src="https://mintcdn.com/coreflux/W9CJ-kgVY3a3sCeL/images/hub-routes-section.png?fit=max&auto=format&n=W9CJ-kgVY3a3sCeL&q=85&s=f09d7faf457109ed2c9a7b7f78c42a56" alt="Coreflux HUB Routes section showing route cards with connection status indicators, sort and filter controls, and route management options" width="1024" height="639" data-path="images/hub-routes-section.png" />
</Frame>

## Why Use the Routes Section?

You need to manage Routes from the browser—add new routes, edit configuration, check connection status, and troubleshoot with logs. The Routes section of the Coreflux HUB lets you configure routes with a visual editor or LoT code, view connected and disconnected routes, and inspect route-specific logs.

## When to Use It

* **Adding routes** — Create routes from templates (PostgreSQL, MongoDB, Modbus, etc.) or write LoT code directly
* **Configuring routes** — Edit configuration, events, mappings, and tags in Visual or LoT mode
* **Monitoring** — See which routes are connected and which are not, and view real-time status metrics
* **Troubleshooting** — View route logs, filter by level, and export for analysis

***

## Routes Tools

<CardGroup cols={2}>
  <Card title="Routes Configuration" icon="cog" href="/coreflux-hub/routes/configuration">
    Edit routes, view status (connected/not connected), and delete routes.
  </Card>

  <Card title="Routes Monitoring" icon="chart-line" href="/coreflux-hub/routes/monitoring">
    View real-time status metrics and logs filtered by route, export as JSON/CSV/LOG.
  </Card>
</CardGroup>

***

## Route List and Status

The Routes Manager displays all defined routes as cards. Each route card shows the route name, type (e.g., `SIEMENS_S7`), and a **status indicator** dot in the top-right corner. The dot color tells you the current connection state at a glance:

| Color      | Status         |
| ---------- | -------------- |
| **Green**  | Connected      |
| **Red**    | Not connected  |
| **Gray**   | Unknown status |
| **Yellow** | Reconnecting   |

<Frame caption="Route card for SiemensS7Route with a green status dot in the top-right indicating the route is connected">
  <img src="https://mintcdn.com/coreflux/W9CJ-kgVY3a3sCeL/images/route-card-status.png?fit=max&auto=format&n=W9CJ-kgVY3a3sCeL&q=85&s=02c52c2e8054e6b831d76dd0e355de97" alt="Coreflux HUB route card titled SiemensS7Route with the SIEMENS_S7 type badge, a green status dot in the top-right corner indicating a connected route, and four action icons along the bottom for configuration, monitor, documentation, and delete" width="630" height="269" data-path="images/route-card-status.png" />
</Frame>

Use the controls at the top to **sort** routes by name and **filter** by type. The **Delete All** button removes all routes, and the **Add a route +** button opens the route creation options.

## Route Card Actions

Click on a route card to open its context menu with three options:

<Frame caption="Route card action icons — gear for Configuration, monitor for Monitor, globe for Documentation, and trash for Delete">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-card-menu.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=da92b8787ff0fead96b62e2d4d74348d" alt="Coreflux HUB SiemensS7Route card with the SIEMENS_S7 type badge and a row of four action icons at the bottom — a gear for Configuration, a monitor for Monitor, a globe for Documentation, and a trash can for Delete" width="210" height="206" data-path="images/routes-card-menu.png" />
</Frame>

| Action            | Description                                                                                                                                                                  |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Configuration** | Opens the [Routes Configuration](/coreflux-hub/routes/configuration) panel to edit settings, events, mappings, and tags                                                      |
| **Monitor**       | Opens the [Routes Monitoring](/coreflux-hub/routes/monitoring) window with a **Status** tab (connection, health, messages, errors) and a **Logs** tab (real-time route logs) |
| **Documentation** | Opens the Coreflux documentation for the route type directly inside the HUB                                                                                                  |

### Route Documentation

The Documentation option opens the Coreflux docs page for the route type in an embedded viewer inside the HUB. This gives you quick access to syntax reference, configuration parameters, and examples without leaving the interface.

<Frame caption="Embedded Docs window showing the Siemens S7 Route page from the Coreflux documentation inside the HUB">
  <img src="https://mintcdn.com/coreflux/W9CJ-kgVY3a3sCeL/images/route-documentation.png?fit=max&auto=format&n=W9CJ-kgVY3a3sCeL&q=85&s=7e1fd16ce331f588bef74d496fcea18b" alt="Coreflux HUB embedded Docs window titled SiemensS7Route loading the Siemens S7 Route page from docs.coreflux.org with Routes navigation on the left, Siemens S7 Overview and Basic Syntax content in the center, and an On this page outline on the right, plus Refresh and Open in Browser controls" width="1024" height="639" data-path="images/route-documentation.png" />
</Frame>

***

## Adding a Route

Click **Add a route +** in the Routes Manager. The **Create a New Route** modal appears with two options:

* **Start from Scratch** — Opens the LoT code editor where you write your route definition from scratch
* **Start from Template** — Opens the template list where you pick a route type and configure it visually

<Frame caption="Create a New Route modal over the Route Manager — choose Start from Scratch to write LoT code or Start from Template to use a pre-built template">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-add-modal.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=941166cd0b765cf39e1cf533ac88c749" alt="Coreflux HUB Create a New Route modal overlaid on the Route Manager asking How would you like to get started with two options — Start from Scratch to write a route definition in LoT code from scratch and Start from Template to choose from available route templates and customize with a visual or code editor" width="1024" height="639" data-path="images/routes-add-modal.png" />
</Frame>

| Method                  | Best For                                                            |
| ----------------------- | ------------------------------------------------------------------- |
| **Start from Scratch**  | Custom routes, full control over syntax, copying from documentation |
| **Start from Template** | Quick setup for common route types with a visual configuration form |

### Start from Scratch

Select **Start from Scratch** to open the **Create Route with Code Editor** modal. Write your route definition in LoT language and click **Create Route** to deploy.

<Frame caption="Create Route with Code Editor modal — a LoT code editor with Collapse All, fullscreen controls, and Create Route and Cancel buttons">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-code-editor.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=6517321ac47abd532c25062b3d0fdc89" alt="Coreflux HUB Create Route with Code Editor modal prompting to write your route definition in LoT language, showing an empty numbered code editor with Enter route definition here placeholder, Collapse All and fullscreen controls at the top, and Cancel and Create Route buttons at the bottom" width="1024" height="639" data-path="images/routes-code-editor.png" />
</Frame>

Example:

```lot theme={null}
DEFINE ROUTE MyPostgres WITH TYPE POSTGRESQL
  ADD SQL_CONFIG
    WITH SERVER "localhost"
    WITH PORT '5432'
    WITH DATABASE "iot_data"
    WITH USERNAME "admin"
    WITH PASSWORD "your_password"
  ADD EVENT StoreSensor
    WITH SOURCE_TOPIC "sensors/#"
    WITH QUERY "INSERT INTO readings (topic, value) VALUES ('{topic}', '{value.json}')"
```

### Start from Template

Select **Start from Template** to open the templates list. Choose a route type to configure it visually.

1. Select **Start from Template** from the Create a New Route modal.
2. The **Templates** list opens with available route types.

<Frame caption="Templates picker — search for a route type and select one to generate a pre-filled configuration">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-templates.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=65437b3e27cf1c71cf2c3d55acb8cd72" alt="Coreflux HUB Templates modal titled Choose a route type to get started with a Search by type field and a scrollable list of route templates including PostgreSQL, MariaDB, MySQL, SQL Server, MongoDB, and OpenSearch, each with a description of its database route purpose" width="1024" height="639" data-path="images/routes-templates.png" />
</Frame>

3. Use **Search by type...** to filter (e.g., "PostgreSQL", "Modbus").
4. Select a template. The route creation view opens with a configuration form.

When you select a template, a configuration tab opens with **Visual Mode** and **LoT Mode**. Visual Mode displays all configuration fields and events as a form. LoT Mode shows the raw LoT code.

<Frame caption="Create PostgreSQL Route view with the Configuration tab selected, showing the SQL Configuration fields and Events counters, plus Cancel and Create Route actions">
  <img src="https://mintcdn.com/coreflux/NyitfZKdXrngxrt5/images/routes-template-config.png?fit=max&auto=format&n=NyitfZKdXrngxrt5&q=85&s=33331e395142e9f2e402cffc9a4b0793" alt="Coreflux HUB Create PostgreSQL Route view for Route NewPostgreSQL_1776353175451 with Configuration and Events tabs, Configuration Fields panel showing SQL Configuration with five fields — SERVER required string set to localhost, PORT int set to 5432, DATABASE required string set to test_db, USERNAME required string set to admin, and PASSWORD required string hidden — plus an + Add Field button and Cancel and Create Route buttons at the bottom" width="1024" height="639" data-path="images/routes-template-config.png" />
</Frame>

* **Configuration** — Fill in the connection fields (server, port, database, username, password). Required fields are marked with a badge. Use **+ Add Field** to include optional parameters.
* **Events** — Define events for the route (e.g., queries triggered by MQTT messages).
* **LoT Mode** — Switch to LoT Mode to view or edit the generated LoT code directly.

5. Fill in the configuration fields and add events as needed.
6. Click **Create Route** to deploy. Click **Cancel** to discard.

Templates are available for all supported route types. See the [Routes Overview](/lot-language/routes/overview) for the full list of available types and their documentation.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Routes Configuration" icon="sliders" href="/coreflux-hub/routes/configuration">
    Edit routes with Visual or LoT mode.
  </Card>

  <Card title="LoT Routes" icon="route" href="/lot-language/routes/overview">
    Learn route syntax and available route types.
  </Card>
</CardGroup>
