How to use it?
Basic Command Structure
Parameters
Required:action
- Operation to perform (upload, create, append, get, list, delete, update)filename
- Name of the file (required for most operations)
content
- File content for upload/create/append operationsmetadata
- Additional information about the filefile_links_expire_in_days
- Link expiry: 1-7 days or “never” for public filesfile_links_expire_in_minutes
- Minute-level precision for link expiryget_file_contents
- Set to true to retrieve file content along with metadataformat
- Set to “light” for minimal file listingreplaceExisting
- Whether to replace existing files with same filename (defaults to “true”; if “false”, adds timestamp to filename)triggerUrls
- Array of trigger objects that fire when the file changes (see Triggers section)
File Link Expiration
- Days: 1-7 days or “never” to make file public
- Minutes: Can be used for minute-level precision
- Combined: Use both (e.g., days=“1”, minutes=“30” = 1 day 30 minutes)
- Default: 1 day if not specified
- Maximum: 7 days total
- Public files: Use days=“never” (minutes ignored)
Response Format
File creation/update:Tools
Upload File
Upload a file from buffer or file input Parameters:action
(required) - Set to “upload”file
(required) - File or buffer to uploadmetadata
(optional) - File metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionreplaceExisting
(optional) - Whether to replace existing files with same filename (defaults to “true”)triggerUrls
(optional) - Array of trigger objects (see Triggers section)
Create or Replace Document
Create a new file or replace existing one with text content Parameters:action
(required) - Set to “create”filename
(required) - Name of the filecontent
(required) - File contentmetadata
(optional) - File metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionreplaceExisting
(optional) - Whether to replace existing files with same filename (defaults to “true”)
Append to Document
Append content to an existing file Parameters:action
(required) - Set to “append”filename
(required) - Name of the filecontent
(required) - Content to appendmetadata
(optional) - Updated metadatafile_links_expire_in_days
(optional) - Link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precision
Get Document
Retrieve file metadata or content Parameters:action
(required) - Set to “get”filename
(required) - Name of the fileget_file_contents
(optional) - Set to true to retrieve contentfile_links_expire_in_days
(optional) - Link expiry for returned signedUrl
List Files
List all files with full or light details Parameters:action
(required) - Set to “list”format
(optional) - Set to “light” for minimal infofile_links_expire_in_days
(optional) - Link expiry for returned signedUrls
- Full details: All metadata, signedUrl, and accessList
- Light format: File ID, filename, filepath, type, mime_type, file_size, isPublic status, collectionId, timestamps, and metadata object
Delete Document
Delete a file from storage Parameters:action
(required) - Set to “delete”filename
(required) - Name of the file
Update File Link Expiry
Update link expiration settings for existing files Parameters:action
(required) - Set to “update”filename
(required) - Name of the filefile_links_expire_in_days
(required) - New link expiry (1-7 days or “never”)file_links_expire_in_minutes
(optional) - Minute-level precisionmetadata
(optional) - Updated metadata
What can you do with it?
Store, retrieve, update, and manage files in the cloud storage system. Supports text and binary files with metadata, link expiration control, and public file sharing options. Perfect for configuration management, system logging, document storage, and file sharing with controlled access periods.File Types and Content Extraction
Supported File Types
Document files: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT Image files: PNG, JPG, JPEG, WEBP Audio files: MP3, WAV Video files: MP4, MOV Data files: CSV, JSON, HTML Archive files: ZIPContent Extraction
For supported document types (PDF, DOCX, XLSX, PPTX, CSV), the system automatically extracts content when retrieving files. This works for:- PDF files
- Word documents (DOC, DOCX)
- Excel files (XLS, XLSX)
- PowerPoint files (PPT, PPTX)
- CSV files
File Type Handling
Text files (JSON, TXT, HTML, CSV):- Use
get_file_contents: true
to retrieve content directly - Can be updated with POST method
- Use signedUrl from metadata to access file content
- Use PATCH method to update metadata and link expiry without resending content
Examples
Configuration Management
System Logging
Document Storage
Log File Management
Making Files Public
Triggers
Filestorage supports event-driven triggers that automatically start workflows when files change. Triggers can be set at two levels: collection-wide (affects all files) or file-specific (affects individual files).Trigger Events
- onCreate: Fires when new files are uploaded or created (collection-level only)
- onEdit: Fires when existing files are modified or updated (collection or file level)
- onDelete: Fires when files are deleted (collection or file level)
Trigger Levels
Collection-Level Triggers: Set on the entire file collection to monitor all files- Automatically fire for every file in the collection
- Perfect for system-wide file processing and monitoring
- Set via file collection management interface
- Only fire for that particular file
- Ideal for monitoring important documents or configuration files
- Set via the
triggerUrls
parameter when uploading/creating/updating files
Trigger Structure
Triggers use an array format with multiple trigger objects:Trigger Payload
When triggers fire, they receive detailed information about the file event: For onCreate and onDelete events:- File modifications (content updates, metadata changes, public status changes)
- The
signedUrl
provides access to the updated file content updatedAt
timestamp reflects when the change occurred
Examples
Upload File with Multiple Triggers
Create File with Trigger
Update File (Will Fire onEdit Triggers)
File Processing Pipeline
Rate Limiting and Logs
- Rate Limiting: onEdit triggers are limited to 2 executions per minute per file to prevent infinite loops
- Trigger Logs: All trigger executions are logged with status, execution time, and error details
- Error Handling: Failed triggers are logged but don’t prevent the original file operation from completing
- File Access: Triggers receive signed URLs that are valid for 7 days to access file content
Best Practices
- Use Collection-Level Triggers for automated file processing pipelines (e.g., document conversion, backup systems)
- Use File-Level Triggers for monitoring critical files (e.g., configuration files, important documents)
- Monitor file access through signed URLs provided in trigger payloads
- Test triggers thoroughly before production use to ensure reliable file processing
- Handle file types appropriately - use signed URLs for binary files, content extraction for text files
- Consider file size limits when processing large files in triggered workflows
Notes
- Each file must have a unique filename within your storage
- Files can include optional metadata for organization and tracking
- Default link expiry is 1 day if not specified
- Maximum expiry is 7 days (except for public files)
- Use
file_links_expire_in_days: "never"
to make files public - Access history is automatically tracked for all files
- Content extraction is available for common document formats
- For binary files, use the signedUrl to access content
- Race conditions: There is no race condition prevention in place. If you have multiple automations writing to the same file, you will experience unexpected results
- File overwriting: By default, creating a file with an existing filename will overwrite the existing file completely. Use
replaceExisting: "false"
to add a timestamp to the filename instead - Signed URLs: Files are accessible via signed URLs that expire based on the
file_links_expire_in_days
setting. Access history is maintained in theaccessList
with entries including action performed, provider ID, and timestamp