# Export closed Executions

> Last updated: 2026-12-03.
> For the complete documentation index, see [llms.txt](https://docs.temporal.io/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.
> For related questions, query `https://docs.temporal.io/api/retrieve?q=<question>&jtb=<job-to-be-done>&src=md-page&agent=<your-name>` (no auth; returns JSON `{content, source_url, page_url}`, with `source_url` pointing to Markdown for docs pages). Don't include personal data or credentials.
> If this page is wrong or missing something you needed, or Temporal behaves differently from what it says, report it with `https://docs.temporal.io/api/feedback?title=<summary>&message=<what-happened>&category=documentation&page_url=/cloud/export&src=md-page&agent=<your-name>` (use `category=product` when the product, not the page, is wrong). Report only a specific problem you hit, send it once, and don't include personal data or credentials.

> Export closed Workflow Executions and Standalone Activity Executions from Temporal Cloud to S3, GCS, or Azure Blob Storage hourly in protobuf format for compliance and analytics.

You can export closed Workflow Executions and closed [Standalone Activity](/standalone-activity) Executions from Temporal Cloud to cloud object storage (AWS S3, GCP GCS, or Azure Blob Storage), enabling:

- Compliance and audit trails of complete Event History and Standalone Activity Execution data in [proto format](https://github.com/temporalio/api/blob/main/temporal/api/export/v1/message.proto)
- Analytics on exported Executions when ingested to the data platform of your choice

Exporting from Temporal Cloud provides similar functionality as [Archival](/self-hosted-guide/archival) in a Self-Hosted Temporal Server.
Archival is not supported in Temporal Cloud.

> **Pre-release**
> Exporting Standalone Activity Executions is in Pre-release.
> It's on by default for every export sink and isn't billed during Pre-release.
> Billing starts February 1, 2027 at 0.25 Actions per exported Standalone Activity Execution.
> To export Workflow Executions only, see [Choose which Executions to export](#execution-types).

## Timing and delivery guarantees 

Set up an export sink before Executions close to ensure they are exported.
Exports do not guarantee backfill of previously closed Executions, even if they are still within the Namespace's retention period.
An Execution that closed before you enabled the export sink may still be included if the hourly batch for the hour in which it closed has not run yet.
Do not rely on this behavior to export previously closed Executions.
The same considerations apply when you re-enable an export sink after disabling it.

Exports run in hourly batches, beginning 10 minutes after the hour.
Allow up to 24 hours for an eligible closed Execution to appear in an exported file.

Exports guarantee at-least-once delivery of eligible Executions.
The same Execution may be exported more than once, so duplicates are possible.
Handle duplicate Executions when processing exported data.
Deduplicate Standalone Activity records on `activity_id` and `run_id`.
Duplicate exports of the same Execution do not incur additional [Action charges](/evaluate/cloud/actions#export).

## What's in the exported data 

Each exported file contains one or more closed Executions serialized as protocol buffers using the [`ExportedExecutions`](https://github.com/temporalio/api/blob/main/temporal/api/export/v1/message.proto) proto:

```protobuf
message ExportedExecutions {
    repeated WorkflowExecution workflows = 1;
    repeated ActivityExecution activities = 2;
}
```

- `workflows` contains one complete Event History per Workflow Execution.
- `activities` contains one record per Standalone Activity Execution.

A file can contain Workflow Executions, Standalone Activity Executions, or both.

### Workflow Executions 

Each history is an ordered sequence of events that records everything that happened during a Workflow Execution:

- **Workflow configuration** - Input data, timeouts, Task Queue, retry policies, search attributes, and memo
- **Activity lifecycle** - Each Activity scheduled, started, completed, or failed/timed out, including inputs and results
- **Timers** - Timer starts and fires
- **Signals and Updates** - External Signals received and Update requests handled
- **Child Workflows** - Child Workflow starts and completions
- **Workflow result** - How the Workflow ended (completed, failed, timed out, terminated, canceled, or continued-as-new)

Search attributes in the export use your **user-defined names** (for example, `customerId`), not internal column names.

The export format is **protobuf binary**.
You must deserialize using the [proto schema](https://github.com/temporalio/api/blob/main/temporal/api/export/v1/message.proto) before the data is human-readable.

Payloads are exported in the same form that Temporal Cloud stores them.
If you encode or encrypt payloads with a [Payload Codec](/payload-codec), they stay encoded or encrypted in exported files.
Decode them with the same codec.

The following is a simplified JSON representation of what one Workflow Execution looks like after deserialization.
This example shows a Workflow that started, ran one Activity, and completed:

```json
{
  "workflows": [
    {
      "history": {
        "events": [
          {
            "eventId": "1",
            "eventTime": "2025-02-24T18:00:00Z",
            "eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_STARTED",
            "workflowExecutionStartedEventAttributes": {
              "workflowType": { "name": "OrderWorkflow" },
              "taskQueue": { "name": "order-processing" },
              "input": { "payloads": ["...serialized input..."] },
              "workflowExecutionTimeout": "3600s",
              "searchAttributes": {
                "indexedFields": {
                  "customerId": { "data": "\"customer-42\"" },
                  "orderType": { "data": "\"standard\"" }
                }
              }
            }
          },
          {
            "eventId": "2",
            "eventTime": "2025-02-24T18:00:00Z",
            "eventType": "EVENT_TYPE_WORKFLOW_TASK_SCHEDULED"
          },
          {
            "eventId": "3",
            "eventTime": "2025-02-24T18:00:01Z",
            "eventType": "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED",
            "activityTaskScheduledEventAttributes": {
              "activityType": { "name": "ChargeCustomer" },
              "taskQueue": { "name": "order-processing" },
              "input": { "payloads": ["...serialized input..."] },
              "scheduleToCloseTimeout": "300s",
              "startToCloseTimeout": "60s"
            }
          },
          {
            "eventId": "4",
            "eventTime": "2025-02-24T18:00:02Z",
            "eventType": "EVENT_TYPE_ACTIVITY_TASK_STARTED"
          },
          {
            "eventId": "5",
            "eventTime": "2025-02-24T18:00:03Z",
            "eventType": "EVENT_TYPE_ACTIVITY_TASK_COMPLETED",
            "activityTaskCompletedEventAttributes": {
              "result": { "payloads": ["...serialized result..."] }
            }
          },
          {
            "eventId": "6",
            "eventTime": "2025-02-24T18:00:03Z",
            "eventType": "EVENT_TYPE_WORKFLOW_TASK_COMPLETED"
          },
          {
            "eventId": "7",
            "eventTime": "2025-02-24T18:00:03Z",
            "eventType": "EVENT_TYPE_WORKFLOW_EXECUTION_COMPLETED",
            "workflowExecutionCompletedEventAttributes": {
              "result": { "payloads": ["...serialized result..."] }
            }
          }
        ]
      }
    }
  ]
}
```

The outer `workflows` array can contain multiple Workflow Executions per file.
Only the key fields are shown above. Actual events include additional fields like `version`, `taskId`, and `workerVersion`.

### Standalone Activity Executions 

Each Standalone Activity Execution is exported as a single record, not an event sequence.
The record uses the same structure as the [`DescribeActivityExecution`](https://github.com/temporalio/api/blob/main/temporal/api/workflowservice/v1/request_response.proto) API response, which is also what `temporal activity describe --output json` prints.

Each record includes:

- **Identity** - Activity ID, Run ID, Activity Type, and Task Queue
- **Configuration** - Timeouts, Retry Policy, Priority, and Start Delay
- **Input** - The input passed when the Standalone Activity was started
- **Outcome** - Final status and the result or failure
- **Attempts** - Attempt count, last failure, and last Worker identity
- **Heartbeats** - Heartbeat count, last Heartbeat time, and last Heartbeat details
- **Timing** - Schedule, start, and close times, and execution duration
- **Metadata** - Search Attributes, headers, user metadata, links, and SDK name and version

The record holds the final attempt and the last Heartbeat.
It does not include each retry attempt or each Heartbeat.

Search Attribute names, the protobuf binary format, and payload encoding work the same way as for [Workflow Executions](#workflow-executions).

The following is a simplified JSON representation of one Standalone Activity Execution after deserialization:

```json
{
  "activities": [
    {
      "activity": {
        "runId": "0198f3a2-6c1e-7a4b-9d2f-3e5c8b1a4d07",
        "info": {
          "activityId": "charge-order-42",
          "runId": "0198f3a2-6c1e-7a4b-9d2f-3e5c8b1a4d07",
          "activityType": { "name": "ChargeCustomer" },
          "status": "ACTIVITY_EXECUTION_STATUS_COMPLETED",
          "taskQueue": "order-processing",
          "scheduleToCloseTimeout": "300s",
          "startToCloseTimeout": "60s",
          "heartbeatTimeout": "10s",
          "attempt": 2,
          "scheduleTime": "2025-02-24T18:00:00Z",
          "lastStartedTime": "2025-02-24T18:00:04Z",
          "closeTime": "2025-02-24T18:00:05Z",
          "executionDuration": "5s",
          "lastWorkerIdentity": "worker-7@host-a",
          "totalHeartbeatCount": "3",
          "lastHeartbeatTime": "2025-02-24T18:00:04.500Z",
          "heartbeatDetails": { "payloads": ["...serialized heartbeat details..."] },
          "lastFailure": {
            "message": "payment gateway timeout",
            "source": "GoSDK",
            "applicationFailureInfo": {
              "type": "GatewayTimeoutError",
              "nonRetryable": false
            }
          },
          "searchAttributes": {
            "indexedFields": {
              "customerId": { "data": "\"customer-42\"" }
            }
          }
        },
        "input": { "payloads": ["...serialized input..."] },
        "outcome": {
          "result": { "payloads": ["...serialized result..."] }
        }
      }
    }
  ]
}
```

This example shows a Standalone Activity that failed its first attempt, succeeded on the second, and heartbeated three times.
`lastFailure` holds the failure from the first attempt.
`heartbeatDetails` holds the details from the last Heartbeat.
Only the key fields are shown above.

### Migrate from `WorkflowExecutions` 

`ExportedExecutions` replaces the legacy [`WorkflowExecutions`](https://github.com/temporalio/api/blob/main/temporal/api/export/v1/message.proto) proto.
Both protos use field 1 for Workflow Executions, so the binary format is unchanged and existing code keeps working.

| Deserialize as                | Workflow Executions field | Standalone Activity Executions field | Reads Standalone Activity records |
| ----------------------------- | ------------------------- | ------------------------------------ | --------------------------------- |
| `WorkflowExecutions` (legacy) | `items` (field 1)         | None                                 | No. Field 2 is ignored.           |
| `ExportedExecutions`          | `workflows` (field 1)     | `activities` (field 2)               | Yes                               |

- Code that deserializes exported files as `WorkflowExecutions` continues to read Workflow Executions and ignores Standalone Activity records.
- The field names differ between the two protos.
  If you convert exported data to JSON, Workflow Executions appear under `items` with `WorkflowExecutions` and under `workflows` with `ExportedExecutions`.
  Update code that reads these field names when you switch.
- To read Standalone Activity records, deserialize as `ExportedExecutions` and read `activities`.
  For a Go example, see [`export/deserializer.go`](https://github.com/temporalio/cloud-samples-go/blob/main/export/deserializer.go) in `cloud-samples-go`.
- To keep Standalone Activity records out of exported files, [disable Standalone Activity export](#execution-types).

## Prerequisites 

To export closed Executions, you must have:

1. A cloud account in the cloud provider where your Namespace is hosted.
2. An object storage bucket available to receive the exported data.

## Configure an export sink 

### AWS

[Export to AWS S3](/cloud/export/aws-export-s3)

### GCP

[Export to GCS](/cloud/export/gcp-export-gcs)

### Azure

[Export to Azure Blob Storage](/cloud/export/azure-export-blob-storage)

## Choose which Executions to export 

An export sink exports closed Workflow Executions and closed Standalone Activity Executions by default.
To export Workflow Executions only, disable Standalone Activity export on the sink.

| Sink enabled | Standalone Activity export disabled | Exported                                    |
| ------------ | ----------------------------------- | ------------------------------------------- |
| Yes          | No (default)                        | Workflow and Standalone Activity Executions |
| Yes          | Yes                                 | Workflow Executions only                    |
| No           | Any                                 | Nothing                                     |

Exporting Standalone Activity Executions without Workflow Executions is not supported.

Disable Standalone Activity export in any of the following ways:

- **Temporal Cloud UI:** In the Namespace **Export** settings, under **Select Executions to export**, clear **Standalone Activities**.
- **Temporal CLI:** Pass `--disable-standalone-activity-export` to `temporal cloud namespace export s3 create`, `temporal cloud namespace export s3 update`, `temporal cloud namespace export gcs create`, or `temporal cloud namespace export gcs update`.
- **Cloud Ops API:** Set `filter.disable_standalone_activity_export` to `true` on `ExportSinkSpec` in `CreateNamespaceExportSink` or `UpdateNamespaceExportSink`.
- **Terraform:** Set `filter.disable_standalone_activity_export = true` on the `temporalcloud_namespace_export_sink` resource.

For example, with the Temporal CLI:

```command
temporal cloud namespace export s3 update \
  --namespace "your-namespace.your-account" \
  --sink-name "your-sink-name" \
  --disable-standalone-activity-export
```

Each exported Standalone Activity Execution accrues 0.25 Actions.
These Actions appear as **Export Activity Execution** under the Activity category in the [Usage Dashboard](/cloud/actions-usage), separate from Workflow export.
If you turn Standalone Activity export back on partway through an hour, that hour isn't billed for Standalone Activity export.
See [Actions: Export](/evaluate/cloud/actions#export).

## Verify export setup 

From the **Export Configuration** page, select **Verify**.
This validates that Temporal can successfully write a test file to your object storage.

If everything is configured correctly, you will see a `Success` status indicating Temporal has written to the object store.

## Monitor export progress 

After you configure an export sink, you can check that it's still working in several ways:

1. **Object Storage**:

   - File Delivery: After enabling an export sink and closing an Execution, inspect your object storage for exported files.
     Exports run in hourly batches, but allow up to 24 hours for the Execution to appear.
     Executions that closed before the export sink was enabled are not guaranteed to be exported.
   - Directory Structure: Your exported files will adhere to the following naming convention and path:

   ```bash
   //[bucket-name]/temporal-workflow-history/export/[Namespace]/[Year]/[Month]/[Day]/[Hour]/[Minute]/
   ```
The exported file name will include a randomly generated ID. The time recorded in the directory structure
is the time the export uploads to object storage, not the Execution close time.
Workflow and Standalone Activity Executions are written to the same path and the same files.

2. **Temporal Cloud Web UI**:

   - Export UI:

      - Last Successful Export: This displays the timestamp of the most recent successful export.
      - Last Status Check: This reflects the timestamp of the latest internal Workflow healthcheck.

   - Usage Dashboard:
      - Actions from export jobs are included in the [Usage Dashboard](/cloud/actions-usage).

3. **Email**:
   - Emails are sent to `Namespace Administrator`, `Account Owner`, and `Global Administrator` roles when an export job fails due to a user related error (such as Object Store permissions issue).

> **📝 Note:**
>
> An export configuration that fails for 7 consecutive days is automatically disabled.
>

## Working with exported files

Use the proto schema defined [here](https://github.com/temporalio/api/blob/main/temporal/api/export/v1/message.proto) to deserialize exported files as `ExportedExecutions`.
If your code deserializes exported files as `WorkflowExecutions`, see [Migrate from `WorkflowExecutions`](#backward-compatibility).

### Using exported files in analytics

It can be useful to convert protos to another format to perform analytics on the data. To convert protos to parquet, follow 
[the example Python Workflow](https://github.com/temporalio/samples-python/tree/main/cloud_export_to_parquet). Note that this example Workflow:
* Transforms the nested proto structure into a flat, tabular format.
* Each row in the table represents a single history event from a Workflow. To preserve their relationship post-conversion, the `workflowID` and `runID` is included in every row.
* Converts Workflow Executions only. It does not convert Standalone Activity records.
* If you have enabled the codec server, the payload field is encrypted. This field may contain characters that are not recognized when loaded into a database so the payload field is excluded in this example.

## Export and High Availability Namespaces 

### Export region persistence

When an export sink is configured for a [High Availability](/cloud/high-availability) Namespace, the export is tied to the specific region where it was initially set up. The export configuration does not automatically failover with the Namespace.

- If an export sink is configured in Region A, it will continue to export from Region A's storage even after a Namespace failover to Region B
- Exports always read from and write to the same region where they were originally configured
- The export process is independent of Namespace failover events
- Export sinks do not fail over automatically because we prioritize data completeness and consistency over real-time availability for exports. HA data replication has inherent latency, which could result in incomplete or inconsistent exports during a failover.

### Failover scenarios

**Namespace Failover with Healthy Primary Region**: When a Namespace fails over to a secondary region but the primary region remains healthy (including its blob storage), the export job continues to operate from the primary region. It does not automatically switch to export data from the secondary region.

**Primary Region Outage**: If the primary region (where the export sink was configured) experiences a complete outage including object storage: Exports will be unavailable until the primary region recovers. Once the primary region recovers, export will resume and include any Workflow histories that occurred during the outage. There may be delays in export processing, but the complete dataset will eventually be available. It does not automatically switch to export data from the secondary region.
