On this page
Sommatic Docs
Open portal

Desktop Input (HID)

Simulate Keyboard/Mouse input.

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

Simulates one keyboard or mouse action (type text, tap a key, move the pointer or left-click) on the machine that runs the worker.

How it works

  1. Checks that the native input module is loaded; if not, leaves through error without doing anything.
  2. Resolves the config. type (default keyboard) and action fall back to the same keys of the incoming payload.
  3. Reads the action arguments text, x, y, key and modifier from payload.payload, else from payload. When the node config has no payload, payload is the incoming data.
  4. Keyboard: type types text; keyTap taps key with an optional modifier (string or array). Mouse: move moves to (x, y), defaulting to 0; click left-clicks at the current position.
  5. Returns { success: true } through out.

In a workflow

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

{
  "node_id": "node-type-reference",
  "label": "Type reference",
  "operator_slug": "io.desktop.input",
  "operator_version": "1.0.0",
  "config": {
    "type": "keyboard",
    "action": "type",
    "payload": {
      "text": "{{ $json.reference }}"
    }
  }
}

Configuration

type string Required

Default: keyboard

Allowed values: keyboardmouse

action string Required

Allowed values: typeclickmovekeyTap

payload object Optional

{ text, x, y, key, modifier }

Behaviour in the code

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

action
Valid pairs: keyboard + type/keyTap, mouse + move/click. Any other pair is a silent no-op that still leaves through out.
payload
Holds the action arguments { text, x, y, key, modifier }. A nested payload.payload takes precedence. click ignores x and y; move first.

Output ports

out default

The action ran. Also fires when the type/action combination matches nothing, in which case nothing was simulated.

Data
{
  "success": true
}
error

The native input module is not available, or the action failed (for example, an invalid key name).

Data
{
  "error": "RobotJS Native Module not available in this environment"
}

In expressions

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

Errors

Message Port Cause and fix
RobotJS Native Module not available in this environment error The native input library could not be loaded on the host (no desktop session or unsupported platform). Run the node on a machine with a desktop session.
<input library error message> error The library rejected the arguments, typically a missing or unknown key for keyTap. Pass a valid key name.

Input contract

type string Required
action string Required
payload object Optional

Output contract

success boolean Optional

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.input",
  "name": "Desktop Input (HID)",
  "category": "io",
  "version": "1.0.0",
  "description": "Simulate Keyboard/Mouse input.",
  "capabilities": [
    "hid",
    "keyboard",
    "mouse",
    "desktop"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "keyboard",
          "mouse"
        ],
        "default": "keyboard"
      },
      "action": {
        "type": "string",
        "enum": [
          "type",
          "click",
          "move",
          "keyTap"
        ]
      },
      "payload": {
        "type": "object",
        "description": "{ text, x, y, key, modifier }"
      }
    },
    "required": [
      "type",
      "action"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string"
      },
      "action": {
        "type": "string"
      },
      "payload": {
        "type": "object"
      }
    },
    "required": [
      "type",
      "action"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "success": {
        "type": "boolean"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Done",
      "description": "Input action simulated",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Simulation failed",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "desktop-agent"
  ],
  "tags": [
    "desktop",
    "hid"
  ],
  "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
hidkeyboardmousedesktop
Tags
desktophid

Notes and limits

  • Input is injected into the active desktop session of the host that runs the worker; whatever window has focus receives it.
  • One node performs exactly one action. Chain several nodes for a sequence (for example move, then click, then type).

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