> 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/roboflow/roboflow-hi/deploy/device-manager/making-changes/trigger-a-stream.md).

# Stream ट्रिगर करें

"Triggered" mode पर सेट किए गए Streams हर frame पर inference नहीं चलाते। इसके बजाय, वे लगातार camera से frames capture करते रहते हैं और सबसे हालिया frame के विरुद्ध configured Workflow चलाने के लिए एक explicit trigger का इंतज़ार करते हैं। यह तब उपयोगी है जब inference महंगा हो, जब results केवल विशिष्ट क्षणों पर चाहिए हों (उदाहरण के लिए, जब PLC संकेत दे कि कोई part position में है), या जब कोई external system inspection की cadence नियंत्रित करता हो।

आप stream को दो तरीकों से trigger कर सकते हैं:

1. Cloud से, Deployment Manager dashboard का उपयोग करके।
2. Edge से, device पर एक local HTTP endpoint कॉल करके।

किसी भी method का उपयोग करने के लिए, stream पहले से "Triggered" mode में होना चाहिए जब आप [इसे add करें](/roboflow/roboflow-hi/deploy/device-manager/setting-up/add-a-stream.md) या [device configuration को update करके](/roboflow/roboflow-hi/deploy/device-manager/making-changes/update-device-configuration.md).

## Cloud Trigger

Cloud trigger Roboflow app से जारी किया जाता है और Deployment Manager द्वारा device तक forward किया जाता है। इसका उपयोग manual triggering, demos, या तब करें जब trigger शुरू करने वाले system के पास internet access हो लेकिन वह device के local network पर न हो।

Deployment Manager dashboard से, उस Device पर क्लिक करें जो stream host करता है। प्रत्येक Triggered stream के पास एक "Trigger" button होता है। सबसे हालिया frame के विरुद्ध एक single inference run जारी करने के लिए "Trigger" पर क्लिक करें:

जब device trigger को process करता है, तो stream "Waiting for device..." दिखाता है। जब device result लौटाता है, status "Inference complete" में update हो जाता है और rendered frame Workflow output के साथ refresh हो जाता है।

Trigger device पर एक command के रूप में queue किया जाता है और अगली बार device जब Deployment Manager को poll करता है, तब process होता है (आमतौर पर कुछ सेकंड के भीतर)। Cloud triggers high-frequency triggering के लिए डिज़ाइन नहीं किए गए हैं। यदि आपको sub-second latency चाहिए या आप प्रति मिनट कुछ से अधिक triggers जारी कर रहे हैं, तो इसके बजाय edge trigger का उपयोग करें।

## Edge Trigger

Edge trigger एक HTTP call है जो सीधे device पर चल रहे inference server को किया जाता है। इसका उपयोग production triggering के लिए PLC, local script, या device के समान network पर मौजूद किसी भी system से करें। Edge triggers Deployment Manager के माध्यम से round trip से बचाते हैं और latency-sensitive integrations के लिए अनुशंसित तरीका हैं।

Device पर inference server प्रत्येक चल रहे stream के लिए एक trigger endpoint expose करता है:

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

इसे बदलें `<device-ip>` को अपने network पर device के IP address से बदलें, और `{pipeline_id}` को उस stream के ID से बदलें जिसे आप trigger करना चाहते हैं। आप pipeline ID को Deployment Manager में stream details में पा सकते हैं।

Request body वैकल्पिक है। किसी single trigger के लिए stream पर configured Workflow parameters को override करने के लिए, उन्हें body में शामिल करें:

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

एक सफल trigger captured frame के लिए Workflow output लौटाता है:

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

यदि device ने अभी तक कोई frame capture नहीं किया है, या pipeline चल नहीं रहा है, तो response लौटाता है `success: false` और कारण बताने वाला एक message देता है।

{% hint style="info" %}
Edge trigger endpoint केवल device के local network से ही reachable है। इसे बाहर से call करने के लिए, device को अपनी network infrastructure के माध्यम से expose करें या cloud trigger का उपयोग करें।
{% endhint %}

## Cloud और Edge Triggers के बीच चयन

| Use case                                                            | अनुशंसित trigger |
| ------------------------------------------------------------------- | ---------------- |
| Roboflow app से किसी stream का manual inspection                    | Cloud            |
| Triggered stream का demo देना या test करना                          | Cloud            |
| ऐसा PLC, sensor, या barcode scanner जो device के समान network पर हो | Edge             |
| ऐसा local script जिसे उसी request में inference result वापस चाहिए   | Edge             |
| High-frequency triggering (प्रति मिनट कुछ से अधिक)                  | Edge             |
