> 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/monitoring-and-analytics/vision-events/send-events.md).

# Send Events

Three ways to send Vision Events from your deployed models.

## Send Events

You can send Vision Events with a Workflow block, the HTTP API, or edge device backup.

* [Workflow Block](#workflow-block): the easiest option if your model runs in a Workflow.
* [HTTP API](#http-api): for models you deploy outside of Workflows.
* [Edge Device Backup](#edge-device-backup): for Roboflow edge devices, which back up events from the device's local event store.

### Workflow Block

The recommended approach for most users. Add the **Vision Event** block to any Roboflow Workflow to automatically create events from inference results with no code needed.

{% hint style="info" %}
The [Roboflow Agent](https://docs.roboflow.com/agents/roboflow-agent) can set this up for you. When you ask the Agent to build a Workflow that runs a model, it automatically adds a Vision Events block and connects it to the right [Use Case](/deployment/monitoring-and-analytics/vision-events/use-cases.md).
{% endhint %}

#### Setup

{% stepper %}
{% step %}
**Open the Workflow Editor**

Navigate to **Workflows** in your workspace and open the workflow you want to add events to.
{% endstep %}

{% step %}
**Add the Vision Event Block**

Search for "Vision Event" in the block catalog and add it to your workflow.
{% endstep %}

{% step %}
**Connect Inputs**

Connect the image input and model prediction outputs to the Vision Event block.
{% endstep %}

{% step %}
**Configure the Use Case**

Set the Use Case name (`useCaseId`). You can also map custom metadata from upstream blocks. Once a Use Case is selected, click "Open in Vision Events" below the dropdown to jump to that Use Case's events page in a new tab.
{% endstep %}

{% step %}
**Deploy the Workflow**

Deploy or update your workflow. Events are created automatically each time the workflow runs.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
The Workflow block handles image upload and event creation in a single step. It attaches images only. To attach video clips, use the [HTTP API](#http-api) or [Edge Device Backup](#edge-device-backup).
{% endhint %}

### HTTP API

Use the HTTP API to send events from code that does not run in a Workflow. Each endpoint page lists its fields, required scope, and responses.

{% hint style="warning" %}
Create a [Use Case](/deployment/monitoring-and-analytics/vision-events/use-cases.md) before you send events. An event whose `useCaseId` is not an active Use Case in your workspace is still stored, but the response includes a warning.
{% endhint %}

1. Upload each image with [Upload a Vision Event Image](/deployment/monitoring-and-analytics/vision-events/upload-a-vision-event-image.md#http-api). The response has a `sourceId`.
2. To attach video clips, upload each clip with [Upload a Vision Event Video](/deployment/monitoring-and-analytics/vision-events/upload-a-vision-event-video.md#http-api). You get a `videoId` and a signed URL to upload the clip to, since clips can be up to 3 GB.
3. Create the event with [Create a Vision Event](/deployment/monitoring-and-analytics/vision-events/create-a-vision-event.md#http-api). Put each image `sourceId` in `images[].sourceId` and each `videoId` in `videos[].sourceId`.

To send up to 100 events in one request, use [Batch Create Vision Events](/deployment/monitoring-and-analytics/vision-events/batch-create-vision-events.md#http-api). If your deployment has no route to the cloud, use [Upload a Vision Event Bundle](/deployment/monitoring-and-analytics/vision-events/upload-a-vision-event-bundle.md#http-api).

### Edge Device Backup

For enterprise deployments where connectivity may be intermittent, the edge device stores events locally and syncs them to Roboflow when connectivity is restored.

{% hint style="info" %}
Edge Device Backup requires Deployment Manager. See the [Deployment Manager documentation](/deployment/self-hosted/enterprise/deployment-manager.md) for setup instructions.
{% endhint %}

To enable Vision Events backup:

1. Open **Deployment Manager** in your workspace
2. Select the device to configure
3. Enable **Vision Events Backup** in the device's [Event Store](/deployment/self-hosted/enterprise/deployment-manager/services/event-store.md) configuration
4. Events are written to the local event store on the device
5. When the device reconnects, events sync to Roboflow automatically

Events appear in the Vision Events dashboard after sync completes.

When "Backup Mode" is "Records and Files", video clips attached to events on the device upload too, so they play in the dashboard. MP4 and MOV clips upload, up to four per event. Other formats stay on the device. A clip that fails to upload delays its event by about an hour per retry. After repeated failures (3 by default) the event syncs without the clip. See [Draft Events and Video](/deployment/self-hosted/enterprise/deployment-manager/services/event-store.md#draft-events-and-video) for how a pipeline attaches clips on the device.

<figure><img src="https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-dad946e36678b43e2fe868c8972b9b8853eb724f%2Fimage%20(455).png?alt=media" alt="" width="375"><figcaption></figcaption></figure>
