Skip to content

YepCode Storage

YepCode Storage is a robust file storage system designed to handle file operations within your processes. It provides a simple and efficient way to store, retrieve, and manage files through accessible source code integration.

With YepCode Storage, you can perform various file operations including:

  • File Upload: Store files from your processes or external sources
  • Automatic Form Uploads: Receive files submitted from input-parameter forms directly in storage
  • File Download: Retrieve files for processing or analysis
  • File Management: List and delete your stored files
  • Signed URLs: Generate temporary download URLs for existing files

YepCode Storage is perfect for scenarios such as:

  • Document Processing: Store uploaded documents for analysis or transformation
  • Image Processing: Handle image files for resizing, conversion or analysis
  • Data Export: Generate and store reports, CSV files or other exports
  • File Sharing: Create temporary file storage for sharing between processes
  • Backup Operations: Store important files as part of backup workflows

Automatic Uploads from Input Parameter Forms

Section titled “Automatic Uploads from Input Parameter Forms”

When your process uses an input parameter form with file fields ("ui:widget": "file"), YepCode uploads those submitted files to storage automatically before execution starts.

Inside your process code, file parameters become storage references you can use with yepcode.storage.download() and other storage methods.

For one file field, you receive one storage path. If your form allows multiple files, you will receive an array of storage paths.

Download a file submitted through a form
const {
context: { parameters },
} = yepcode;
const uploadedPath = parameters.inputFile;
// Upload path starts with "yepcode.storage://"
const fileStream = await yepcode.storage.download(uploadedPath.replace("yepcode.storage://", ""));

YepCode Storage can be accessed through multiple methods, making it flexible for different use cases and integration scenarios:

The most direct way to use YepCode Storage is from within your process source code using the yepcode.storage helper:

Uploading a file
const path = require("node:path");
const localPath = path.join(process.env.TMP_DATA_DIR, "myfile.txt");
await yepcode.storage.upload("path/myfile.txt", fs.createReadStream(localPath));
Listing files
const files = await yepcode.storage.list();
console.log(files);
Downloading a file
const path = require("node:path");
const localPath = path.join(process.env.TMP_DATA_DIR, "downloaded.txt");
const stream = await yepcode.storage.download("path/myfile.txt");
stream.pipe(fs.createWriteStream(localPath));
Deleting a file
await yepcode.storage.delete("path/myfile.txt");
Creating a signed URL
const signed = await yepcode.storage.createSignedUrl("path/myfile.txt");
console.log(signed.url, signed.expiresAt);
const signedWithCustomExpiry = await yepcode.storage.createSignedUrl("path/myfile.txt", {
expiresInSeconds: 900,
});
console.log(signedWithCustomExpiry.url, signedWithCustomExpiry.expiresAt);

YepCode Storage is also available through our REST API, allowing you to upload, download, list, delete, and create signed URLs from any external system. This enables integration with third-party applications, web services, or any system that can make HTTP requests.

You can interact with YepCode Storage from external applications using our YepCode Run SDK, available for both JavaScript and Python:

Using YepCode Run SDK for JavaScript
const { YepCodeStorage } = require('@yepcode/run');
const fs = require('fs');
const storage = new YepCodeStorage({ apiToken: 'your-api-token' });
// Upload a file (using Node.js stream)
await storage.upload('path/myfile.txt', fs.createReadStream('./myfile.txt'));
// List files
const files = await storage.list();
console.log(files);
// Download a file
const stream = await storage.download('path/myfile.txt');
stream.pipe(fs.createWriteStream('./downloaded.txt'));
// Delete a file
await storage.delete('myfile.txt');
// Create a temporary signed URL (default expiration ~1 hour)
const signed = await storage.createSignedUrl('path/myfile.txt');
console.log(signed.url, signed.expiresAt);
// Custom expiration
const signedWithCustomExpiry = await storage.createSignedUrl('path/myfile.txt', {
expiresInSeconds: 900,
});
console.log(signedWithCustomExpiry.url, signedWithCustomExpiry.expiresAt);

Install the SDK: npm install @yepcode/run

YepCode Storage is available as MCP (Model Context Protocol) tools in our MCP server, making it incredibly powerful when combined with AI agents. This enables AI agents to:

  • Handle file-based tasks end-to-end without manual intervention
  • Process complex data using the full power of Python/JavaScript ecosystems
  • Store and retrieve results securely in the cloud
  • Chain multiple operations across different files and datasets

When combined with our run_code tool, AI agents can upload files, generate and execute code to process them, and store results back to YepCode Storage automatically.

YepCode Storage works seamlessly with local disk for comprehensive file handling workflows. This combination is particularly useful when you need to:

  • Process files that require specific file paths or libraries that don’t support streams
  • Perform complex data transformations that benefit from local file access
  • Handle large files that need to be processed in chunks