# Open File/URL

> Open a file or URL in default system application.

Source: https://docs.sommatic.ai/en/nodes/io.desktop.open/

- Slug: `io.desktop.open`
- Family: Input and output
- Version: 1.0.0
- Status: Available
- Execution: async

Open a file or URL in default system application.

## Configuration

- `target` (string, required): URL or File Path
- `app` (string, optional): Optional specific app name

## Output ports

- `out` (default): Target opened successfully
- `error`: Failed to open target

## Input contract

- `target` (string, required)
- `app` (string, optional)

## Output contract

- `opened` (string, optional): Target opened

## In expressions

What a later node can read from this node's output with `$("Open File/URL").item.json.<path>` (write your node's label instead of `Open File/URL`). **Editor** marks the paths the workflow editor suggests under Previous Nodes (the output contract); **Worker** marks the paths the worker really returns through `out`, from the output shown in Ports.

- `$("Open File/URL").item.json.opened` (string) = `"https://app.example.com/reports/2026-11"`: Target opened


## How it works

Opens a URL or file with the default application, or with a named application, on the machine that runs the worker.

1. Resolves the config. `target` and `app` fall back to the same keys of the incoming payload.
2. Fails through `error` when `target` is empty.
3. Opens `target` with the system default handler, or with the application named in `app`.
4. Returns `{ opened: <target> }` through `out` once the open command was launched.

## In a workflow

### Node

```json
{
  "node_id": "node-open-report",
  "label": "Open report",
  "operator_slug": "io.desktop.open",
  "operator_version": "1.0.0",
  "config": {
    "target": "https://app.example.com/reports/{{ $json.period }}"
  }
}
```

### Envelope

```json
{
  "ok": true,
  "data": {
    "opened": "https://app.example.com/reports/2026-11"
  },
  "port": "out"
}
```

## Output ports (behaviour in the code)

### `out`

The open command was launched for `target`.

```json
{
  "opened": "https://app.example.com/reports/2026-11"
}
```

### `error`

`target` is missing or the open command could not be launched.

```json
{
  "error": "target is required"
}
```

## Errors

| Message | Port | Cause and fix |
| --- | --- | --- |
| `target is required` | `error` | Neither the config nor the incoming payload has a `target`. Set a URL or an absolute file path. |
| `<open command error message>` | `error` | The host could not launch the handler or the named `app`. Check that the application exists on that machine. |

## Notes and limits

- `out` means the open command was launched, not that the application finished loading the target. A file path that does not exist may still reach `out`, depending on the platform handler.
- The target opens on the host that runs the orchestrator worker, not on the user's device.


## Contracts (JSON Schema)

### All (`*.definition.js`)

```json
{
  "slug": "io.desktop.open",
  "name": "Open File/URL",
  "category": "io",
  "version": "1.0.0",
  "description": "Open a file or URL in default system application.",
  "capabilities": [
    "desktop",
    "open",
    "launch"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "target": {
        "type": "string",
        "description": "URL or File Path"
      },
      "app": {
        "type": "string",
        "description": "Optional specific app name"
      }
    },
    "required": [
      "target"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "target": {
        "type": "string"
      },
      "app": {
        "type": "string"
      }
    },
    "required": [
      "target"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "opened": {
        "type": "string",
        "description": "Target opened"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Opened",
      "description": "Target opened successfully",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Failed to open target",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "desktop-agent"
  ],
  "tags": [
    "desktop",
    "utility"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}
```

### config_schema

```json
{
  "type": "object",
  "properties": {
    "target": {
      "type": "string",
      "description": "URL or File Path"
    },
    "app": {
      "type": "string",
      "description": "Optional specific app name"
    }
  },
  "required": [
    "target"
  ]
}
```

### input_contract_schema

```json
{
  "type": "object",
  "properties": {
    "target": {
      "type": "string"
    },
    "app": {
      "type": "string"
    }
  },
  "required": [
    "target"
  ]
}
```

### output_contract_schema

```json
{
  "type": "object",
  "properties": {
    "opened": {
      "type": "string",
      "description": "Target opened"
    }
  }
}
```

### ports

```json
[
  {
    "port_id": "out",
    "label": "Opened",
    "description": "Target opened successfully",
    "is_default": true,
    "supports_condition": true
  },
  {
    "port_id": "error",
    "label": "Error",
    "description": "Failed to open target",
    "is_default": false,
    "supports_condition": false
  }
]
```
