Skip to main content

What is Storage?

Storage is Triform’s built-in file management system that enables your Actions to save and retrieve files. Whether you’re processing documents, generating reports, or handling uploads, Storage provides a simple, secure way to work with files in your workflows.

Key Features

  • S3-Compatible β€” Works with any S3-compatible storage backend
  • Project-Scoped β€” Files are isolated per project for security
  • Simple API β€” Two functions: save_file() and get_file()
  • Automatic Authentication β€” No manual credential management needed
  • Secure by Default β€” Encrypted storage with proper access controls

Using Storage in Actions

Saving Files

Use save_file() to store a file in your project’s storage:
Parameters:
  • filename β€” Name for the file (including extension)
  • content β€” File content (bytes, string, or file-like object)
  • content_type β€” MIME type of the file (optional, auto-detected if omitted)

Retrieving Files

Use get_file() to retrieve a previously saved file:
Parameters:
  • file_path β€” The path returned from save_file() or provided via input

Common Patterns

Pattern 1: Document Processing Pipeline

Pattern 2: Report Generation

Pattern 3: Image Processing

File Upload via API

You can upload files to your projects via the FormData API:
The response includes the file path you can use in subsequent action executions.

Storage Configuration

Storage is configured at the project level via Modifiers:
  1. Go to Project β†’ Properties β†’ Modifiers
  2. Click Add Modifier β†’ Storage
  3. Configure your storage backend (S3 credentials, bucket, region)
  4. Save
Once configured, all Actions in the project can use save_file() and get_file().

Storage Limits

Security

  • Encryption at Rest β€” All files are encrypted in storage
  • Encryption in Transit β€” HTTPS for all file transfers
  • Project Isolation β€” Files are scoped to projects, preventing cross-project access
  • Access Control β€” Only authenticated Actions within the project can access files
  • Credential Management β€” Storage credentials are managed by Triform, never exposed to Actions

Best Practices

Use meaningful filenames β€” Include dates, IDs, or descriptive names for easier debugging
Clean up temporary files β€” Remove files you no longer need to save storage
Handle large files carefully β€” Stream large files rather than loading entirely into memory
Check file existence β€” Handle cases where files may not exist gracefully

Troubleshooting

Problem: save_file() fails with permission error
Solution: Check that storage modifiers are configured for your project
Problem: get_file() returns empty or None
Solution: Verify the file path is correct and the file exists
Problem: File uploads timeout
Solution: For large files, consider chunked uploads or compression

Next Steps

  • Learn about Modifiers for configuring storage
  • See Actions for using storage in your code
  • Check Tutorials for end-to-end examples