Daytona
Execute code in isolated sandbox environments
Actions
Section titled “Actions”Create Repository Sandbox
Section titled “Create Repository Sandbox”The Create Repository Sandbox component creates a new Daytona sandbox, clones a repository, and runs a bootstrap script.
Use Cases
Section titled “Use Cases”- Ephemeral dev environments: Spin up a fresh environment for a repository on demand
- CI-like workflows: Clone code and run setup scripts before downstream tasks
- Automated validation: Prepare repository state before executing tests or commands
- The component waits for the sandbox to reach the “started” state
- Clone and bootstrap run sequentially in the same session
- If clone or bootstrap fails, the component returns an error
Example Output
Section titled “Example Output”{ "data": { "bootstrap": { "from": "file", "path": "scripts/bootstrap.sh" }, "directory": "/home/daytona/example-app", "repository": "https://github.com/superplanehq/example-app.git", "sandboxId": "sandbox-abc123def456", "sandboxStartedAt": "2026-01-19T12:00:00Z", "secrets": [ { "name": "API_KEY", "type": "env", "value": { "key": "API_KEY", "secret": "api-key-secret" } } ], "timeout": 300 }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.repository.sandbox"}Create Sandbox
Section titled “Create Sandbox”The Create Sandbox component creates an isolated environment for executing code safely.
Use Cases
Section titled “Use Cases”- AI code execution: Run AI-generated code in a secure sandbox
- Code testing: Test untrusted code without affecting your infrastructure
- Development environments: Create ephemeral development environments
Configuration
Section titled “Configuration”- Snapshot: Base environment snapshot (optional, uses default if not specified)
- Target: Target region for the sandbox (optional)
- Auto Stop Interval: Time in minutes before the sandbox auto-stops
- Environment Variables: Key-value pairs to set as environment variables in the sandbox
Output
Section titled “Output”Returns the sandbox information including:
- id: The unique sandbox identifier (use this in subsequent execute/delete operations)
- state: The current state of the sandbox (e.g., “started”)
- The component polls the sandbox state until it reaches “started”
- Each sandbox is fully isolated
- Remember to delete sandboxes when done to free resources
Example Output
Section titled “Example Output”{ "data": { "id": "sandbox-abc123def456", "state": "started" }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.sandbox"}Delete Sandbox
Section titled “Delete Sandbox”The Delete Sandbox component removes an existing Daytona sandbox.
Use Cases
Section titled “Use Cases”- Resource cleanup: Delete sandboxes after code execution is complete
- Cost management: Remove unused sandboxes to free resources
- Workflow cleanup: Clean up sandboxes at the end of automation workflows
Configuration
Section titled “Configuration”- Sandbox: The ID or name of the sandbox to delete (from createSandbox output)
- Force: Optional flag to force deletion even if sandbox is running
Output
Section titled “Output”Returns deletion confirmation including:
- deleted: Boolean indicating successful deletion
- id: The ID of the deleted sandbox
- Always delete sandboxes when they are no longer needed
- Sandboxes will auto-stop after the configured interval, but explicit deletion frees resources immediately
Example Output
Section titled “Example Output”{ "data": { "deleted": true, "id": "sandbox-abc123def456" }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.delete.response"}Execute Code
Section titled “Execute Code”The Execute Code component runs code in an existing Daytona sandbox.
Use Cases
Section titled “Use Cases”- AI code execution: Run AI-generated code safely
- Code testing: Execute untrusted code in isolation
- Script automation: Run Python, TypeScript, or JavaScript scripts
- Data processing: Execute data transformation scripts
Configuration
Section titled “Configuration”- Sandbox: The sandbox ID to execute code in (from createSandbox output). Supports expressions, e.g.
{{ $["daytona.createSandbox"].data.id }} - Code: The code to execute (supports expressions)
- Language: The programming language (python, typescript, javascript)
- Timeout: Optional execution timeout in milliseconds
Output
Section titled “Output”Returns the execution result including:
- exitCode: The process exit code (0 for success)
- result: The stdout/output from the code execution
- The sandbox must be created first using createSandbox
- Code output is captured from stdout
- Non-zero exit codes indicate execution errors
Example Output
Section titled “Example Output”{ "data": { "exitCode": 0, "result": "Hello, World!\n" }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.execute.response"}Execute Command
Section titled “Execute Command”The Execute Command component runs shell commands in an existing Daytona sandbox.
Use Cases
Section titled “Use Cases”- Package installation: Install dependencies (pip install, npm install)
- File operations: Create, move, or delete files in the sandbox
- System commands: Run any shell command in the isolated environment
- Build processes: Execute build scripts or compilation commands
Configuration
Section titled “Configuration”- Sandbox: The sandbox ID to run commands in (from createSandbox output). Supports expressions, e.g.
{{ $["daytona.createSandbox"].data.id }} - Command: The shell command to execute
- Working Directory: Optional working directory for the command
- Environment Variables: Optional key-value pairs exported before command execution
- Timeout: Optional execution timeout in seconds
Output
Section titled “Output”Routes to one of two channels:
- success: Exit code is 0
- failed: Exit code is non-zero
The payload includes:
- exitCode: The process exit code (0 for success)
- timeout: Whether the command timed out
- result: The stdout/output from the command execution
- The sandbox must be created first using createSandbox
- Commands run in a shell environment
- Non-zero exit codes indicate command failures
Example Output
Section titled “Example Output”{ "data": { "exitCode": 0, "result": "Successfully installed requests-2.31.0\n", "timeout": false }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.command.response"}Get Preview URL
Section titled “Get Preview URL”The Get Preview URL component generates a Daytona preview URL for a specific sandbox port.
Use Cases
Section titled “Use Cases”- Open sandbox web apps: Access a web app running in a sandbox from a browser
- Share previews: Generate signed URLs that can be opened without custom headers
- Automation: Generate preview links for downstream steps and notifications
Configuration
Section titled “Configuration”- Sandbox: Sandbox to generate the preview URL for
- Port: Sandbox port to preview (default: 3000)
- Signed URL: Whether to generate a signed preview URL (default: true)
- Expires In Seconds: Signed URL expiration in seconds (default: 60, max: 86400)
URL Formats
Section titled “URL Formats”- Standard URL (
signed=false):https://{port}-{sandboxId}.{daytonaProxyDomain}Requiresx-daytona-preview-tokenheader with the returned token - Signed URL (
signed=true):https://{port}-{token}.{daytonaProxyDomain}Authentication is embedded in the URL, no custom header required
Output
Section titled “Output”Returns preview URL information including:
- sandbox: The sandbox ID used in the request
- port: The target sandbox port
- signed: Whether the generated URL is signed
- url: Generated preview URL
- token: Preview token (embedded token for signed URLs, header token for standard URLs)
- expiresInSeconds: Expiration for signed URLs
- The target port must be serving HTTP traffic in the sandbox, otherwise preview access may fail
- Signed URLs can be opened directly in browsers
- Standard URLs require
x-daytona-preview-tokenheader for private sandboxes
Example Output
Section titled “Example Output”{ "data": { "expiresInSeconds": 3600, "port": 3000, "sandbox": "sandbox-abc123def456", "signed": true, "token": "signed-token-abc123", "url": "https://3000-signed-token-abc123.preview.daytona.app" }, "timestamp": "2026-01-19T12:00:00Z", "type": "daytona.preview.response"}