On this page
Sommatic Docs
Open portal

JSON-RPC Client

Call JSON-RPC 2.0 Method.

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

Sends one JSON-RPC 2.0 request as an HTTP POST and returns the result member, or the JSON-RPC error member through the error port.

How it works

  1. Resolves the config. connection_id, method, params and id fall back to the same keys of the incoming payload; connection_id and method are required.
  2. Resolves the credential: the URL is config.url (or config.endpoint); when the secret has username and password, HTTP Basic authentication is used.
  3. Builds { jsonrpc: "2.0", method, params, id }: a string params is parsed as JSON, a missing one becomes []; id defaults to 1.
  4. POSTs the request. A response with an error member leaves through error; otherwise { result } leaves 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-get-balance",
  "label": "Get balance",
  "operator_slug": "io.jsonrpc",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "method": "account.getBalance",
    "params": "[\"{{ $json.account_id }}\"]",
    "id": "1"
  }
}

Configuration

connection_id string Required

Credential for the JSON-RPC endpoint. Accepts credentials of type `api-key` or `basic-auth`.

method string Required

Method Name

params string Optional

Parameters (Array/Object as JSON string or array)

id string Optional

Request ID

Default: 1

Behaviour in the code

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

connection_id
Only username + password are read from the secret (basic-auth); an api-key credential adds no authentication. A value starting with http:// or https:// is used as the endpoint URL itself, without authentication.
params
Accepts an array, an object or a JSON string; strings are parsed before sending.
id
Sent as configured (a string when set in the config); the number 1 when empty.

Output ports

out default

The server answered 2xx without an error member. result is the JSON-RPC result.

Data
{
  "result": {
    "balance": "1250.40",
    "currency": "USD"
  }
}
error

The response has a JSON-RPC error (data is { error: { code, message, data? } }), or the request failed (data is { error, response } with a message string).

Data
{
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}

In expressions

What a later node can read from this node's output with $("JSON-RPC Client").item.json.<path> (write your node's label instead of JSON-RPC Client). 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
$("JSON-RPC Client").item.json.resultobject= {…}JSON-RPC Result
$("JSON-RPC Client").item.json.result.balancestringNot suggested by the editor= "1250.40"—
$("JSON-RPC Client").item.json.result.currencystringNot suggested by the editor= "USD"—

— 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
connection_id is required error No credential selected.
method is required error The method name is empty in the config and in the incoming payload.
<JSON parse error> error params is a string that is not valid JSON. Write a JSON array or object, for example ["acc_001"].
Request failed with status code <status> error The HTTP call answered non-2xx; response holds the body.

Input contract

connection_id string Required
method string Required
params string Optional
id string Optional

Output contract

result object Optional

JSON-RPC Result

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.jsonrpc",
  "name": "JSON-RPC Client",
  "category": "io",
  "version": "1.0.0",
  "description": "Call JSON-RPC 2.0 Method.",
  "capabilities": [
    "jsonrpc",
    "api",
    "http"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string",
        "title": "JSON-RPC Credential",
        "description": "Credential for the JSON-RPC endpoint. Accepts credentials of type `api-key` or `basic-auth`.",
        "ui_widget": "connection_picker",
        "ui_options": {
          "credential_types": [
            "api-key",
            "basic-auth"
          ],
          "types": [
            "jsonrpc",
            "http"
          ]
        }
      },
      "method": {
        "type": "string",
        "description": "Method Name"
      },
      "params": {
        "type": "string",
        "description": "Parameters (Array/Object as JSON string or array)"
      },
      "id": {
        "type": "string",
        "default": "1",
        "description": "Request ID"
      }
    },
    "required": [
      "connection_id",
      "method"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string"
      },
      "method": {
        "type": "string"
      },
      "params": {
        "type": "string"
      },
      "id": {
        "type": "string"
      }
    },
    "required": [
      "connection_id",
      "method"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "result": {
        "type": "object",
        "description": "JSON-RPC Result"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Result",
      "description": "JSON-RPC Result",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "JSON-RPC Error",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io"
  ],
  "tags": [
    "rpc",
    "api"
  ],
  "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
Credentials
Resolved on the server from connection_id; the secret never reaches the workflow.
Capabilities
jsonrpcapihttp
Tags
rpcapi

Notes and limits

  • One request per run; batch requests and notifications (requests without id) are not supported. No timeout and no retries.

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