> For the complete documentation index, see [llms.txt](https://docs.umh.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umh.app/usage/data-flows/bridges.md). Agents can also search and read this documentation through its [MCP server](https://docs.umh.app/~gitbook/mcp).

# Bridges

> **Prerequisite:** Understand [Data Flow concepts](https://docs.umh.app/usage/data-flows.md) and complete the [Getting Started guide](https://docs.umh.app/getting-started.md).

A bridge (UI: "Bridges", YAML: `protocolConverter:`) connects the Unified Namespace (UNS) to one external system, such as an OPC UA server, a Siemens S7 or a Modbus controller. Its read flow reads from the external system and publishes to the UNS. Its write flow subscribes to UNS topics and writes to the external system.

It combines a **connection probe**, a **read flow** and a **write flow** under a single name and lifecycle. [Connection Probe](https://docs.umh.app/usage/data-flows/bridges/connection-probe.md) and [Read Flow](https://docs.umh.app/usage/data-flows/bridges/read-flow.md) describe the parts. To create a bridge, see [Create a bridge](https://docs.umh.app/usage/data-flows/bridges/create-a-bridge.md).

## UI Capabilities

| Action                      | Available | Notes                                                        |
| --------------------------- | --------- | ------------------------------------------------------------ |
| Create bridges              | ✅         | Visual protocol configuration                                |
| Create from existing bridge | ✅         | Copy a healthy bridge's configuration                        |
| Start from a template       | ✅         | 84 pre-configured templates, filtered by vendor and protocol |
| Select protocols            | ✅         | OPC UA, Modbus, S7, MQTT, 50+ more                           |
| Configure location path     | ✅         | ISA-95 levels (0-4)                                          |
| Map addresses to topics     | ✅         | Dropdown of data model fields for custom data contracts      |
| Monitor connection health   | ✅         | Real-time status                                             |
| View logs                   | ✅         | Live log streaming                                           |
| View metrics                | ✅         | Throughput monitoring                                        |
| Edit bridges                | ✅         | Modify and redeploy                                          |
| Delete bridges              | ✅         | Clean removal                                                |
| Advanced mode               | ✅         | Direct YAML editing                                          |

## Managing Bridges

### View Status

The main view shows all bridges with connection status and throughput:

![Bridges Overview](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-f0624dcca1a77106a17dc75bc85492fd0323a632%2Fbridges-overview.png?alt=media\&token=0eff06be-18fe-46ab-9ec9-11f621255a12)

* **Green dot**: Connected and running
* **Yellow dot**: Starting or warning state
* **Grey dot**: Intermediate states (starting, stopping, or stuck in starting state)

A bridge can be saved without a read flow or a write flow. Once its connection is up and Redpanda is healthy, it waits until you add a flow. Its status shows **Not Configured**, and **Technical Details** shows the state `starting_failed_dfc_missing`. The bridge starts once you add a flow.

### Context Menu

Right-click any bridge for quick actions:

![Bridge Context Menu](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-7696b81d2db23e97b697a62b0f3c49ad56ea3223%2Fbridges-overview-context-menu.png?alt=media\&token=275d5767-e904-447d-ac63-891687ff7d85)

### View Logs

Monitor bridge activity in real-time:

![Bridge Logs](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-b5cf7bb937cfb071624d100289f48025837b62ae%2Fbridges-logs.png?alt=media\&token=bd380a0a-29a0-4c24-a650-d1a82835ec8a)

### View Metrics

Track performance and throughput:

![Bridge Metrics](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-5dfe43f9586f00c204051786c9e9341a9002d917%2Fbridges-metrics.png?alt=media\&token=c751e3cc-7c19-498c-ab26-535709d51277)

### Enable Debug Logging

When troubleshooting connection or data issues, enable debug logging in your bridge configuration:

**Via YAML:**

```yaml
protocolConverter:
  - name: my-plc-bridge
    debug_level: true  # Enable detailed logging
    protocolConverterServiceConfig:
      config:
```

Debug logging provides:

* Detailed protocol communication logs
* Connection state transitions
* Data parsing details
* For OPC UA: Sets `OPC_DEBUG` environment variable for protocol-level debugging

**Remember to disable debug logging** after troubleshooting - it generates significantly more log data.

To view debug logs, go to the bridge and select **Logs**.

## Important: Data Types from Different Protocols

**Industrial protocols (OPC UA, Modbus, S7) only provide time-series data** - snapshots of values at points in time. They cannot directly provide relational records.

**IT protocols (MQTT, HTTP, Kafka) can provide relational data** - when you select "relational" as the data type in the UI, the bridge automatically uses [`nodered_js` processor](https://docs.umh.app/benthos-umh/processing/node-red-javascript-processor) to handle complex business records like work orders or batch reports.

For converting time-series to relational data, see [Stream Processors](https://docs.umh.app/usage/data-flows/stream-processor.md) or use [Stand-alone Flows](https://docs.umh.app/usage/data-flows/stand-alone-flow.md).

## Reference

### Configuration

Advanced users can edit the YAML directly. [Connection Probe](https://docs.umh.app/usage/data-flows/bridges/connection-probe.md#configuration) describes the `connection` key, and [Read Flow](https://docs.umh.app/usage/data-flows/bridges/read-flow.md#configuration) describes the `dataflowcomponent_read` key.

```yaml
protocolConverter:
  - name: my-plc-bridge
    desiredState: active
    debug_level: false
    protocolConverterServiceConfig:
      location:
        2: "production-line"
        3: "plc-01"
      config:
        connection:
          nmap:
            target: "{{ .IP }}"
            port: "{{ .PORT }}"
        # dataflowcomponent_read: the read flow, see Read Flow
      variables:
        IP: "192.168.1.100"
        PORT: "102"
```

| Field                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                                                          | Unique name of the bridge                                                                                                                                                                                                                                                                                                                                                                                                              |
| `desiredState`                                                  | `active` to run immediately, or `stopped` to keep it defined but off.                                                                                                                                                                                                                                                                                                                                                                  |
| `debug_level`                                                   | Enable verbose logging for troubleshooting. When `true`, enables DEBUG log level and protocol-specific debugging (e.g., general OPC UA debug logging via the `OPC_DEBUG=debug` environment variable, detailed connection diagnostics). When `false` (default), uses INFO log level. **Use only for troubleshooting** - debug logging generates significantly more log data and may impact performance. Disable after resolving issues. |
| `protocolConverterServiceConfig.location`                       | The bridge's levels. The instance location (`agent.location`) plus these levels is the bridge location. Optional, but useful to identify per-machine data.                                                                                                                                                                                                                                                                             |
| `protocolConverterServiceConfig.config.dataflowcomponent_write` | Write flow: subscribes to UNS topics and writes to the external system, set with `source`, `processing` and `destination`.                                                                                                                                                                                                                                                                                                             |
| `protocolConverterServiceConfig.variables`                      | Optional Go-template variables, referenced via `{{ .VARNAME }}` in the template. See [Template Variables Reference](https://docs.umh.app/reference/variables.md#user-defined-variables) for details.                                                                                                                                                                                                                                   |

**Location Path:**

```yaml
location:
  2: area   # the bridge's levels; assumes agent.location sets levels 0 and 1
  3: line
  4: cell
```

The bridge location is the instance location (`agent.location`) plus the levels set here. The bridge's levels extend the instance location and never overwrite a level that the instance location sets. Any missing level up to the highest one becomes `unknown`.

**Template Variables:**

```yaml
variables:
  IP: "192.168.1.100"      # Available as {{ .IP }}
  PORT: "502"              # Available as {{ .PORT }}
  SCAN_RATE: "1s"          # Custom variable {{ .SCAN_RATE }}
```

### Metrics

The Management Console shows each bridge's message counts. Open the bridge and select **Metrics** (see [View Metrics](#view-metrics)). The view shows messages received and sent, errors, connection status and latency for the bridge's input, processors and output. Port 8080, umh-core's Prometheus endpoint, does not carry per-bridge message counts. It carries the bridge's state and error counts. [Metrics](https://docs.umh.app/usage/instances/agent/metrics.md) explains how to read them, which framework runs bridges and what the labels and the state values mean.

Bridges run on FSMv1 and use the standard [FSMv1 metrics](https://docs.umh.app/usage/instances/agent/metrics.md#fsmv1-metrics). For a bridge named `mixing-station`, the series carry these labels. The labels of the connection are in [Connection Probe](https://docs.umh.app/usage/data-flows/bridges/connection-probe.md#metrics), and the labels of the read flow are in [Read Flow](https://docs.umh.app/usage/data-flows/bridges/read-flow.md#metrics).

| Part of the bridge                    | `component`                   | `instance`                                        |
| ------------------------------------- | ----------------------------- | ------------------------------------------------- |
| The bridge                            | `protocol_converter_instance` | `mixing-station`                                  |
| Its write flow                        | `dataflow_component_instance` | `write-protocolconverter-mixing-station`          |
| The Benthos process of its write flow | `benthos_instance`            | `dataflow-write-protocolconverter-mixing-station` |

To alert when a bridge has not been active for 5 minutes, use this rule with `for: 5m`. In Prometheus, write `exported_instance` for `instance`, or keep `instance` if the scrape job sets `honor_labels: true`:

```promql
umh_core_service_current_state{component="protocol_converter_instance"} != 3 != 4 != 0
```

For the bridge itself, `umh_core_service_current_state` reads 3 when active, 4 when idle and 0 when stopped. The rule does not fire for a bridge that is idle or stopped. A stopped bridge is one you stopped on purpose. When you delete a bridge, umh-core keeps its last state series at -1 until the container restarts, so the rule keeps firing for it. Exclude the deleted name by adding `exported_instance!="<deleted bridge>"` to the selector, or restart the container. The definitions are in [`pkg/metrics/metrics.go`](https://github.com/united-manufacturing-hub/united-manufacturing-hub/blob/staging/umh-core/pkg/metrics/metrics.go).

## Next Steps

* Try the [Getting Started guide](https://docs.umh.app/getting-started.md) to create your first bridge
* Learn about [Data Models](https://docs.umh.app/usage/data-modeling/data-models.md) to structure your data
* Explore [Metadata and Tracing](https://docs.umh.app/usage/unified-namespace/metadata-and-tracing.md) for debugging
* Use [Stand-alone Flows](https://docs.umh.app/usage/data-flows/stand-alone-flow.md) for custom processing
* Configure [Stream Processors](https://docs.umh.app/usage/data-flows/stream-processor.md) to transform data


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umh.app/usage/data-flows/bridges.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
