logo_smallAxellero.io

File Storage

Secure file upload, download, and management with presigned URLs and blob storage integration.

File Storage

File management capabilities for workflows requiring document processing, file transfers, and content storage. Provides secure file operations through presigned URLs, blob storage integration, and file handling methods.

Quick Navigation

Methods

GetUploadRequest

Generate presigned upload URL for client-side file uploads.

Inputs

NameCodeTypeRequiredDescription
FilenamefilenameText✅ YesFile name with extension
Object KeyobjectKeyText✅ YesUnique file identifier for storage

Outputs

NameTypeDescription
requestObjectPresigned upload request with URL and form fields
urlTextDirect upload URL
objectKeyTextStorage object identifier

Configuration Example

{
  "filename": "document.pdf",
  "objectKey": "uploads/{{timestamp}}/{{filename}}"
}

Security Advantages

  • Temporary access with expiration time
  • Direct browser uploads without server intermediation
  • Size and type validation at storage layer
  • Audit trail for all upload operations

File Size Limitations

  • Upload size depends on infrastructure configuration
  • No explicit limit enforced at application level

GetDownloadRequest

Generate presigned download URL for secure file access.

Inputs

NameCodeTypeRequiredDescription
Blob IDblobIdText✅ YesBlob storage identifier

Alternative input:

NameCodeTypeRequiredDescription
Object KeyobjectKeyText✅ YesUnique file identifier

Outputs

NameTypeDescription
requestObjectPresigned download request with URL and expiration
urlTextDirect download URL
expiresAtTextURL expiration timestamp

Configuration Example

{
  "blobId": "{{fileBlobId}}"
}

Workflow Example

// Use system-generated download link for sharing
var downloadRequest = ctx.nodes.fileStorage.outputs.request;
var secureLink = downloadRequest.url;
var expiration = downloadRequest.expiresAt;

// Forward the automatically generated link
return {
  downloadLink: secureLink,
  expiresAt: expiration,
  accessGranted: true
};

File Size Limitations

  • Download size limited to 10MB maximum
  • Enforced by backend HTTP response size configuration

GetContent

Retrieve file content directly into workflow context.

Inputs

NameCodeTypeRequiredDescription
Blob IDblobIdText✅ YesBlob storage identifier

Outputs

NameTypeDescription
contentTextFile content as string
metadataObjectFile metadata (size, type, etc.)
contentTypeTextMIME type of the file

Configuration Example

{
  "blobId": "{{targetBlobId}}"
}

Workflow Example

// Process different file types
var fileContent = ctx.nodes.fileStorage.outputs.content;
var fileMetadata = ctx.nodes.fileStorage.outputs.metadata;

if (fileMetadata.contentType === 'application/json') {
    var jsonData = JSON.parse(fileContent);
    return { parsedData: jsonData };
} else if (fileMetadata.contentType === 'text/csv') {
    var csvLines = fileContent.split('\n');
    return { rowCount: csvLines.length };
}

return { contentLength: fileContent.length };

File Size Limitations

  • Content output limited to 1MB maximum
  • Enforced by node output size configuration
  • Large files should use GetDownloadRequest instead

PutContent

Store content directly from workflow variables.

Inputs

NameCodeTypeRequiredDescription
ContentcontentText✅ YesFile content for upload
FilenamefilenameText✅ YesFile name with extension
Base64 Encodedbase64EncodedBooleanNoContent encoding flag (default: false)

Outputs

NameTypeDescription
urlTextPublic URL of stored file
blobIdTextBlob storage identifier
successBooleanUpload success status

Configuration Example

{
  "filename": "data.json",
  "content": "{{fileContent}}",
  "base64Encoded": false
}

Workflow Example

// Prepare file for upload
var fileData = ctx.vars.documentData;
var fileName = ctx.vars.fileName || 'upload_' + Date.now() + '.pdf';

// Encode content if needed
var base64Content = base64encode(fileData);

return {
  fileContent: base64Content,
  fileName: fileName,
  uploadReady: true
};

File Size Limitations

  • Upload size depends on infrastructure configuration
  • Content is processed in memory, consider size for performance

Download and store files from external URLs.

Inputs

NameCodeTypeRequiredDescription
Source URLsourceUrlText✅ YesExternal URL to download from
FilenamefilenameText✅ YesFile name for stored file

Outputs

NameTypeDescription
urlTextPublic URL of stored file
blobIdTextBlob storage identifier
successBooleanDownload and storage success status

Configuration Example

{
  "sourceUrl": "{{externalFileUrl}}",
  "filename": "downloaded_{{timestamp}}.pdf"
}

Workflow Example

// Validate external URL
var externalUrl = ctx.vars.documentUrl;
var timestamp = new Date().toISOString().replace(/[:.]/g, '-');

if (!externalUrl || !externalUrl.startsWith('https://')) {
    return { error: 'Invalid or insecure URL provided' };
}

return {
    externalFileUrl: externalUrl,
    timestamp: timestamp,
    validated: true
};

File Size Limitations

  • External file download limited to 10MB maximum
  • Same limit as backend HTTP response size configuration
  • Larger external files will fail to download

Architecture & Data Flow

File Storage Architecture

Security Model

Security Architecture

File Storage implements multiple security layers:

  • Temporary links with automatic expiration
  • User permission validation before file access
  • Content validation for uploaded files
  • Audit logging for all file operations

The system automatically creates secure, temporary links for file access without exposing storage credentials.

System-Generated Benefits:

  • Automatic expiration - System creates URLs that expire after 1 hour
  • Direct file operations - Generated links allow direct browser upload/download
  • Secure by design - System handles all credential management
  • Workflow ready - Links are automatically provided in node outputs

Security Best Practices

Integration Patterns

Document Processing Workflows

Integration Pattern

File Storage serves as a hub in document processing pipelines.

API Integration Patterns

Best Practices

Best Practices

  1. Validate file types and sizes before storage operations
  2. Use secure file links for external file sharing and large uploads
  3. Implement error handling for network and storage failures
  4. Monitor storage usage and implement cleanup policies
  5. Secure file access with user permissions and time-limited URLs
  6. Log file operations for audit and debugging purposes

Performance & Limitations

Storage Limitations

  • Download file size: 10MB maximum per file
  • GetContent output size: 1MB maximum (node output limitation)
  • Concurrent uploads: 10 simultaneous operations per workflow
  • Secure link expiration: 1 hour default (configurable)
  • Storage retention: 30 days for temporary files
  • Upload file size: Depends on infrastructure configuration

Configuration-Dependent Limits

File size limitations are configured at the backend level and may vary between deployments. The limits shown above are default values that can be adjusted by system administrators.

Security Guidelines

Security AspectRecommendationImplementation
File ValidationAlways validate file types and sizesPre-upload validation in JavaScript nodes
Access ControlUse role-based file permissionsCheck ctx.user.roles before file operations
Link SecurityPrefer secure file links over direct accessUse GetDownloadRequest for sharing
Content ScanningScan uploads for malicious contentImplement virus scanning in processing nodes
Audit LoggingLog all file operations with user contextUse console.log with user and file details

Error Handling Patterns

// Comprehensive error handling for file operations
function handleFileStorageError(error, operation) {
    var errorInfo = {
        operation: operation,
        error: error.message || 'Unknown error',
        timestamp: new Date().toISOString(),
        user: ctx.user.login,
        retryable: false
    };
    
    // Determine if error is retryable
    if (error.includes('network') || error.includes('timeout')) {
        errorInfo.retryable = true;
    }
    
    console.error('File storage error:', errorInfo);
    return errorInfo;
}

// Usage in workflow
var fileResult = ctx.nodes.fileStorage.outputs;
if (!fileResult.url) {
    var errorInfo = handleFileStorageError(
        ctx.nodes.fileStorage.error,
        'file_upload'
    );
    return { error: errorInfo };
}

// Success path
return { fileUrl: fileResult.url };

Troubleshooting

Common Issues

ProblemSymptomsSolution
Upload failsNo URL returned, error in logsCheck file size, type, and network connectivity
Secure link expired403 Forbidden on link accessGenerate new secure link
File not found404 error on downloadVerify blob ID and file existence
Permission denied403 UnauthorizedCheck user permissions and access policies
Content encoding errorsCorrupted file contentVerify base64Encoded flag matches content format

Next: Learn about Transaction Management for atomic file operations, or explore Data Converter for processing stored XML files.