Overview
The Amazon S3 Export feature enables automated, scheduled exports of your FlexPrice data directly to Amazon S3 buckets. This robust, enterprise-grade solution allows you to configure scheduled tasks to export data at regular intervals, trigger manual exports on-demand, and track all export operations with comprehensive execution history. Key Benefits:- Automated Backups: Schedule regular exports to maintain up-to-date data backups
- Flexible Scheduling: Export data hourly or daily based on your business needs
- Secure Storage: Data encrypted at rest with multiple encryption options
- Compression Support: Reduce storage costs with GZIP compression
- Execution Tracking: Monitor all export runs with detailed execution history
- On-Demand Exports: Trigger manual exports for immediate data exports
Supported Data Types
FlexPrice currently supports exporting the following data types to S3:Invoices
Finalized invoices without line items, taxes, and payment details. Example Export (First Row):Full Example File: Download invoice-example.csv to see the complete CSV structure.
Events
Feature usage events and billing-related activity data. Example Export (First Row):Full Example File: Download events-example.csv to see the complete CSV structure.
Setting Up S3 Export

Prerequisites
Before configuring S3 exports, ensure you have:- An AWS account with S3 access
- An S3 bucket created in your desired region
- AWS credentials (Access Key ID and Secret Access Key)
- Appropriate IAM permissions for S3 operations
Step 1: Create an S3 Connection
An S3 connection stores your AWS credentials and serves as the authentication mechanism for all export operations.
- Connection Name: A descriptive name for your S3 connection (e.g., “Production S3 Export”)
-
AWS Access Key ID: Your AWS access key ID
- Format: Starts with
AKIAfor permanent credentials - Format: Starts with
ASIAfor temporary/session credentials - Required for authentication
- Format: Starts with
-
AWS Secret Access Key: Your AWS secret access key
- This credential is encrypted and stored securely
- Never exposed in API responses
-
AWS Session Token (Optional): Required only for temporary credentials
- Use when working with assumed roles or temporary credentials
- Leave empty for permanent IAM user credentials
Security Best Practice: Create a dedicated IAM user with minimal permissions for S3 exports. Grant only the necessary S3 permissions (
s3:PutObject, s3:GetObject, s3:ListBucket).AWS IAM Policy Example
Create an IAM policy with the following permissions:Replace
your-bucket-name with your actual S3 bucket name. Ensure the IAM user or role has this policy attached before creating the connection.Step 2: Configure a Scheduled Task
Once your S3 connection is established, create a scheduled task to automate exports.
Configuration Options
1. Connection- Select the S3 connection created in Step 1
- Each scheduled task can use different connections if needed
| Entity Type | Description | Data Included |
|---|---|---|
| invoice | Finalized invoices | All invoice data, without line items, taxes, payments |
| events | Feature usage events | Event data, usage metrics, customer activity |
| Interval | Frequency | Cron Schedule | Best For |
|---|---|---|---|
| hourly | Every hour at :15 minutes past | 15 * * * * | Real-time data needs, high-frequency updates |
| daily | Every day at 00:15 AM | 15 0 * * * | Standard backups, daily reporting |
Why the 15-minute buffer?Scheduled exports include a 15-minute buffer after the interval boundary to ensure all data has been ingested and processed. For example, an hourly export scheduled at 10:15 AM will export data from 9:00 AM to 10:00 AM.
Bucket (Required)
- The name of your S3 bucket where files will be stored
- Example:
flexprice-exports-prod - Must exist before creating the scheduled task
Region (Required)
- AWS region where your bucket is located
- Example:
us-west-2,eu-central-1,ap-south-1 - Must match your bucket’s region
Key Prefix (Optional)
- Directory path prefix for organizing files in your bucket
- Example:
flexprice-exports/invoices/ - Example:
production/events/2024/ - Files will be stored as:
{key_prefix}/{filename}.csv
Use key prefixes to organize exports by environment, data type, or date. This makes it easier to manage and query exported data.
Compression (Optional)
Control file compression to reduce storage costs:| Option | Description | File Extension | Compression Ratio |
|---|---|---|---|
| none | No compression (default) | .csv | N/A (original size) |
| gzip | GZIP compression | .csv.gz | ~70-80% size reduction |
- Large datasets with many records
- Storage cost optimization
- Bandwidth-limited environments
- Small datasets (< 1MB)
- Files need to be immediately readable
- Downstream systems don’t support GZIP
Encryption (Optional)
Secure your data at rest with server-side encryption:| Option | Description | Key Management | Best For |
|---|---|---|---|
| AES256 | S3-managed AES-256 encryption (default) | AWS manages keys | Standard security needs |
| aws:kms | AWS KMS encryption | You control keys via KMS | Compliance requirements |
| aws:kms:dsse | KMS with dual-layer encryption | Enhanced KMS security | Maximum security needs |
All encryption options are server-side encryption (SSE). Data is encrypted at rest in S3. AES256 is the default and recommended for most use cases.
- Enable the scheduled task to start automatic exports
- Disable to pause exports without deleting the configuration
- Can be toggled at any time
Step 3: Verify Configuration
After creating a scheduled task:- Verify Connection: Ensure your S3 connection is validated and active
- Check Schedule: Confirm the interval matches your requirements
- Review S3 Settings: Double-check bucket name, region, and paths
- Test with Manual Export: Trigger a manual export to verify the setup

Viewing Export Details
Once you’ve created an export task, you can view its configuration and status by clicking on the task. The export details page shows:- Basic Information: Status, entity type, interval, and connection
- S3 Configuration: Bucket, region, key prefix, compression, and encryption settings
- Timestamps: Creation date and last update time

Manual Export
Manual Export allows you to trigger an immediate export without waiting for the next scheduled execution. This is useful for:- Testing your export configuration
- Backfilling historical data
- Responding to urgent data requests
- Exporting specific time ranges
How to Trigger a Manual Export
Navigate to the export details page and click the “Manual Export” button to trigger a manual export.
Option 1: Automatic Time Range (Default)
Trigger a manual export without specifying time ranges. The system automatically calculates the export window based on the task’s interval: Example - Hourly Task:- Current time: 10:30 AM
- Export window: 10:00 AM to 11:00 AM (current hour)
- Current date: October 16, 2025
- Export window: October 16, 00:00 to October 17, 00:00 (current day)
Option 2: Custom Time Range
Specify exact start and end times for the export: API Request:Custom time ranges must be valid timestamps in RFC3339 format (ISO 8601). The end time must be after the start time.
Manual Export Behavior
- Independent Execution: Manual exports don’t affect the regular schedule
- Parallel Execution: Can run alongside scheduled exports
- Tracked Separately: Appears in the Runs tab with “manual” or “custom” mode
- Same Configuration: Uses the same S3 settings as the scheduled task
- Immediate Processing: Starts execution within seconds
Runs Tab - Execution History
The Runs tab displays a comprehensive history of all export executions for a scheduled task, including both automatic scheduled runs and manual exports.
Accessing Exported Files
Each completed run provides a direct S3 file URL: File Naming Convention:YYMMDDHHMMSS(Year, Month, Day, Hour, Minute, Second)- Example:
251016100000= October 16, 2025, 10:00:00
Troubleshooting Failed Runs
When a run fails, the error summary provides details about what went wrong: Common Failure Reasons:| Error | Cause | Solution |
|---|---|---|
| Connection Failed | Invalid AWS credentials | Verify and update S3 connection credentials |
| Bucket Not Found | S3 bucket doesn’t exist or wrong region | Check bucket name and region in task configuration |
| Permission Denied | Insufficient IAM permissions | Review and update IAM policy |
| No Data Found | No records in the specified time range | Verify the time range or check data availability |
| Timeout | Export took longer than 15 minutes | Contact support or split into smaller time ranges |
Best Practices
Use Descriptive Connection NamesName your S3 connections based on environment and purpose (e.g., “Production Invoice Exports”, “Staging Events Backup”).
Organize with Key PrefixesUse key prefixes to organize exports by environment, data type, and date:
production/invoices/2025/staging/events/
Enable Compression for Large DatasetsUse GZIP compression for exports with thousands of records to reduce storage costs by 70-80%.
Choose the Right Interval
- Hourly: Real-time analytics, high-frequency reporting
- Daily: Standard backups, daily batch processing
Test with Manual ExportAlways test a new scheduled task with a manual export before relying on automatic execution.
Monitor Execution HistoryRegularly review the Runs tab to ensure exports are completing successfully and adjust configuration if needed.
Use IAM Best Practices
- Create dedicated IAM users for exports
- Grant minimal required permissions
- Rotate credentials regularly
- Enable CloudTrail for audit logging
Plan for S3 Lifecycle PoliciesConfigure S3 lifecycle policies to automatically archive or delete old exports:
- Transition to S3 Glacier after 90 days
- Delete files older than 1 year
Troubleshooting
Scheduled Task Not Running
Possible causes:- Task is disabled
- S3 connection is invalid
- Temporal workflow service is down
- Verify the task is enabled in the dashboard
- Check the S3 connection status
- Test with a manual export to isolate the issue
- Review Temporal workflow logs
Files Not Appearing in S3
Possible causes:- Incorrect bucket name or region
- Missing IAM permissions
- Key prefix typo
- Verify bucket name matches exactly (case-sensitive)
- Confirm region matches the bucket’s region
- Review IAM policy and ensure
s3:PutObjectpermission - Check key prefix for typos or trailing slashes
Export Timeout Errors
Possible causes:- Very large time range (months of data)
- Thousands of records in a single export
- S3 upload speed issues
- Reduce the time range for custom exports
- Use hourly intervals instead of daily for high-volume data
- Enable GZIP compression to reduce upload time
- Contact support if issue persists
Invalid Credentials Error
Possible causes:- AWS credentials expired or rotated
- Incorrect Access Key ID or Secret Key
- Session token expired (for temporary credentials)
- Verify credentials in AWS IAM console
- Update the S3 connection with new credentials
- For temporary credentials, refresh the session token
- Ensure the IAM user/role still exists
API Reference
Create Scheduled Task
Update Scheduled Task
Trigger Manual Export
List Scheduled Tasks
Get Task Execution History
Summary
S3 Export provides a comprehensive solution for automated data exports to Amazon S3. Key takeaways:- Two Data Types: Export invoices and events data
- Flexible Scheduling: Hourly or daily automated exports
- Secure Storage: Multiple encryption options for data at rest
- Manual Export Capability: Trigger manual exports anytime
- Execution Tracking: Comprehensive run history and monitoring
- Enterprise-Ready: Compression, encryption, and scalable architecture
- Easy Integration: Standard CSV format for downstream processing

