Docs Concepts Sandbox
Weavz includes built-in workspace integrations for Sandbox execution, from lightweight JavaScript transforms to full multi-language runs. Use them to run custom logic, process data between integration calls, or build complex multi-step workflows.
For the full first-party catalog, see Built-In Workspace Integrations .
A lightweight JavaScript Sandbox for data transformation and processing. Zero setup required.
Action: run_code
Input: JavaScript code + optional inputs JSON object
Output: Return value + captured console logs
No network access, no filesystem, no imports — pure computation only
Data transformation between API calls
Text parsing and formatting
JSON reshaping and filtering
Calculations and aggregations
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "code",
"actionName": "run_code",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"input": {
"code": "const data = inputs.rows.map(row => ({ name: row[0], email: row[1], score: parseInt(row[2]) })); return data.filter(d => d.score > 80);",
"inputs": { "rows": [["Alice", "alice@example.com", "90"], ["Bob", "bob@example.com", "70"]] }
}
}' import { WeavzClient } from '@weavz/sdk'
const client = new WeavzClient ({ apiKey: 'wvz_your_api_key' })
await client.actions. execute ( 'code' , 'run_code' , {
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
input: {
code: `
const data = inputs.rows.map(row => ({
name: row[0],
email: row[1],
score: parseInt(row[2])
}));
return data.filter(d => d.score > 80);
` ,
inputs: { rows: sheetsData }
}
}) from weavz_sdk import WeavzClient
client = WeavzClient( api_key = "wvz_your_api_key" )
client.actions.execute( "code" , "run_code" ,
workspace_id = "550e8400-e29b-41d4-a716-446655440000" ,
input = {
"code" : """
const data = inputs.rows.map(row => ({
name: row[0],
email: row[1],
score: parseInt(row[2])
}));
return data.filter(d => d.score > 80);
""" ,
"inputs" : { "rows" : sheets_data},
},
) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'code' ,
actionName: 'run_code' ,
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
input: {
code: 'const data = inputs.rows.map(row => ({ name: row[0], email: row[1], score: parseInt(row[2]) })); return data.filter(d => d.score > 80);' ,
inputs: { rows: sheetsData },
},
}),
})
const data = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "code" ,
"actionName" : "run_code" ,
"workspaceId" : "550e8400-e29b-41d4-a716-446655440000" ,
"input" : {
"code" : "const data = inputs.rows.map(row => ({ name: row[0], email: row[1], score: parseInt(row[2]) })); return data.filter(d => d.score > 80);" ,
"inputs" : { "rows" : sheets_data},
},
},
)
data = res.json()
A full multi-language code environment with owner-controlled execution policy and network access. Action callers provide only the language and code; timeout, persistence, and mounted storage are configured on the workspace integration.
Languages: JavaScript, Python, Shell
Network access: fetch, HTTP libraries, external APIs
Filesystem: /tmp and /workspace directories
Sandbox policy: Ephemeral by default, or persistent when enabled on the workspace integration
Persistent storage: Optional mount at /persistent-storage
Timeout: Up to 5 minutes per execution
Persistent storage mount: None, Current end user, Shared workspace, or Custom namespace via a storage namespace key. Persistent environments are also per-user when current-end-user scoped.
Create or update the advanced-code workspace integration with settings.advancedCode. This policy is applied by the platform for API, SDK, Playground, and MCP executions, and cannot be overridden by action input.
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "advanced-code",
"alias": "advanced_code",
"settings": {
"advancedCode": {
"timeoutSeconds": 300,
"sandboxPersistence": "persistent",
"storageMountScope": "workspace"
}
}
}' await client.workspaces. addIntegration ( '550e8400-e29b-41d4-a716-446655440000' , {
integrationName: 'advanced-code' ,
alias: 'advanced_code' ,
settings: {
advancedCode: {
timeoutSeconds: 300 ,
sandboxPersistence: 'persistent' ,
storageMountScope: 'workspace' ,
},
},
}) client.workspaces.add_integration(
"550e8400-e29b-41d4-a716-446655440000" ,
integration_name = "advanced-code" ,
integration_alias = "advanced_code" ,
settings = {
"advancedCode" : {
"timeoutSeconds" : 300 ,
"sandboxPersistence" : "persistent" ,
"storageMountScope" : "workspace" ,
}
},
) await fetch ( 'https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'advanced-code' ,
alias: 'advanced_code' ,
settings: {
advancedCode: {
timeoutSeconds: 300 ,
sandboxPersistence: 'persistent' ,
storageMountScope: 'workspace' ,
},
},
}),
}) import httpx
httpx.post(
"https://api.weavz.io/api/v1/workspaces/550e8400-e29b-41d4-a716-446655440000/integrations" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "advanced-code" ,
"alias" : "advanced_code" ,
"settings" : {
"advancedCode" : {
"timeoutSeconds" : 300 ,
"sandboxPersistence" : "persistent" ,
"storageMountScope" : "workspace" ,
}
},
},
)
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "advanced-code",
"actionName": "run_code",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"workspaceIntegrationId": "660e8400-e29b-41d4-a716-446655440111",
"input": {
"language": "python",
"code": "data = [{\"amount\": 19}, {\"amount\": 23}]\nresult = sum(d[\"amount\"] for d in data)\nprint(f\"Total: {result}\")"
}
}' import { WeavzClient } from '@weavz/sdk'
const client = new WeavzClient ({ apiKey: 'wvz_your_api_key' })
await client.actions. execute ( 'advanced-code' , 'run_code' , {
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
workspaceIntegrationId: '660e8400-e29b-41d4-a716-446655440111' ,
input: {
language: 'python' ,
code: `data = [{"amount": 19}, {"amount": 23}]
result = sum(d["amount"] for d in data)
print(f"Total: {result}")` ,
},
}) from weavz_sdk import WeavzClient
client = WeavzClient( api_key = "wvz_your_api_key" )
client.actions.execute( "advanced-code" , "run_code" ,
workspace_id = "550e8400-e29b-41d4-a716-446655440000" ,
workspace_integration_id = "660e8400-e29b-41d4-a716-446655440111" ,
input = {
"language" : "python" ,
"code" : 'data = [{"amount": 19}, {"amount": 23}] \n result = sum(d["amount"] for d in data) \n print(f"Total: {result} ")' ,
},
) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'advanced-code' ,
actionName: 'run_code' ,
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
workspaceIntegrationId: '660e8400-e29b-41d4-a716-446655440111' ,
input: {
language: 'python' ,
code: 'data = [{"amount": 19}, {"amount": 23}] \n result = sum(d["amount"] for d in data) \n print(f"Total: {result}")' ,
},
}),
})
const data = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "advanced-code" ,
"actionName" : "run_code" ,
"workspaceId" : "550e8400-e29b-41d4-a716-446655440000" ,
"workspaceIntegrationId" : "660e8400-e29b-41d4-a716-446655440111" ,
"input" : {
"language" : "python" ,
"code" : 'data = [{"amount": 19}, {"amount": 23}] \n result = sum(d["amount"] for d in data) \n print(f"Total: {result} ")' ,
},
},
)
data = res.json()
curl TypeScript SDK Python SDK TypeScript Python
curl -X POST https://api.weavz.io/api/v1/actions/execute \
-H "Authorization: Bearer wvz_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"integrationName": "advanced-code",
"actionName": "run_code",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"input": {
"language": "shell",
"code": "echo \"Files in workspace:\"\nls -la /workspace\necho \"Done\""
}
}' import { WeavzClient } from '@weavz/sdk'
const client = new WeavzClient ({ apiKey: 'wvz_your_api_key' })
await client.actions. execute ( 'advanced-code' , 'run_code' , {
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
input: {
language: 'shell' ,
code: 'echo "Files in workspace:" \n ls -la /workspace \n echo "Done"' ,
},
}) from weavz_sdk import WeavzClient
client = WeavzClient( api_key = "wvz_your_api_key" )
client.actions.execute( "advanced-code" , "run_code" ,
workspace_id = "550e8400-e29b-41d4-a716-446655440000" ,
input = {
"language" : "shell" ,
"code" : 'echo "Files in workspace:" \n ls -la /workspace \n echo "Done"' ,
},
) const res = await fetch ( 'https://api.weavz.io/api/v1/actions/execute' , {
method: 'POST' ,
headers: {
'Authorization' : 'Bearer wvz_your_api_key' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
integrationName: 'advanced-code' ,
actionName: 'run_code' ,
workspaceId: '550e8400-e29b-41d4-a716-446655440000' ,
input: {
language: 'shell' ,
code: 'echo "Files in workspace:" \n ls -la /workspace \n echo "Done"' ,
},
}),
})
const data = await res. json () import httpx
res = httpx.post(
"https://api.weavz.io/api/v1/actions/execute" ,
headers = { "Authorization" : "Bearer wvz_your_api_key" },
json = {
"integrationName" : "advanced-code" ,
"actionName" : "run_code" ,
"workspaceId" : "550e8400-e29b-41d4-a716-446655440000" ,
"input" : {
"language" : "shell" ,
"code" : 'echo "Files in workspace:" \n ls -la /workspace \n echo "Done"' ,
},
},
)
data = res.json()
Feature JavaScript Sandbox Sandbox MCP Code Mode Languages JavaScript only JS, Python, Shell JavaScript only Network access No Yes Yes (via weavz.*) Access to integrations No No Yes (full weavz.* namespace) Persistent state No Yes (optional local Sandbox state) Via configured Filesystem/State KV workspace integrations Persistent filesystem No Yes (when enabled) Via configured Filesystem workspace integrations Best for Data transforms Complex processing AI agent workflows Setup Zero Available on supported plans MCP server in Code Mode
PreviousFilesystem & State KV Next Agent Browser