File size: 3,915 Bytes
7fb350b
 
 
 
6c304f1
34d094e
6c304f1
34d094e
6c304f1
34d094e
6c304f1
34d094e
6c304f1
3ffe708
6c304f1
 
 
 
 
3ffe708
6c304f1
3ffe708
6c304f1
34d094e
6c304f1
34d094e
6c304f1
3ffe708
6c304f1
3ffe708
 
6c304f1
 
 
 
 
 
3ffe708
 
6c304f1
3ffe708
6c304f1
3ffe708
6c304f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34d094e
 
 
6c304f1
3ffe708
6c304f1
3ffe708
 
6c304f1
 
3ffe708
 
6c304f1
34d094e
6c304f1
34d094e
 
6c304f1
 
 
 
 
 
 
 
 
 
3ffe708
6c304f1
 
 
 
 
3ffe708
 
6c304f1
 
 
34d094e
 
6c304f1
3ffe708
6c304f1
 
 
 
 
 
 
 
 
 
 
 
 
 
34d094e
3ffe708
 
 
34d094e
3ffe708
34d094e
 
6c304f1
34d094e
6c304f1
34d094e
6c304f1
34d094e
6c304f1
 
 
 
3ffe708
6c304f1
3ffe708
6c304f1
34d094e
6c304f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
---
sidebar_position: 3
---

# YAML Tab in Node Settings

The **YAML** tab combines all data from other tabs (Design, Script, Environment, Catalog) into a unified view that defines everything about your node - from technical metadata to its position in the pipeline workspace.

![YAML Tab Interface](../img/node-yaml.png)

## What is the YAML View?

The YAML tab serves as the "source code" of your node. It combines:

- Input and output definitions from the Design tab
- JavaScript code from the Script tab  
- Technical metadata from the Catalog tab
- Environment variables from the Environment tab
- Node positioning and connections within the pipeline

This complete representation allows you to precisely duplicate nodes by copying their YAML configuration to other pipelines.

## YAML Structure

The YAML configuration is organized into logical sections:

### Technical Information
```yaml
_id: merge_text_to_json
version: 1
category:
  _id: processing
  title: en=Processing;ru=Обработка
package: custom
title: en=Merge text to JSON;ru=Объединение текста в JSON
source: node
execution: regular
```

These fields define the node's identifier, version, category classification, and package binding.

### Execution Script
```yaml
script: |-
  export async function run({ inputs }) {
      const { NextNode } = DEFINITIONS;

      const jsonArray = [];

      if (inputs.string1) {
          jsonArray.push(inputs.string1);
      }
      if (inputs.string2) {
          jsonArray.push(inputs.string2);
      }
      if (inputs.string3) {
          jsonArray.push(inputs.string3);
      }
      if (inputs.string4) {
          jsonArray.push(inputs.string4);
      }

      return NextNode.from({
          outputs: {
              json_output: jsonArray
          }
      });
  }
```

Contains the complete custom JavaScript code that we wrote in the Script tab.

### Node Positioning
```yaml
arrange:
  x: 170
  y: 290
```

Defines the exact position of the node in the pipeline workspace.

### Input/Output Definitions
```yaml
inputs:
  string1:
    title: en=String 1;ru=Строка 1
    type: string
    required: false
  string2:
    title: en=String 2;ru=Строка 2
    type: string
    required: false
  string3:
    title: en=String 3;ru=Строка 3
    type: string
    required: false
  string4:
    title: en=String 4;ru=Строка 4
    type: string
    required: false

outputs:
  json_output:
    title: en=JSON;ru=JSON
    type: json
```

Complete specifications for all 4 input parameters and 1 output parameter that we configured in the Design tab.

### Catalog Information (Optional)
```yaml
catalog:
  _id: merge_text_to_json
  version: 1
  category:
    _id: service_nodes
    title: Service Nodes
  package: service_nodes
```

Metadata for publishing and organizing your custom node in the catalog.

### Environment Variables (Optional)
```yaml
environment:
  OPEN_PAAS_USER:
    title: PaaS user
    type: string
    scope: global
```

All environment variables and API keys required to connect the node to external providers.

## Copying and Reusing Nodes

The most powerful feature of the YAML tab is the ability to create exact duplicates of nodes:

1. **Copy YAML** - Select all code in the YAML tab and copy it
2. **Create New Node** - Add a new node to any pipeline
3. **Paste Configuration** - Replace the new node's YAML with the copied code
4. **Save Changes** - The node will be recreated with identical functionality

This process preserves all settings, code, and configuration, making it simple to reuse any nodes across different pipelines.

## Read-Only

The YAML tab is primarily intended for viewing and copying. While you can see the complete node configuration here, changes should be made through the appropriate tabs (Script for code changes, Design for input/output modifications, etc.) to ensure proper validation and formatting.