> For the complete documentation index, see [llms.txt](https://docs.testmace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testmace.com/node-types/link.md).

# Link

## How It Works&#x20;

A **Link** node allows to override the values of the running node variables. A **Link** node runs another node, passing the variables set by a user to it. After the run, dynamic variables of the node are set as dynamic variables of the **Link** node parent group. Thus the result of the run can be seen from any of the neighboring **Link** node.

#### You can refer to:

* a [RequestStep](/node-types/request-step.md) node;
* a [Folder](/node-types/folder.md) node.

#### You can NOT refer to:

* Another **Link** node (including self);
* Any child of a **Link** node (since it'll cause an endless loop).

{% hint style="info" %}
A Link node allows to override the variables values of the parent node.
{% endhint %}

{% hint style="warning" %}
If you delete the link a Link node refers to, the Link node wouldn't run until you provide a proper link.‌
{% endhint %}

## Parent Node

Create a parent node you need to refer to and create all necessary [static variables](/variables/user-variables/static-variables.md), for example `postID`. You can leave value fields empty.

![Creating variables of the parent node](/files/-Lh4ImcwyK7QPl4D0WmO)

## Link Node

Create a **Link** node and specify its parent, and you'll see all the variables you created for the parent earlier. You can use any variables or a static value as an overriden value.

![Creating a Link node and specifying its parent](/files/-Lh4VLCDdb58k9EvDvPd)

## Scenario Example

Let's see an example of running a [RequestStep](/node-types/request-step.md) node as a **Link** node to delete a record.

### Creating a parent node

1. Create a new [RequestStep](/node-types/request-step.md) node named deletePost.
2. Request type - DELETE.
3. Use the URL:[ https://testmace-stage.herokuapp.com/posts/${id}](< https://testmace-stage.herokuapp.com/posts/${id}>)
4. Create for this node a [static ](/variables/user-variables/static-variables.md)`id` variable without specifying its value.

![](/files/-LhFNaKST0F0_1ymsVjY)

### **Creating a scenario**

* Create a [Folder](/node-types/folder.md) node named **scenario**
* Add a [RequestStep](/node-types/request-step.md) node named **createPost** to the scenario:
  * Request type: POST;
  * URL: [https://testmace-stage.herokuapp.com/posts/](< https://testmace-stage.herokuapp.com/posts/${id}>)
  * Body: JSON request `{"title":"will delete with link node"}`
  * Run the request and the `id` of the created record to the [dynamic variable ](/variables/user-variables/dynamic-variables.md)`postid` of the **Scenario** node.

![](/files/-LhFQ274uAmdp39J7uz7)

* Create a **Link** node named **deleteLink**.
  * Specify the **project/deletePost** node as a parent.
  * &#x20;Set the`${$dynamicVar.postId}` as an overridden value for the `id` variable of the parent **deletePost** node.
* Create a [RequestStep](/node-types/request-step.md) node **checkIfExists** to check if the record was deleted:
  * Request type: GET;
  * URL: <https://testmace-stage.herokuapp.com/posts/${$dynamicVar.postId}>
  * 404 is an expected server response.

![](/files/-LhFRaKVohkgWjndBb3E)

## Import the Project [by URL](/other-features/import/shared.md)

{% file src="/files/-LglQkEld\_hqNoia9IpW" %}

### File Representation

A **Link** node is a folder with the node name, containing the index.yml file with the following format:

```javascript
{
  "type": "object",
  "properties": {
    "type": {
      "description": "Type of Link node",
      "const": "Link",
      "type": "string"
    },
    "linkedNode": {
      "$ref": "#/definitions/NodeReference",
      "description": "Link to node"
    },
    "children": {
      "description": "List of children names",
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "variables": {
      "$ref": "#/definitions/NodeVariables",
      "description": "Node variables dictionary"
    },
    "name": {
      "description": "Node name",
      "type": "string"
    }
  },
  "required": [
    "children",
    "linkedNode",
    "name",
    "type",
    "variables"
  ],
  "definitions": {
    "NodeReference": {
      "type": "object",
      "properties": {
        "refNodePath": {
          "description": "Absolute path to node",
          "type": "string"
        },
        "type": {
          "description": "Marker of reference entity",
          "const": "reference",
          "type": "string",
          "default": "reference"
        }
      },
      "required": [
        "refNodePath",
        "type"
      ]
    },
    "NodeVariables": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```
