Handle file inputs and outputs in custom actions and triggers.
FileData
object with this exact format:
Important: File inputs do NOT include atext
property. Thetext
shortcut only exists for file outputs.
Data Structure: When “Allow multiple files” is enabled, data.input.fieldName
is an array. Otherwise, it’s a single object.
files
key in your response:
Field | Required | Notes |
---|---|---|
fileName | ✓ | Include proper file extension |
mimeType | ✓ | Accurate MIME type for proper handling |
base64 | ✓* | Base64 encoded binary content |
text | ✓* | UTF-8 text content (alternative to base64) |
lastModified | – | ISO date string (defaults to current time) |
base64
OR text
, never both.
Key Difference: Unlike actions that return objects directly, triggers must return an array of events. Each event needsid
,timestamp
, anddata
properties, with files inside thedata
object.
id
, timestamp
, and data
properties. Files go inside the data
object:
Important: Unlike actions, triggers must return an array of events, andfiles
must be inside thedata
object, not at the top level.
Constraint | Limit |
---|---|
Total file size per action | 100 MB |
Maximum files per action | 20 files |
Individual documents | ≤ 256 MB* |
Individual images | ≤ 20 MB |
Individual spreadsheets | ≤ 30 MB |
Individual audio files | ≤ 200 MB* |
Individual video files | ≤ 20 MB |
Other file types | ≤ 10 MB |
Action execution timeout | 2 minutes |
Validation: Exceeding limits throws an error before your code executes.
Custom action and trigger code runs in a secure sandboxed environment.
You cannot install or import external libraries (npm, pip, etc.)—only a limited set of built-in JavaScript/Node.js APIs are available.
For advanced file processing (e.g., PDF parsing, image manipulation), use external APIs or services and call them from your code.
|| []
for optional file arraysPromise.all()
for independent operationsld.log()
to track processing statusIssue | Likely Cause | Solution |
---|---|---|
”File not found” | User didn’t attach file | Make file input required or add validation |
Size limit error | Files exceed 100 MB total | Ask for smaller files or fewer files |
”Invalid file type” | Wrong MIME type | Validate file.mimeType in your code |
Empty file content | Base64 encoding issue | Verify file.base64 is valid |
Timeout errors | Large files or slow processing | Optimize processing or reduce file sizes |
Memory errors | Too many large files | Process files sequentially, not in parallel |