View as Markdown
Daytona icon

Daytona ACTION

Create Sandbox

Creates a new sandbox on Daytona. Provide a Snapshot to create from a pre-built template, an Image to create from a custom Docker image, or neither to use the Daytona default snapshot. Snapshot takes precedence over Image if both are provided. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Daytona account once, then configure and run Create Sandbox from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "daytona-create-sandbox",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    daytona: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    snapshotId: "Snapshot ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Sandbox inputs
Property Type Description
name Name string
The name of the Sandbox
Optional
snapshotId Snapshot ID string
Pre-built snapshot to use as the sandbox base. Takes precedence over Image if both are provided. If neither Snapshot nor Image is specified, the Daytona default snapshot is used.
Optional Dynamic
image Image string
Custom Docker image to use for the Sandbox (e.g. python:3.12-slim). Only used when no Snapshot is specified. Supports public registry images.
Optional
cpu CPU integer
Number of CPU cores to allocate (minimum: 1). Only applies when using a custom Image, not a Snapshot.
Optional
memory Memory (GiB) integer
Amount of memory in GiB to allocate (minimum: 1). Only applies when using a custom Image, not a Snapshot.
Optional
disk Disk (GiB) integer
Amount of disk space in GiB to allocate (minimum: 1). Only applies when using a custom Image, not a Snapshot.
Optional
autoArchiveInterval Auto Archive Interval integer
Auto-archive interval in minutes (0 means the maximum interval will be used). Default is 7 days.
Optional
autoDeleteInterval Auto Delete Interval integer
Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping). By default, auto-delete is disabled.
Optional
autoStopInterval Auto Stop Interval integer
Auto-stop interval in minutes (0 means disabled). Default is 15 minutes.
Optional
envVars Environment Variables object
Optional environment variables to set in the Sandbox
Optional
ephemeral Ephemeral boolean
Whether the Sandbox should be ephemeral. If true, autoDeleteInterval will be set to 0
Optional
labels Labels object
Labels to set on the Sandbox. Example: { 'my-label': 'my-value' }
Optional
language Language string
Programming language for direct code execution. Defaults to python if not specified.
Optional
networkAllowList Network Allow List string
Comma-separated list of allowed CIDR network addresses for the Sandbox (e.g. 10.0.0.0/8,192.168.1.0/24)
Optional
networkBlockAll Network Block All boolean
Whether to block all network access for the Sandbox
Optional
public Public boolean
Is the Sandbox port preview public?
Optional
user User string
Optional OS user to use for the Sandbox
Optional
volumes Volumes object
Optional array of volumes to mount to the Sandbox. See the documentation for more details.
Optional
timeout Timeout integer
Timeout in seconds (0 means no timeout, default is 60)
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
daytona-create-sandbox
Version
0.0.3
App
Daytona
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes