Declaw icon

Declaw

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

File → List Directory

AI-generated

Summary

Lists the files and directories at an absolute path inside a Declaw sandbox by calling the sandbox's file-list API endpoint.

Inputs

  • Sandbox ID (required) — ID of the target sandbox (e.g. sbx-a1b2c3d4). It is inserted into the request path.
  • Directory Path (required) — Absolute directory path inside the sandbox. Defaults to /home/user. Sent as the path query parameter.

Output shape

The parsed JSON response of GET /sandboxes/{sandboxId}/files/list, run through n8n's returnJsonArray. If the API returns an array, each element becomes its own output item. If it returns an object, you get a single item. Each output item is paired with its input item.

The source does not unwrap or reshape the response, so the exact entry fields (names, types, sizes) are determined by the Declaw API and are not visible in the node code. On error the node throws, or with Continue On Fail enabled it emits an item of the form {error: message}.

Examples

Example 1: Check what a script produced in the default working folder after running a command.

Sandbox ID = {{$json.sandbox_id}}, Directory Path = /home/user

Example 2: Browse a specific data folder before reading files from it.

Sandbox ID = sbx-a1b2c3d4, Directory Path = /home/user/output

Links

Discussion