> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Organize streamed data into Assets and Runs

> Associate your streamed telemetry with Runs

After completing this topic, you can create a Run and associate your streamed telemetry with it so that your data is grouped into a named, time-bounded capture in Sift.

## Before you begin

* You have a Sift API key and base URL. See [Authentication](/documentation/manage/set-up-api-access).
* You are already streaming data to Sift, or you are setting up streaming for the first time. See [Stream telemetry from a running application](/documentation/ingest/stream/stream-telemetry-from-a-running-application).

## How Assets are created

An [Asset](/documentation/reference/asset-settings) exists in Sift in one of two ways:

* Sift creates it automatically the first time data arrives for its name, whether through streaming, file upload, Run creation, or an ingestion config.
* You create it explicitly before any data exists, using the **New Asset** button on the Assets page or the `CreateAsset` call on the [Asset API](/api/reference/protocol-buffers/assets). See [Create an asset](/documentation/reference/asset-settings#create-an-asset).

Either way, data ingested for an existing Asset name attaches to that Asset rather than creating a duplicate.

## How Runs work

A [Run](/documentation/reference/runs-reference) is a distinct grouping of time-series data captured from one or more [Assets](/documentation/ingest/stream/organize-streamed-data-into-assets-and-runs). By organizing telemetry into Runs, you can isolate specific events, tests, or missions, and investigate patterns, assess performance, and diagnose anomalies within a contextual timeframe.

The [Run API](/api/reference/protocol-buffers/runs) supports the following fields:

* `start_time`, `stop_time`—the time window of the Run.
* `asset_ids`—one Run can span multiple assets.
* `duration`—computed from `stop_time - start_time`, or ongoing if `stop_time` is not set.

The general workflow is:

1. Optional: [create the Asset](/documentation/reference/asset-settings#create-an-asset). If it does not exist, Sift creates it when data first arrives.
2. Create a Run.
3. Stream data for an asset, including the Run ID in each request.
4. View the Run in Sift.

## Create a Run and associate it with streamed data

### Step 1: Create a Run

Call `RunService.CreateRun`. The response returns a `CreateRunResponse` containing a `Run` with a `run_id`. Save the `run_id`; you will include it in your ingestion requests.

<Info>
  **Client keys**

  The `Run` message has an optional `client_key` field that lets you assign a unique identifier to the Run. Although optional, it is recommended because it makes querying runs more convenient. A `client_key` can only be set once, at creation or on the first update.
</Info>

### Step 2: Associate data with the Run

There are two ways to associate a Run with asset data.

**Manual association (recommended)**

Include the `run_id` in each ingestion request. For ingestion-config-based streaming, add it to the `IngestWithConfigDataStreamRequest`:

```protobuf theme={null}
IngestWithConfigDataStreamRequest {
  ingestion_config_id: "<your-config-id>",
  run_id: "<your-run-id>",
  flow: "<flow-name>",
  timestamp: <timestamp>,
  channel_values: [...],
}
```

This ensures that the asset data in each request is associated with the specified Run.

<Info>
  **Retrieving a Run ID**

  If the Run ID is not available, query your runs first. See [Continue streaming across multiple runs](/documentation/ingest/stream/continue-streaming-across-multiple-runs) for how to retrieve runs by `client_key`.
</Info>

**Automatic association**

Call `RunService.CreateAutomaticRunAssociationForAssets` to associate a Run with specific assets in advance. Data arriving for those assets will automatically associate with the Run; you do not need to include the `run_id` in each ingestion request.

<Warning>
  **Non-standard workflow**

  Automatic association is not the standard workflow. If you use it, do not include the `run_id` in your `IngestWithConfigDataStreamRequest` for the associated assets. If one of the specified assets already has an ongoing Run (a Run with no `stop_time`), the endpoint will return an error.
</Warning>

## Verify the result

After streaming, open Sift and navigate to the asset you streamed data for. You should see:

* The Run listed with its name and start time.
* Channel data visible within the Run's time window in Explore.

## Next steps

* [Continue streaming across multiple runs](/documentation/ingest/stream/continue-streaming-across-multiple-runs)
* [Stream telemetry from a running application](/documentation/ingest/stream/stream-telemetry-from-a-running-application)

## Reference

* [Run API reference](/api/reference/protocol-buffers/runs#run)
* [RunService reference](/api/reference/protocol-buffers/runs#runservice)
* [Runs overview](/documentation/reference/runs-reference)
* [Assets overview](/documentation/ingest/stream/organize-streamed-data-into-assets-and-runs)
* [Ingestion config streaming reference](/documentation/reference/stream/ingestion-config-streaming-reference)
