# Stand-alone Flow

> **Prerequisite:** Understand [Data Flow concepts](https://docs.umh.app/usage/data-flows) and [Bridges](https://docs.umh.app/usage/data-flows/bridges).

Stand-alone flows provide raw Benthos access for custom data processing when bridges or stream processors aren't sufficient. They're the fallback mechanism for write flows, external integrations, and specialized transformations.

## When to Use

Use stand-alone flows for:

* Point-to-point data transformation
* External system integration (databases, APIs, files)
* Custom processing that doesn't fit bridge patterns

Use bridges instead for:

* Industrial device connections
* Data that needs UNS organization
* Connections requiring health monitoring

## UI Capabilities

| Action                | Available | Notes                       |
| --------------------- | --------- | --------------------------- |
| Create flows          | ✅         | Via UI with YAML editor     |
| View flows            | ✅         | Listed in Standalone tab    |
| Edit configuration    | ✅         | Direct YAML editing         |
| Control state         | ✅         | Active/Stopped toggle       |
| Use example templates | ✅         | Pre-built samples available |
| Monitor status        | ✅         | Throughput and state        |
| View logs             | ✅         | Real-time log streaming     |
| View metrics          | ✅         | Performance monitoring      |
| Delete flows          | ✅         | Via context menu            |

## Creating a Stand-alone Flow (UI)

### Step 1: Navigate to Data Flows

Go to **Data Flows** → **Standalone** tab and click **Add Standalone Flow**:

![Standalone Flows List](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-6e82e3c2d9c2ecbf57d09b9f235fd425e59fef48%2Fstandalone-overview.png?alt=media)

### Step 2: Configure the Flow

The configuration interface has multiple sections:

![Standalone Flow Configuration](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-cbab451e25aaf34776f1fd2c2e76833442664179%2Fstandalone-detail-overview-1.png?alt=media)

**Key sections:**

* **General**: Name, instance, and state control (Active/Stopped)
* **Input (YAML)**: Configure data source (see [Benthos-UMH inputs](https://docs.umh.app/benthos-umh/input))
* **Processing (YAML)**: Transform data with processors
* **Output (YAML)**: Send to any destination (generic, not auto-generated like bridges)
* **Examples**: Pre-built templates including database bridges

### Step 3: Use Example Templates

Click the **Examples** tab to access pre-built configurations:

![Example Templates](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-291886ef0d3d38943b2388de5ee77d7751a4c02f%2Fstandalone-detail-samples.png?alt=media)

Available examples include:

* **mqtt\_to\_kafka\_historian\_bridge**: MQTT to Kafka with historian pattern
* **kafka\_to\_postgresql\_historian\_bridge**: Write to TimescaleDB (like Classic)
* **opcua\_to\_umh\_core**: OPC UA integration
* **generate\_to\_stdout**: Testing pattern

### Step 4: Control Flow State

Use the state dropdown to control execution:

![State Control](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-346fe3c9b8847792cea53d37b4e97288e95471a7%2Fstandalone-detail-state.png?alt=media)

* **Active**: Flow is running
* **Stopped**: Temporarily disabled (useful for maintenance)

### Managing Stand-alone Flows

Right-click any flow for quick actions:

![Context Menu](https://3966587046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPQ7UY9eT1SiICDqYFZdA%2Fuploads%2Fgit-blob-3e68a5ed1a01b080effb96100e840bfa39ec8d2e%2Fstandalone-overview-context-menu.png?alt=media)

Options include:

* **Standalone Flow**: Edit configuration
* **Logs**: View real-time logs
* **Metrics**: Monitor performance
* **Delete**: Remove the flow

### Enable Debug Logging

For troubleshooting data processing issues in stand-alone flows, enable the `debug_level` configuration option:

**Via YAML:**

```yaml
dataFlow:
  - name: custom-processor
    desiredState: active
    dataFlowComponentConfig:
      debug_level: true  # Enable detailed logging (default: false)
      benthos:
        # ...
```

**What it controls:**

* Log level: DEBUG (when `true`) vs INFO (when `false`, default)
* Detailed operational logging for input/output operations
* Processing step execution details
* Data transformation trace information

**Important:** Debug logging generates significantly more log data and may impact performance. **Use only during active troubleshooting** and disable afterward.

View logs via right-click → **Logs**. For comprehensive debug\_level configuration reference, see [Configuration Reference](https://docs.umh.app/reference/configuration-reference).

## Configuration (YAML)

Stand-alone flows use standard Benthos configuration:

```yaml
dataFlow:
  - name: custom-processor
    desiredState: active
    dataFlowComponentConfig:
      benthos:
        input:
          # Any Benthos input
        pipeline:
          processors:
            # Processing logic
        output:
          # Any Benthos output
```

## Migrating from Benthos

Existing Benthos configurations work with minimal changes:

```yaml
# Original Benthos config
input:
  mqtt:
    urls: ["tcp://broker:1883"]
output:
  stdout: {}

# As UMH Core stand-alone flow
dataFlow:
  - name: migrated-flow
    desiredState: active
    dataFlowComponentConfig:
      benthos:
        input:
          mqtt:
            urls: ["tcp://broker:1883"]
        output:
          stdout: {}
```

## Next Steps

* Learn about [Bridges](https://docs.umh.app/usage/data-flows/bridges) for device connectivity
* Explore [Stream Processors](https://docs.umh.app/usage/data-flows/stream-processor) for data transformation
* See [Benthos-UMH Documentation](https://docs.umh.app/benthos-umh) for all processors
