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

# Exports

> Parquet files of your events, delivered daily or hourly to your own Google Cloud Storage or Amazon S3 bucket, ready to load into BigQuery or Snowflake.

Exports write a project's events (or every project's, from the All projects view) as Parquet files to a bucket you own, in Google Cloud Storage or Amazon S3. Load them into BigQuery, Snowflake, or anything else that reads Parquet.

Raindrop never holds a key to your cloud. On Google Cloud it signs in through workload identity federation; on AWS it assumes a role you create, with an external ID. Either way it can only add files under your export folder. It can't read, overwrite, or delete them.

## Before you start

* **Enterprise only.** Exports are part of the [Enterprise plan](https://raindrop.ai/docs/platform/plans.md). [Contact us](mailto:support@raindrop.ai) to turn them on.
* **Org admin.** Only organization admins can set up and manage exports.
* **Which events.** From a project, a destination exports that project. From the [All projects view](https://raindrop.ai/docs/platform/projects.md#the-all-projects-view), you choose **All projects** (every active project in the org) or **One project**. Each row carries its `project_id`.

Setup has three steps under **Settings › Exports › Add destination**: **Destination**, **Access**, **Turn on**. **Finish later** on the Access step leaves the destination in the list as **Setup not finished**; opening it again returns to Access.

## Set up Google Cloud Storage

### 1. Destination

Pick **Google Cloud Storage** and how often files are written (**Daily** or **Hourly**, see [Schedules](#schedules-and-files)), then click **Continue**.

### 2. Access

The Access step lists four `gcloud` steps, with fields above the commands they feed. The commands redraw as you type, so copy them from the page. They need IAM and Storage admin on the Google Cloud project. Fill in:

| Field | What to enter |
| - | - |
| **Project number** | The number of the project that will own the bucket, not its ID. `gcloud projects list --format="table(projectId,projectNumber)"` lists both. |
| **Bucket name** | A new, globally unique name. Starts as `raindrop-exports-` plus eight characters. |
| **Location** | Where the bucket lives. Use your BigQuery dataset's location: BigQuery reads external files only from its dataset's location. Defaults to `US`. |
| **Folder** | Optional prefix inside the bucket. Defaults to `raindrop/`. |

Then run each step in [Cloud Shell](https://shell.cloud.google.com/?show=terminal). With placeholders, they look like this:

**1. Open Cloud Shell**

Points `gcloud` at your project, so the later steps run without `--project`.

```bash theme={null}
gcloud config set project \
  "$(gcloud projects list --filter="projectNumber=PROJECT_NUMBER" --format="value(projectId)")"
```

**2. Create the bucket**

A new bucket only for Raindrop exports, with uniform bucket-level access and public access blocked.

```bash theme={null}
gcloud storage buckets create gs://BUCKET_NAME \
  --location=LOCATION \
  --uniform-bucket-level-access --public-access-prevention
```

Uniform bucket-level access is required: a federated identity can't write to a bucket that uses per-object ACLs.

**3. Let Raindrop sign in**

Creates a workload identity pool and an AWS provider that trusts only Raindrop's export writer role. No keys change hands. Already done for another destination in this project? Skip this step.

```bash theme={null}
gcloud iam workload-identity-pools create raindrop \
  --location=global --display-name="Raindrop exports"

gcloud iam workload-identity-pools providers create-aws raindrop-aws \
  --location=global --workload-identity-pool=raindrop \
  --account-id=248189901873 \
  --attribute-mapping="google.subject=assertion.arn" \
  --attribute-condition="assertion.arn.startsWith('arn:aws:sts::248189901873:assumed-role/raindrop-export-writer/')"
```

**4. Let Raindrop write**

Grants this one destination `roles/storage.objectCreator` on the bucket. It can add files, but not read, change, or delete them. The member names this destination's ID, so each destination needs its own grant.

```bash theme={null}
gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME \
  --role=roles/storage.objectCreator \
  --member="principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/raindrop/subject/arn:aws:sts::248189901873:assumed-role/raindrop-export-writer/cfg-DESTINATION_ID"
```

Click **Test connection**. Raindrop saves the fields, signs in the way a real export does, and writes one small file to `gs://BUCKET_NAME/raindrop/_raindrop/connection-test-<time>.json`. A passing test links to the file in the Cloud console and moves you to Turn on.

#### When the test fails

A failure shows on the step to run again, with Google's own reply underneath.

| Message | What it means |
| - | - |
| Google can't find provider `raindrop-aws` in pool `raindrop` of project `<number>`. Check the project number, then run "Let Raindrop sign in". | The project number is wrong, or the pool or provider doesn't exist in that project. Google answers the same way for all three. |
| Provider `raindrop-aws` already exists and turns our identity away. Update its attribute condition to the one in "Let Raindrop sign in". | The provider exists with a different attribute condition. |
| Provider `raindrop-aws` already exists and trusts a different AWS account. Update its account ID to `248189901873`. | The provider exists with a different AWS account ID. |
| Google rejected our identity. Check the pool and provider from "Let Raindrop sign in". | Any other refusal of the sign-in. |
| `gs://<bucket>` uses per-object ACLs, which our identity can't use. Pick a new bucket name and run "Create the bucket" again. | The bucket doesn't have uniform bucket-level access. |
| Can't create files in `gs://<bucket>`. Run "Let Raindrop write". A new grant can take a minute to apply. | Sign-in worked, but the bucket grant is missing or hasn't applied yet. |
| `gs://<bucket>` doesn't exist. Run "Create the bucket". | No bucket by that name. |
| Enter the project number first. | The project number field is empty. |

### 3. Turn on

The last step shows the destination, the schedule, when the **First file** lands and which UTC day or hour it covers, and the [Existing data](#existing-data) choice. Click **Turn on**. Raindrop runs the connection test once more, then starts delivering.

## Set up Amazon S3

### 1. Destination

Pick **Amazon S3** and enter the **Bucket** (name only, no `s3://`), its **Region** (defaults to `us-east-1`), an optional **Folder** (defaults to `raindrop/`), and the schedule. The bucket must already exist, in the same AWS account as the role you create next.

### 2. Access

Create an IAM role that Raindrop's export writer can assume. The setup page offers two ways, both filled in with your bucket, folder, and this destination's external ID (`rd-` followed by 24 hex characters):

* **AWS CLI**: three commands that create a role named `raindrop-exports-<8 characters>`, attach its policy, and print its ARN. Needs permission to create IAM roles.
* **Console**: the trust policy and permissions policy below, for a role you create by hand under any name.

Trust policy. Only Raindrop's writer role, presenting this destination's external ID, can assume the role:

```json theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "AWS": "arn:aws:iam::248189901873:root" },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": { "sts:ExternalId": "EXTERNAL_ID" },
        "ArnEquals": { "aws:PrincipalArn": "arn:aws:iam::248189901873:role/raindrop-export-writer" }
      }
    }
  ]
}
```

Permissions policy. Create-only writes under the folder: S3 refuses any put that would overwrite an object.

```json theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::BUCKET_NAME/raindrop/*",
      "Condition": { "Null": { "s3:if-none-match": "false" } }
    }
  ]
}
```

Paste the **Role ARN** and click **Test connection**. Raindrop writes one small file to `s3://BUCKET_NAME/raindrop/_raindrop/connection-test-<time>.json` and links to it.

| Message | What it means |
| - | - |
| Couldn't assume the role. Check its trust policy and external ID. | The trust policy doesn't match, or the external ID is wrong. |
| The role can't write to `s3://<bucket>/<folder>`. Check its permissions policy, the bucket's KMS key, and that the bucket is in the role's account. | The role was assumed but S3 refused the write. Raindrop only writes to a bucket owned by the role's account. |
| Check the bucket name and region (`<region>`). | The bucket name or region is wrong. |
| Paste the role ARN first. | The Role ARN field is empty. |

### 3. Turn on

Same as [for Google Cloud Storage](#3-turn-on).

## Schedules and files

| Schedule | Each file covers | Lands |
| - | - | - |
| Daily | One UTC day | Around 02:15 UTC the next day |
| Hourly | One UTC hour | About 2 hours after the hour ends, at a quarter past |

The two-hour wait lets most signals and topics land on events before they're exported. The first file covers the oldest UTC day (or hour) that isn't due yet when you turn the destination on; on a daily schedule that's usually the current day. The Turn on step shows exactly which window and when it lands. Earlier data comes from [Existing data](#existing-data).

Files land in one folder per UTC date:

```
gs://BUCKET_NAME/raindrop/events/date=2026-11-19/part-0000-<run>-00.parquet
gs://BUCKET_NAME/raindrop/events/date=2026-11-19/part-1300-<run>-00.parquet
```

* Folders are by `received_at`, the UTC time the event reached Raindrop, not the event's own `timestamp`.
* A file name starts with its window's start time (`HHmm`): `0000` for a daily file, the hour for an hourly one. Both schedules use the same folder depth, so switching schedules doesn't move anything.
* A large window is split across several part files.
* Files are Parquet with zstd compression. Nothing is ever overwritten: a re-export adds new files next to the old ones.

You can switch between daily and hourly on the destination's page under **Settings**. The new schedule picks up where the last delivery ended, so nothing is skipped or sent twice.

## Existing data

Turn on includes **Also export existing data**, on by default. It exports one week: by default the last 7 days, up to where regular delivery starts, so the two meet with no gap. Click the date to pick another week instead; the picker goes back about two months, and not before your first event. Next to the date, the step shows the days covered, how many events they hold, and a rough time estimate.

* History arrives as one file per UTC day, newest day first, in the same `date=` folders as regular files. Hourly destinations get whole-day files for history too.
* The destination's page shows progress (`3 of 7 days`) with an estimate of the time left. **Stop** pauses it and **Resume** continues where it stopped. While the destination is paused, the export waits too.
* If a day fails, the panel shows the day and the reason, and **Retry** continues from there.
* When it's done, the panel shows the range and row count. **Export another week** exports any other week up to 2 months back, by default the 7 days before the one just exported. Repeat it to go further back.
* If you turned the destination on without existing data, the panel says **Not exported** and offers the same week picker.

Only one existing-data export runs per destination at a time.

## Deliveries and re-exports

The destination's page charts rows delivered per day (last 30 days) or per hour (last 72 hours), and lists each delivery, newest first, starting with the next file due. Open a row to see its files, the window it covers in UTC and your time, and one action:

* **Re-export** a delivered day or hour. It writes a new set of files next to the old ones; the [dedupe views](#load-into-bigquery) keep one row per event.
* **Retry** a failed one.
* **Export** a window that wasn't delivered because the destination was paused or stopped.

A window can be written again once it's at least 2 hours past its end, and up to 7 days back.

## Load into BigQuery

The destination's page has a **Load into your warehouse** panel with this SQL, filled in with your bucket and folder. For a Cloud Storage bucket, create a dataset in the bucket's location.

BigQuery reads the files as the person (or service account) running the query, so they need Storage Object Viewer on the bucket. With uniform bucket-level access, project Owner and Editor can list the files but not read them, so grant it even to them:

```bash theme={null}
gcloud storage buckets add-iam-policy-binding gs://acme-analytics-exports \
  --member=user:you@example.com --role=roles/storage.objectViewer
```

Then create the table and view:

```sql theme={null}
CREATE EXTERNAL TABLE `your_project.raindrop.events_files`
WITH PARTITION COLUMNS
OPTIONS (
  format = 'PARQUET',
  enable_list_inference = true,
  uris = ['gs://acme-analytics-exports/raindrop/events/*'],
  hive_partition_uri_prefix = 'gs://acme-analytics-exports/raindrop/events'
);

-- One row per event: its latest version, from the newest file.
CREATE VIEW `your_project.raindrop.events` AS
SELECT * FROM `your_project.raindrop.events_files`
WHERE TRUE
QUALIFY ROW_NUMBER() OVER (PARTITION BY event_id ORDER BY received_at DESC, _exported_at DESC) = 1;
```

The external table reads new files as they land, so there's nothing to schedule. Its `date` column comes from the `date=` folders; filter on it to read fewer files. `enable_list_inference` makes `signals` and `topics` plain `ARRAY<STRING>` columns; without it BigQuery reads them as nested structs.

Query the view, not the table. The same `event_id` can appear in more than one file:

* A re-export adds a second copy of a window.
* An event that is updated after it was exported gets a newer `received_at`, so its new version lands in a later date folder.

The view keeps the row with the newest `received_at`, and among equal ones the most recently exported.

For an S3 bucket, BigQuery reads through [BigQuery Omni](https://cloud.google.com/bigquery/docs/omni-introduction). You need an Omni connection in the bucket's region and a dataset in the same location. The table then adds a connection and uses `s3://` paths:

```sql theme={null}
CREATE EXTERNAL TABLE `your_project.raindrop.events_files`
WITH PARTITION COLUMNS
WITH CONNECTION `aws-us-east-1.your_connection`
OPTIONS (
  format = 'PARQUET',
  uris = ['s3://acme-analytics-exports/raindrop/events/*'],
  hive_partition_uri_prefix = 's3://acme-analytics-exports/raindrop/events'
);
```

## Load into Snowflake

Snowflake loads each file into a `VARIANT` column through a storage integration and a stage. For S3, a one-time `COPY INTO` loads the files already there and a Snowpipe loads each new one. For Cloud Storage, a task runs `COPY INTO` every hour; `COPY` skips files it has already loaded. Replace the placeholders in angle brackets.

> [tab] Google Cloud Storage
>
> ```sql theme={null}
> CREATE STORAGE INTEGRATION raindrop_exports
>   TYPE = EXTERNAL_STAGE
>   STORAGE_PROVIDER = 'GCS'
>   ENABLED = TRUE
>   STORAGE_ALLOWED_LOCATIONS = ('gcs://acme-analytics-exports/raindrop/events/');
> -- Then run DESC INTEGRATION raindrop_exports and give its service account
> -- Storage Object Viewer on the bucket.
>
> CREATE STAGE raindrop_events_stage
>   STORAGE_INTEGRATION = raindrop_exports
>   URL = 'gcs://acme-analytics-exports/raindrop/events/'
>   FILE_FORMAT = (TYPE = PARQUET);
>
> CREATE TABLE raindrop_events (
>   record VARIANT,
>   file_name STRING,
>   loaded_at TIMESTAMP_LTZ DEFAULT CURRENT_TIMESTAMP()
> );
>
> -- Loads new files every hour; COPY skips files it has already loaded.
> CREATE TASK raindrop_events_load
>   WAREHOUSE = your_warehouse
>   SCHEDULE = '60 MINUTE'
> AS
>   COPY INTO raindrop_events (record, file_name)
>   FROM (SELECT $1, METADATA$FILENAME FROM @raindrop_events_stage);
> ALTER TASK raindrop_events_load RESUME;
>
> -- One row per event: its latest version, from the newest file.
> CREATE VIEW raindrop_events_latest AS
> SELECT * FROM raindrop_events
> QUALIFY ROW_NUMBER() OVER (
>   PARTITION BY record:event_id ORDER BY record:received_at DESC, record:_exported_at DESC
> ) = 1;
> ```

> [tab] Amazon S3
>
> ```sql theme={null}
> CREATE STORAGE INTEGRATION raindrop_exports
>   TYPE = EXTERNAL_STAGE
>   STORAGE_PROVIDER = 'S3'
>   ENABLED = TRUE
>   STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::<your-account>:role/<role that can read this folder>'
>   STORAGE_ALLOWED_LOCATIONS = ('s3://acme-analytics-exports/raindrop/events/');
> -- Then run DESC INTEGRATION raindrop_exports and let its IAM user assume that role.
>
> CREATE STAGE raindrop_events_stage
>   STORAGE_INTEGRATION = raindrop_exports
>   URL = 's3://acme-analytics-exports/raindrop/events/'
>   FILE_FORMAT = (TYPE = PARQUET);
>
> CREATE TABLE raindrop_events (
>   record VARIANT,
>   file_name STRING,
>   loaded_at TIMESTAMP_LTZ DEFAULT CURRENT_TIMESTAMP()
> );
>
> -- Loads the files already there once (a pipe only picks up files that arrive after it).
> COPY INTO raindrop_events (record, file_name)
>   FROM (SELECT $1, METADATA$FILENAME FROM @raindrop_events_stage);
>
> -- Loads each file as it arrives. Point the bucket's event notifications for this folder
> -- at the pipe's notification_channel (SHOW PIPES).
> CREATE PIPE raindrop_events_pipe AUTO_INGEST = TRUE AS
>   COPY INTO raindrop_events (record, file_name)
>   FROM (SELECT $1, METADATA$FILENAME FROM @raindrop_events_stage);
>
> -- One row per event: its latest version, from the newest file.
> CREATE VIEW raindrop_events_latest AS
> SELECT * FROM raindrop_events
> QUALIFY ROW_NUMBER() OVER (
>   PARTITION BY record:event_id ORDER BY record:received_at DESC, record:_exported_at DESC
> ) = 1;
> ```
>
> The role in `STORAGE_AWS_ROLE_ARN` is yours to create for Snowflake, with read access to the folder. It is not the role Raindrop writes with.

As in BigQuery, query the dedupe view (`raindrop_events_latest`), not the table.

## Columns

Each row is one version of one event. New columns may be added at the end; existing columns keep their name and type.

| Column | Type | Contents |
| - | - | - |
| `event_id` | string | The event's ID. Dedupe on this. |
| `project_id` | string | The project the event belongs to. |
| `event_name` | string | The event name. |
| `timestamp` | timestamp (ms, UTC) | When the event happened, as sent by your app. |
| `received_at` | timestamp (ms, UTC) | When Raindrop received this version of the event. Decides the `date=` folder. |
| `user_id` | string | Your user ID. |
| `convo_id` | string, nullable | Conversation ID. |
| `custom_event_id` | string, nullable | Your own ID for the event, if you sent one. |
| `ai_model` | string, nullable | Model name. |
| `ai_input` | string | The input. |
| `ai_output` | string | The output. |
| `input_tokens` | int64 | Input tokens, summed over the event. |
| `output_tokens` | int64 | Output tokens, summed over the event. |
| `tool_call_count` | int64 | Number of tool calls. |
| `error_count` | int64 | Number of errors. |
| `signals` | list of strings | Names of the [signals](https://raindrop.ai/docs/platform/signals.md) on the event. |
| `topics` | list of strings | Names of the topics on the event. |
| `properties` | string (JSON) | Event properties. |
| `user_traits` | string (JSON) | User traits. |
| `tool_calls` | string (JSON) | Tool calls. |
| `errors` | string (JSON) | Errors. |
| `_schema_version` | int64 | File schema version, currently `1`. |
| `_exported_at` | timestamp (ms, UTC) | When Raindrop wrote this row. |

## Pause, failures, and deleting

* **Pause** stops delivery. Turning the destination back on resumes with the next window due; windows that came due while it was paused are not sent automatically. Export them from the deliveries list (up to 7 days back).
* **Failures.** If a delivery fails because of your bucket or its permissions, the destination shows the same kind of message as the connection test. Raindrop retries every hour. If a window is still failing a day after it was due, the destination stops (**Stopped after an error**). Fix the cause, click **Test connection**, then **Turn back on**, and export the missed windows from the deliveries list. A failure on Raindrop's side reads "The export failed on our side and will be retried."
* **Delete** removes the destination and its delivery history. Files already in your bucket stay.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.