---
title: "node.link: Link Sockets — Scene kit command — Kition"
description: "Links output socket `fromSocket` of node `from` to input socket `toSocket` of node `to` in `group`."
canonical: "https://developer.kition.ai/docs/kits/scene/commands/node.link"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/scene/commands/node.link](https://developer.kition.ai/docs/kits/scene/commands/node.link)

# node.link

**Link Sockets.** Links output socket `fromSocket` of node `from` to input socket `toSocket` of node `to` in `group`.

- Kit: Scene 0.1.0 (.kscene); reference: [Scene kit commands](https://developer.kition.ai/docs/kits/scene.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `integer` | yes | The node whose output to link: its id |
| `fromSocket` | `string` | yes | The output socket's id |
| `group` | `integer \| string` | no | The group's id or name; the only group when left out |
| `to` | `integer` | yes | The node whose input to link: its id |
| `toSocket` | `string` | yes | The input socket's id; a link already there is replaced unless the input takes several |

## Call through scene_run

```text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "node.link", "params": { "from": <integer>, "fromSocket": <string>, "to": <integer>, "toSocket": <string> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `group`. scene_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "from": {
      "description": "The node whose output to link: its id",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "fromSocket": {
      "description": "The output socket's id",
      "type": "string"
    },
    "group": {
      "description": "The group's id or name; the only group when left out",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "NodeGroup"
      ]
    },
    "to": {
      "description": "The node whose input to link: its id",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "toSocket": {
      "description": "The input socket's id; a link already there is replaced unless the input takes several",
      "type": "string"
    }
  },
  "required": [
    "from",
    "fromSocket",
    "to",
    "toSocket"
  ],
  "type": "object"
}
```

Generated from the command list of @kition/scene-darwin-arm64@0.1.0 and the kit itself (scene_commands through @kition/cli@0.1.1, built from KitionAI/kition-scene@4d06faf).
