Skip to content

Storage Modules

Storage Modules

Storage modules use the storage component. The default storage backend is configured in component settings. Override per flowlet with componentConfigIds.storage.

Local Storage

Read

{
"appId": "storage-read",
"ref": "readFile",
"args": {
"path": "invoices/{{ $prev.args.invoiceId }}.pdf"
}
}

Output: { "content": "<base64 or text>", "size": 20480, "mimeType": "application/pdf" }

Write

{
"appId": "storage-write",
"ref": "saveFile",
"args": {
"path": "output/report-{{ $date.format '2006-01-02' }}.csv",
"content": "{{ $prev.generateCsv.content }}",
"encoding": "utf8"
}
}

Output: { "path": "output/report-2024-01-15.csv", "size": 1024 }

Move, Delete, Exists, List

{"appId": "storage-move", "args": {"from": "tmp/file.pdf", "to": "archive/file.pdf"}}
{"appId": "storage-delete", "args": {"path": "tmp/old-file.pdf"}}
{"appId": "storage-exists", "args": {"path": "invoices/INV-001.pdf"}}
// Output: {"exists": true}
{"appId": "storage-list", "args": {"path": "invoices/", "pattern": "*.pdf"}}
// Output: {"files": [{"path":"invoices/INV-001.pdf","size":20480},...], "count": 12}

TempDir

Creates a temporary directory scoped to the current play. Automatically cleaned up after execution.

{"appId": "storage-tempdir", "ref": "tmpDir"}
// Output: {"path": "tmp/play-65xyz789/"}
// Use: "{{ $prev.tmpDir.path }}myfile.pdf"

AWS S3

{
"appId": "s3-upload",
"args": {
"bucket": "my-company-docs",
"key": "invoices/{{ $prev.args.invoiceId }}.pdf",
"content": "{{ $prev.generatePdf.content }}",
"contentType": "application/pdf",
"acl": "private"
}
}
{
"appId": "s3-download",
"args": {
"bucket": "my-company-docs",
"key": "invoices/INV-001.pdf"
}
}
{"appId": "s3-delete", "args": {"bucket": "my-company-docs", "key": "tmp/file.pdf"}}
{"appId": "s3-list", "args": {"bucket": "my-company-docs", "prefix": "invoices/"}}

Configure S3 component with endpoint override for S3-compatible storage (MinIO, Cloudflare R2, etc.):

{
"endpoint": "https://your-minio-instance.com",
"region": "us-east-1",
"accessKey": "...",
"secretKey": "..."
}

Google Cloud Storage

{"appId": "gcs-upload", "args": {"bucket": "my-bucket", "path": "docs/file.pdf", "content": "{{ $prev.pdf.content }}"}}
{"appId": "gcs-get", "args": {"bucket": "my-bucket", "path": "docs/file.pdf"}}
{"appId": "gcs-find", "args": {"bucket": "my-bucket", "prefix": "docs/", "pattern": "*.pdf"}}
{"appId": "gcs-move", "args": {"bucket": "my-bucket", "from": "tmp/file.pdf", "to": "archive/file.pdf"}}

Google Drive

{"appId": "gdrive-get", "args": {"fileId": "{{ $prev.args.driveFileId }}"}}
// Output: {"id":"...","name":"report.xlsx","mimeType":"application/vnd.ms-excel","content":"..."}
{"appId": "gdrive-find", "args": {"query": "name contains 'invoice' and mimeType = 'application/pdf'"}}
// Output: {"files": [...], "count": 5}
{"appId": "gdrive-create", "args": {"name": "Report.pdf", "content": "{{ $prev.pdf.content }}", "mimeType": "application/pdf", "parentId": "folder-id"}}
{"appId": "gdrive-move", "args": {"fileId": "...", "newParentId": "archive-folder-id"}}

Google Drive modules require an OAuth2 link (Google) configured via the Links API.

FTP

{"appId": "ftp-upload", "args": {"host": "ftp.example.com", "port": 21, "user": "ftpuser", "pass": "{{ $kv.get 'ftpPass' }}", "remotePath": "/uploads/file.csv", "content": "{{ $prev.generateCsv.content }}"}}
{"appId": "ftp-download", "args": {"host": "ftp.example.com", "remotePath": "/reports/daily.csv"}}