> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/self-hosted/enterprise/deployment-manager/making-changes/trigger-a-stream.md).

# Trigger a Stream

Run a Workflow on demand from a Triggered stream.

Streams set to "Triggered" mode do not run inference on every frame. They wait for an explicit trigger to run the configured Workflow. This is useful when inference is expensive, when results are only needed at specific moments (ex: when a PLC signals that a part is in position), or when an external system controls the cadence of inspection.

Supported Basler and Lucid area scan cameras can capture a new frame by software trigger when every Stream sharing the camera is triggered and no external trigger is configured. Shared cameras with any continuous Stream, and USB, AI1, and ONVIF sources, use the latest continuously captured frame, which can predate the trigger.

You can trigger a stream two ways:

1. From the cloud, using the Deployment Manager dashboard.
2. From the edge, by calling a local HTTP endpoint on the device.

To use either method, the stream must already be set to "Triggered" mode when you [add it](/deployment/self-hosted/enterprise/deployment-manager/setting-up/add-a-stream.md) or by [updating the device configuration](/deployment/self-hosted/enterprise/deployment-manager/making-changes/update-device-configuration.md).

On an AI1 device, you can also set the mode on the device page: click "Edit", set "Mode" to "Triggered" on the Workflow card, then click "Save Changes".

## Cloud Trigger

A cloud trigger is issued from the Roboflow app and forwarded to the device by Deployment Manager. Use it for manual triggering, demos, or when the system initiating the trigger has internet access but is not on the device's local network.

From the Deployment Manager dashboard, click on the Device that hosts the stream, then select the stream. Triggered streams show a "Trigger" chip in the Streams list. Click the "Trigger" button above the preview to issue a single inference run. Use the toggle next to it to switch the preview between "Last Inference Frame" and "Live Preview".

While the device processes the trigger, the stream shows "Waiting for device...". When the device returns a result, the status updates to "Inference complete" and the rendered frame refreshes with the Workflow output.

The trigger is queued as a command on the device and is processed the next time the device polls Deployment Manager (typically within a few seconds). Cloud triggers are not designed for high-frequency triggering. If you need sub-second latency or are issuing more than a few triggers per minute, use an edge trigger instead.

## Edge Trigger

An edge trigger is an HTTP call made directly to the inference server running on the device. Use it for production triggering from a PLC, a local script, or any system on the same network as the device. Edge triggers avoid the round trip through Deployment Manager and are the recommended approach for latency-sensitive integrations.

The inference server on the device exposes a trigger endpoint for each running stream:

```
POST http://<device-ip>:8000/inference_pipelines/{pipeline_id}/trigger
```

Replace `<device-ip>` with the IP address of the device on your network, and `{pipeline_id}` with the name of the stream you want to trigger.

The request body is optional. To override the Workflow parameters configured on the stream for a single trigger, include them in the body:

```json
{
  "workflows_parameters": {
    "confidence": 0.7
  }
}
```

A successful trigger returns the Workflow output for the captured frame:

```json
{
  "success": true,
  "data": {
    "frame_id": 1024,
    "timestamp": 1716220800.123,
    "workflow_output": [
      {
        "predictions": []
      }
    ]
  }
}
```

If the device has not yet captured a frame, or the pipeline is not running, the response returns `success: false` with a message describing the reason.

{% hint style="info" %}
The edge trigger endpoint is only reachable from the device's local network. To call it from outside, expose the device through your own network infrastructure or use the cloud trigger.
{% endhint %}

## Choosing Between Cloud and Edge Triggers

| Use case                                                              | Recommended trigger |
| --------------------------------------------------------------------- | ------------------- |
| Manually inspecting a stream from the Roboflow app                    | Cloud               |
| Demoing or testing a Triggered stream                                 | Cloud               |
| PLC, sensor, or barcode scanner on the same network as the device     | Edge                |
| Local script that needs the inference result back in the same request | Edge                |
| High-frequency triggering (more than a few per minute)                | Edge                |
