Desktop Screenshot
Capture desktop screenshot.
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
- Loads the screenshot module; if it is not installed, leaves through
error. - Resolves the config.
format(defaultpng) andfilenamefall back to the same keys of the incoming payload. - With
filename, saves the capture to that path and returns{ path, timestamp }. - Without
filename, returns the image in memory as{ image, base64, timestamp }:imageis adata:image/pngordata:image/jpegURI andbase64the 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"
}
}{
"ok": true,
"data": {
"image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"timestamp": "2026-11-26T15:04:05.000Z"
},
"port": "out"
}Configuration
-
filenamestring Optional -
Optional filename to save
-
formatstring Optional
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).
{
"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.
{
"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.
| Expression | Editor | Worker |
|---|---|---|
$("Desktop Screenshot").item.json.bufferBase64 or buffer | — | |
$("Desktop Screenshot").item.json.pathPath if saved to file | — | |
$("Desktop Screenshot").item.json.image | — | |
$("Desktop Screenshot").item.json.base64 | — | |
$("Desktop Screenshot").item.json.timestamp | — |
— 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
-
filenamestring Optional -
formatstring Optional
Output contract
-
bufferobject Optional -
Base64 or buffer
-
pathstring 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
}
}
}{
"type": "object",
"properties": {
"filename": {
"type": "string",
"description": "Optional filename to save"
},
"format": {
"type": "string",
"enum": [
"png",
"jpg"
],
"default": "png"
}
},
"required": []
}{
"type": "object",
"properties": {
"filename": {
"type": "string"
},
"format": {
"type": "string"
}
},
"required": []
}{
"type": "object",
"properties": {
"buffer": {
"type": "object",
"description": "Base64 or buffer"
},
"path": {
"type": "string",
"description": "Path if saved to file"
}
}
}[
{
"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
- Execution
async- Stateful
- No
- Capabilities
desktopscreenshotvision- Tags
desktopvision
Notes and limits
- The output contract declares
buffer, but the worker never returns it: useimageorbase64(nofilename) orpath(withfilename). - A full-screen capture in base64 can weigh several megabytes and travels in the run state; prefer
filenamefor large screens or many captures.
Reviewed against the orchestrator code · 31e874b · 2026-11-26