Declaw icon

Declaw

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

File → Exists

AI-generated

Summary

Checks whether a file or directory exists at an absolute path inside a Declaw sandbox, by calling the sandbox's files/exists endpoint.

Inputs

  • Sandbox ID (required) — ID of the target sandbox (e.g. sbx-a1b2c3d4). It is inserted into the request URL.
  • File Path (required) — Absolute path inside the sandbox to check (e.g. /home/user/output.txt). It can be a file or a directory. It is sent as the path query parameter.

Output shape

One output item per input item, containing the JSON response from the Declaw API's GET /sandboxes/{id}/files/exists endpoint.

The source doesn't transform the response, so the exact field names (e.g. a boolean exists flag) come from the API and aren't shown here. If the API returns an error, such as an invalid sandbox, the node throws an error. With Continue On Fail enabled, it returns an item with {error: message} instead.

Examples

Example 1: Check that a script wrote its result file before reading it

Resource: File, Operation: Exists, Sandbox ID: {{$json.sandbox_id}}, File Path: /home/user/result.json

Example 2: Check that a directory exists before writing files into it

Resource: File, Operation: Exists, Sandbox ID: sbx-a1b2c3d4, File Path: /home/user/data

Links

Discussion