On this page
Sommatic Docs
Open portal

Desktop Screenshot

Capture desktop screenshot.

View as Markdown
Open in
Input and output Available io.desktop.screenshot Version 1.0.0 Execution: async

Captures the screen of the machine that runs the worker and returns it as a base64 data URI, or saves it to a file and returns the path.

How it works

  1. Loads the screenshot module; if it is not installed, leaves through error.
  2. Resolves the config. format (default png) and filename fall back to the same keys of the incoming payload.
  3. With filename, saves the capture to that path and returns { path, timestamp }.
  4. Without filename, returns the image in memory as { image, base64, timestamp }: image is a data:image/png or data:image/jpeg URI and base64 the raw base64 string.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-capture-screen",
  "label": "Capture screen",
  "operator_slug": "io.desktop.screenshot",
  "operator_version": "1.0.0",
  "config": {
    "format": "png"
  }
}

Configuration

filename string Optional

Optional filename to save

format string Optional

Default: png

Allowed values: pngjpg

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

filename
Switches the output from an in-memory image to { path, timestamp }. The path is on the host that runs the worker.

Output ports

out default

The screen was captured. The shape depends on filename (see the operation).

Data
{
  "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
  "base64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "timestamp": "2026-11-26T15:04:05.000Z"
}
error

The screenshot module is missing or the capture failed.

Data
{
  "error": "Module screenshot-desktop not available"
}

In expressions

What a later node can read from this node's output with $("Desktop Screenshot").item.json.<path> (write your node's label instead of Desktop Screenshot). 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.

ExpressionEditorWorker
$("Desktop Screenshot").item.json.bufferobjectThe worker does not return it: reads as undefinedBase64 or buffer —
$("Desktop Screenshot").item.json.pathstringThe worker does not return it: reads as undefinedPath if saved to file —
$("Desktop Screenshot").item.json.imagestringNot suggested by the editor= "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg…"—
$("Desktop Screenshot").item.json.base64stringNot suggested by the editor= "iVBORw0KGgoAAAANSUhEUgAA..."—
$("Desktop Screenshot").item.json.timestampstringNot suggested by the editor= "2026-11-26T15:04:05.000Z"—

— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
Module screenshot-desktop not available error The screenshot library is not installed in the runtime that executes the worker.
<capture error message> error The host has no display to capture, or the target path for filename is not writable.

Input contract

filename string Optional
format string Optional

Output contract

buffer object Optional

Base64 or buffer

path string Optional

Path if saved to file

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "io.desktop.screenshot",
  "name": "Desktop Screenshot",
  "category": "io",
  "version": "1.0.0",
  "description": "Capture desktop screenshot.",
  "capabilities": [
    "desktop",
    "screenshot",
    "vision"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "filename": {
        "type": "string",
        "description": "Optional filename to save"
      },
      "format": {
        "type": "string",
        "enum": [
          "png",
          "jpg"
        ],
        "default": "png"
      }
    },
    "required": []
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "filename": {
        "type": "string"
      },
      "format": {
        "type": "string"
      }
    },
    "required": []
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "buffer": {
        "type": "object",
        "description": "Base64 or buffer"
      },
      "path": {
        "type": "string",
        "description": "Path if saved to file"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Image Buffer",
      "description": "Screenshot captured",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Capture failed",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "desktop-agent"
  ],
  "tags": [
    "desktop",
    "vision"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Capabilities
desktopscreenshotvision
Tags
desktopvision

Notes and limits

  • The output contract declares buffer, but the worker never returns it: use image or base64 (no filename) or path (with filename).
  • A full-screen capture in base64 can weigh several megabytes and travels in the run state; prefer filename for large screens or many captures.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs