Overview
Run code in secure, isolated sandbox environments with full access to files, package management, and external APIs. Perfect for dynamic code execution, data processing, and automation tasks.Isolated Execution
Run code in secure containerized environments
Multiple Languages
Support for Python, Node.js, and more
File System Access
Read, write, and manage files
External APIs
Make HTTP requests from sandbox
What is a Sandbox?
A sandbox is an isolated execution environment where you can:- Execute arbitrary code safely
- Install and use packages
- Access file systems
- Make external API calls
- Process data without affecting other workflows
Available Actions
Code Execution
Execute Code
Execute Code
Run code in the sandbox environment.Parameters:
language- Programming language (python, nodejs, bash)code- Code to executetimeout- Execution timeout in seconds (default: 30, max: 300)packages- Array of packages to installenv- Environment variablesstdin- Standard input data
stdout- Standard outputstderr- Standard errorexit_code- Exit codeexecution_time- Time taken to executefiles- Created files (if any)
File Management
Read File
Read File
Read contents of a file from the sandbox.Parameters:
path- File path in sandboxencoding- File encoding (default: utf-8)start_line- Starting line number (optional)num_lines- Number of lines to read (optional)max_kb- Maximum KB to read (default: 8, max: 32)
content- File contentssize- File size in byteslines- Total lines (if text file)
Write File
Write File
Write content to a file in the sandbox.Parameters:
path- File path to writecontent- Content to writemode- File permissions (default: 0644)
success- Write success statuspath- Written file pathsize- Written bytes
List Files
List Files
List files and directories in the sandbox.Parameters:
path- Directory path (default: /workspace)recursive- Include subdirectories (default: false)pattern- Filename pattern filter (glob)
files- Array of file objectsname- File namepath- Full pathsize- File sizetype- File or directorymodified- Last modified time
Remove File
Remove File
Delete a file or directory from the sandbox.Parameters:
path- File/directory path to removerecursive- Remove directories recursively (default: false)
success- Deletion success status
Make Directory
Make Directory
Create a directory in the sandbox.Parameters:
path- Directory path to createparents- Create parent directories (default: true)mode- Directory permissions (default: 0755)
success- Creation success statuspath- Created directory path
Advanced Features
Upload to S3
Upload to S3
Upload files from sandbox directly to S3.Parameters:
files- Array of file objectsremote_path- Path in sandboxfilename- Custom filename (optional)content_type- MIME type (optional)
uploads- Array of uploaded file objectsurl- S3 URLfilename- Uploaded filenamesize- File size
Get Sandbox URL
Get Sandbox URL
Get the unique URL for the sandbox session.Returns:
url- Sandbox session URLsession_id- Unique session identifierexpires_at- Session expiration time
API Request within Sandbox
API Request within Sandbox
Make HTTP requests from within the sandbox.Parameters:
method- HTTP method (GET, POST, etc.)url- Request URLheaders- Request headersbody- Request bodytimeout- Request timeout
status_code- HTTP status codebody- Response bodyheaders- Response headers
Morph Edit File Fast
Morph Edit File Fast
Quickly edit files using AI-powered code transformation.Parameters:
target_file- File path to editinstructions- Edit instructionscode_edit- Code changes to apply
success- Edit success statusmessage- Edit confirmation
Morph Edit File Large
Morph Edit File Large
Edit large files with AI-powered transformations.Parameters:
target_file- File path to editinstructions- Detailed edit instructionscode_edit- Code changes with context
success- Edit success statusmessage- Edit confirmationusage- Token usage statistics
Language Support
Python
Pre-installed Packages:- numpy, pandas, scipy
- requests, aiohttp
- beautifulsoup4, lxml
- pillow, opencv-python
- matplotlib, seaborn
- scikit-learn, tensorflow (CPU)
- And more…
Node.js
Pre-installed Packages:- axios, node-fetch
- lodash, moment
- express, fastify
- And more…
Bash
Available Commands:- Standard Unix utilities (grep, sed, awk, etc.)
- curl, wget
- jq (JSON processing)
- git
- And more…
Environment Variables
Access workflow variables in sandbox code:File System Structure
Best Practices
Timeout Management
Set appropriate timeouts for long-running tasks
Error Handling
Catch and handle errors in your code
Resource Cleanup
Remove temporary files after use
Package Management
Only install necessary packages
Security
Never expose sensitive data in logs
Optimization
Optimize code for sandbox limits
Limitations
- Execution Time: Maximum 5 minutes per execution
- Memory: 2GB RAM per sandbox
- Disk Space: 10GB per sandbox
- Network: Outbound requests allowed, no inbound
- Concurrent: Maximum 10 concurrent sandboxes
Enterprise: Contact us for higher limits and dedicated resources.
Troubleshooting
Timeout Error
Timeout Error
Causes:
- Code execution too slow
- Infinite loops
- Large file processing
- Increase timeout parameter
- Optimize code
- Break into smaller tasks
Memory Error
Memory Error
Causes:
- Loading large datasets
- Memory leaks
- Too many objects in memory
- Process data in chunks
- Free unused variables
- Use generators/streams
Package Installation Failed
Package Installation Failed
Causes:
- Package doesn’t exist
- Dependency conflicts
- Network issues
- Verify package name
- Use specific versions
- Pre-install common packages
File Not Found
File Not Found
Causes:
- Wrong file path
- File not created yet
- Permission issues
- Use absolute paths
- Check file creation
- Verify permissions
Next Steps
Remote Server
Execute on dedicated servers
AI Providers
Combine with AI capabilities
Tool Node
Learn about tool nodes
File Management
Advanced file operations

