Declaw icon

Declaw

Run code securely in Firecracker microVM sandboxes — create sandboxes, execute commands, manage files

File → Write

AI-generated

Summary

Writes text content to a file at an absolute path inside an existing Declaw sandbox via a POST to the sandbox files API.

Inputs

  • Sandbox ID (required) — ID of the target sandbox (e.g. sbx-a1b2c3d4), used in the request path /sandboxes/{id}/files.
  • File Path (required) — Absolute destination path inside the sandbox (e.g. /home/user/output.txt).
  • File Content (required) — Text content to write to the file. Sent as-is in the request body as data.

Output shape

One output item per input item, containing the JSON response returned by the Declaw API for the write request.

The source doesn't define the response fields, so they depend on the Declaw API. Each item runs separately. With Continue On Fail enabled, a failed item returns {error: message} instead of stopping the workflow. This operation handles text only; for multiple files use Write Batch.

Examples

Example 1: Upload a Python script to a sandbox before running it

Sandbox ID = {{$json.sandbox_id}}, File Path = /home/user/script.py, File Content = print('hello'). Follow with a Command > Run node using python3 script.py.

Example 2: Write an LLM-generated config file into a sandbox

Sandbox ID from a previous Create node, File Path = /home/user/config.json, File Content = {{$json.output}}.

Links

Discussion