Merge branch 'main' of https://huggingface.co/spaces/PiperMy/Academy
Browse files- docs/advanced-development/creating-custom-node.mdx +205 -0
- docs/advanced-development/creating-nodes.mdx +0 -134
- docs/advanced-development/node-script.mdx +161 -38
- docs/advanced-development/node-yaml.mdx +193 -105
- docs/advanced-development/pipeline-yaml.mdx +93 -99
- docs/img/{create-node-3.webp → create-node-1.png} +2 -2
- docs/img/{Node-YAML.jpg → create-node-2.png} +2 -2
- docs/img/{create-node-1.webp → create-node-3.png} +2 -2
- docs/img/{create-node-2.webp → create-node-4.png} +2 -2
- docs/img/create-node-4.webp +0 -3
- docs/img/create-node-5.png +3 -0
- docs/img/create-node-6.png +3 -0
- docs/img/create-node-7.png +3 -0
- docs/img/create-node-8.png +3 -0
- docs/img/node-yaml.png +3 -0
docs/advanced-development/creating-custom-node.mdx
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
sidebar_position: 1
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# Создание кастомной ноды
|
| 6 |
+
|
| 7 |
+
Создание кастомных нод позволяет обойти ограничения, которые связаны со стандартной библиотекой нод Piper, или же даже просто улучшить функционал текущих нод.
|
| 8 |
+
|
| 9 |
+
Давайте создадим кастомную ноду **Merge text to JSON**, которая принимает несколько текстовых строк и объединяет их в один JSON массив.
|
| 10 |
+
|
| 11 |
+
## **1. Загрузка ноды из библиотеки нод**
|
| 12 |
+
|
| 13 |
+
Для создания кастомной ноды начните с загрузки существующей ноды, которая наиболее близка к вашим требованиям. Перейдите в библиотеку нод, используя значок **плюс (+)** в верхнем левом углу рабочего пространства пайплайны и выберите ноду **Input Text** для модификации, поскольку в ней минимум кода и она работает со строками.
|
| 14 |
+
|
| 15 |
+
После добавления ноды откройте её настройки.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
|
| 19 |
+
Панель настроек включает несколько вкладок:
|
| 20 |
+
|
| 21 |
+
- **Inputs** - Текущие параметры ноды, их настройка, загрузка изображений
|
| 22 |
+
- **Design** - Создание входных и выходных параметров, определение их свойств
|
| 23 |
+
- **Script** - Редактирование кода JavaScript, логика ноды
|
| 24 |
+
- **Environment** - Настройка переменных окружения
|
| 25 |
+
- **Catalog** - Просмотр метаданных ноды и её публикация
|
| 26 |
+
- **YAML** - Доступ к YAML ноды
|
| 27 |
+
|
| 28 |
+
## **2. Настройка ноды**
|
| 29 |
+
|
| 30 |
+
Кастомизация начинается со вкладки **Design**, где определяется структура ноды.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
|
| 34 |
+
### Основные свойства
|
| 35 |
+
- **ID** - Внутреннее имя, используемое в коде (строчные латинские буквы, без пробелов)
|
| 36 |
+
- **Title** - Отображаемое имя, видимое пользователю
|
| 37 |
+
|
| 38 |
+
Для нашей ноды прежние значения необходимо заменить на:
|
| 39 |
+
- ID: `merge_text_to_json`
|
| 40 |
+
- Title: `Merge text to JSON`
|
| 41 |
+
|
| 42 |
+
### Добавление входных параметров
|
| 43 |
+
|
| 44 |
+
Нашей ноде нужно 4 строковых входа. Чтобы добавить новый вход:
|
| 45 |
+
|
| 46 |
+
1. Раскройте меню-гамбургер **Inputs**
|
| 47 |
+
2. Введите имя нового входа: `string1`
|
| 48 |
+
3. Нажмите **Add**
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
|
| 52 |
+
Настройте параметры входа:
|
| 53 |
+
- **Type**: string (то есть текст)
|
| 54 |
+
- **Title**: String 1 (название, отображаемое на ноде)
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
|
| 58 |
+
Повторите этот процесс для создания входов `string2`, `string3` и `string4`.
|
| 59 |
+
|
| 60 |
+
Чтобы удалить прежний входной параметр `input_text`, снимите галочку с него в меню Inputs.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
|
| 64 |
+
Если визуально изменения не произошли, нужно временно открыть другую вкладку и потом вернуться в Design.
|
| 65 |
+
|
| 66 |
+
### Расширенные настройки входных параметров
|
| 67 |
+
|
| 68 |
+
Доступ к детальным настройкам входных параметров открывается через меню-гамбургер.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
|
| 72 |
+
Доступные опции включают:
|
| 73 |
+
|
| 74 |
+
- **Order** (число) - Задаёт порядок расположения входов в ноде
|
| 75 |
+
- **Description** (текст) - Текст всплывающей подсказки для параметра
|
| 76 |
+
- **Required** (boolean) - True делает параметр обязательным
|
| 77 |
+
- **Group** (текст) - Группирует связанные настройки
|
| 78 |
+
- **Enum** (текст) - Создает выпадающие списки с предопределенными значениями
|
| 79 |
+
- **Multiline** (boolean) - Расширяет поля String для длинного текста
|
| 80 |
+
- **Min, Max** (число) - Устанавливает ограничения для полей Integer
|
| 81 |
+
- **Step** (число) - Преобразует поле Integer в ползунок с шагом, равным значению Step
|
| 82 |
+
- **Default** - Устанавливает значения по умолчанию
|
| 83 |
+
- **Placeholder** (текст) - Показывает подсказку в пустых полях String
|
| 84 |
+
- **Schema** - Техническое поле для скриптов
|
| 85 |
+
- **Extensions** (текст) - Добавляет специальную функциональность (например, draw-mask для задания маски на загруженном изображении)
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
|
| 89 |
+
### Настройка выходных параметров
|
| 90 |
+
|
| 91 |
+
Создайте выходной параметр. Для этого удалите прежний выход `output_text` и добавьте новый `json_output` со следующими параметрами:
|
| 92 |
+
- **Type**: JSON
|
| 93 |
+
- **Title**: JSON
|
| 94 |
+
|
| 95 |
+
Итогое окно Design должно выглядеть примерно так:
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
|
| 99 |
+
:::tip Совет
|
| 100 |
+
Отслеживайте ваши изменения во вкладке **Inputs**, чтобы видеть, как модификации влияют на структуру ноды.
|
| 101 |
+
:::
|
| 102 |
+
|
| 103 |
+
Про следующий шаг - написание логики скрипта ноды, в разделе **Вкладка Node Script**.
|
| 104 |
+
|
| 105 |
+
--- eng ---
|
| 106 |
+
|
| 107 |
+
# Creating Custom Nodes
|
| 108 |
+
|
| 109 |
+
Creating custom nodes allows you to bypass limitations associated with Piper's standard node library, or even simply improve the functionality of current nodes.
|
| 110 |
+
|
| 111 |
+
Let's create a custom **Merge text to JSON** node that takes multiple text strings and combines them into a single JSON array.
|
| 112 |
+
|
| 113 |
+
## **1. Loading a Node from the Node Library**
|
| 114 |
+
|
| 115 |
+
To create a custom node, start by loading an existing node that's closest to your requirements. Navigate to the node library using the **plus (+)** icon in the top left corner of the pipeline workspace and select the **Input Text** node for modification, since it has minimal code and works with strings.
|
| 116 |
+
|
| 117 |
+
After adding the node, open its settings.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
|
| 121 |
+
The settings panel includes several tabs:
|
| 122 |
+
|
| 123 |
+
- **Inputs** - Current node parameters, their configuration, image loading
|
| 124 |
+
- **Design** - Creating input and output parameters, defining their properties
|
| 125 |
+
- **Script** - Editing JavaScript code, node logic
|
| 126 |
+
- **Environment** - Configure environment variables
|
| 127 |
+
- **Catalog** - View node metadata and publish it
|
| 128 |
+
- **YAML** - Access the node's YAML
|
| 129 |
+
|
| 130 |
+
## **2. Node Configuration**
|
| 131 |
+
|
| 132 |
+
Customization begins in the **Design** tab, where the node structure is defined.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
|
| 136 |
+
### Basic Properties
|
| 137 |
+
- **ID** - Internal name used in code (lowercase Latin letters, no spaces)
|
| 138 |
+
- **Title** - Display name visible to the user
|
| 139 |
+
|
| 140 |
+
For our node, the previous values need to be replaced with:
|
| 141 |
+
- ID: `merge_text_to_json`
|
| 142 |
+
- Title: `Merge text to JSON`
|
| 143 |
+
|
| 144 |
+
### Adding Input Parameters
|
| 145 |
+
|
| 146 |
+
Our node needs 4 string inputs. To add a new input:
|
| 147 |
+
|
| 148 |
+
1. Expand the **Inputs** hamburger menu
|
| 149 |
+
2. Enter the new input name: `string1`
|
| 150 |
+
3. Click **Add**
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
|
| 154 |
+
Configure the input parameters:
|
| 155 |
+
- **Type**: string (i.e., text)
|
| 156 |
+
- **Title**: String 1 (name displayed on the node)
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
|
| 160 |
+
Repeat this process to create inputs `string2`, `string3`, and `string4`.
|
| 161 |
+
|
| 162 |
+
To remove the previous input parameter `input_text`, uncheck it in the Inputs menu.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
|
| 166 |
+
If no visual changes occur, you need to temporarily open another tab and then return to Design.
|
| 167 |
+
|
| 168 |
+
### Advanced Input Parameter Settings
|
| 169 |
+
|
| 170 |
+
Access to detailed settings is opened through the hamburger menu.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
|
| 174 |
+
Available options include:
|
| 175 |
+
|
| 176 |
+
- **Order** (number) - Sets the order of inputs in the node
|
| 177 |
+
- **Description** (text) - Tooltip text for the parameter
|
| 178 |
+
- **Required** (boolean) - True makes the parameter mandatory
|
| 179 |
+
- **Group** (text) - Groups related settings
|
| 180 |
+
- **Enum** (text) - Creates dropdown lists with predefined values
|
| 181 |
+
- **Multiline** (boolean) - Expands String fields for long text
|
| 182 |
+
- **Min, Max** (number) - Sets constraints for Integer fields
|
| 183 |
+
- **Step** (number) - Converts Integer field to slider with step equal to Step value
|
| 184 |
+
- **Default** - Sets default values
|
| 185 |
+
- **Placeholder** (text) - Shows hints in empty String fields
|
| 186 |
+
- **Schema** - Technical field for scripts
|
| 187 |
+
- **Extensions** (text) - Adds special functionality (e.g., draw-mask for setting masks on uploaded images)
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
|
| 191 |
+
### Configuring Output Parameters
|
| 192 |
+
|
| 193 |
+
Create an output parameter. To do this, delete the previous output `output_text` and add a new `json_output` with the following parameters:
|
| 194 |
+
- **Type**: JSON
|
| 195 |
+
- **Title**: JSON
|
| 196 |
+
|
| 197 |
+
The final Design window should look something like this:
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
|
| 201 |
+
:::tip Tip
|
| 202 |
+
Monitor your changes in the **Inputs** tab to see how modifications affect the node structure.
|
| 203 |
+
:::
|
| 204 |
+
|
| 205 |
+
The next step - writing the node's script logic, is covered in the **Node Script Tab** section.
|
docs/advanced-development/creating-nodes.mdx
DELETED
|
@@ -1,134 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
sidebar_position: 1
|
| 3 |
-
---
|
| 4 |
-
|
| 5 |
-
# Create Node
|
| 6 |
-
|
| 7 |
-
Creating nodes is the foundation of building pipelines in Piper. Each node provides access to a specific neural network or performs a programmed operation, and passes the results to the input of the next node in your workflow.
|
| 8 |
-
|
| 9 |
-
## **1. Adding a New Node**
|
| 10 |
-
|
| 11 |
-
To create a new node in your pipeline, locate the **plus (+)** icon in the upper left corner of the interface. This button opens the node library where you can browse and select from available nodes.
|
| 12 |
-
|
| 13 |
-

|
| 14 |
-
|
| 15 |
-
## **2. Node Library**
|
| 16 |
-
|
| 17 |
-
The node library displays all available nodes organized into logical categories to help you find the right functionality for your pipeline:
|
| 18 |
-
|
| 19 |
-

|
| 20 |
-
|
| 21 |
-
### Common Node Categories:
|
| 22 |
-
|
| 23 |
-
- **Generate images** - Nodes for generating and modifying images
|
| 24 |
-
- **Work with images** - Image processing not related to generation
|
| 25 |
-
- **Generate videos** - Nodes for video generation
|
| 26 |
-
- **Process videos** - Video processing not related to generation
|
| 27 |
-
- **Language agents** - Nodes for calling text LLM models
|
| 28 |
-
- **Analyze images** - Group of nodes for image analysis, evaluation and detection
|
| 29 |
-
- **Computer vision** - Image description nodes
|
| 30 |
-
|
| 31 |
-
Browse through the categories and click on any node to add it to your pipeline workspace.
|
| 32 |
-
|
| 33 |
-
## **3. Node Interaction**
|
| 34 |
-
|
| 35 |
-
Once a node is added to your workspace, you can interact with it using the control icons that appear when you hover over the node:
|
| 36 |
-
|
| 37 |
-

|
| 38 |
-
|
| 39 |
-
### Control Icons:
|
| 40 |
-
|
| 41 |
-
- **Hand icon (🖐️)** - Click and drag to move the node around the workspace
|
| 42 |
-
- **Notebook icon (📝)** - Opens the node configuration panel
|
| 43 |
-
|
| 44 |
-
These icons provide quick access to essential node operations without cluttering the interface.
|
| 45 |
-
|
| 46 |
-
## **4. Node Configuration**
|
| 47 |
-
|
| 48 |
-
Clicking the notebook icon opens the node settings panel where you can customize the node's behavior:
|
| 49 |
-
|
| 50 |
-
The configuration panel includes multiple tabs:
|
| 51 |
-
|
| 52 |
-
- **Inputs** - Define input parameters and data sources
|
| 53 |
-
- **Design** - Configure input and output parameters
|
| 54 |
-
- **Script** - Edit the node's JavaScript code logic
|
| 55 |
-
- **Environment** - Configure environment variables
|
| 56 |
-
- **Catalog** - View node metadata and publish it
|
| 57 |
-
- **YAML** - Access the node's YAML definition
|
| 58 |
-
|
| 59 |
-
## **5. Deleting Nodes**
|
| 60 |
-
|
| 61 |
-
To remove a node from your pipeline:
|
| 62 |
-
|
| 63 |
-
1. Click the notebook icon to open the node settings
|
| 64 |
-
2. Look for the red **Delete** button in the upper left corner of the settings panel
|
| 65 |
-
3. Click Delete to permanently remove the node from your pipeline
|
| 66 |
-
|
| 67 |
-

|
| 68 |
-
|
| 69 |
-
Be careful when deleting nodes, as this action cannot be undone and may break connections in your pipeline.
|
| 70 |
-
|
| 71 |
-
--- ru ---
|
| 72 |
-
|
| 73 |
-
# Создание ноды
|
| 74 |
-
|
| 75 |
-
Создание нод является основой построения пайплайнов в Piper. Каждая нода представляет определенную функцию или операцию, которая обрабатывает данные и передает их на следующий шаг в вашем рабочем процессе.
|
| 76 |
-
|
| 77 |
-
## **1. Добавление новой ноды**
|
| 78 |
-
|
| 79 |
-
Чтобы создать новую ноду в вашем пайплайне, найдите значок **плюс (+)** в верхнем левом углу интерфейса. Эта кнопка открывает библиотеку нод, где вы можете просматривать и выбирать из доступных нод.
|
| 80 |
-
|
| 81 |
-

|
| 82 |
-
|
| 83 |
-
## **2. Библиотека нод**
|
| 84 |
-
|
| 85 |
-
Библиотека нод отображает все доступные ноды, организованные в логические категории, чтобы помочь вам найти нужную функциональность для вашего пайплайна:
|
| 86 |
-
|
| 87 |
-

|
| 88 |
-
|
| 89 |
-
### Основные категории нод:
|
| 90 |
-
|
| 91 |
-
- **Генерация изображений** - Ноды для генерации и изменения изображений
|
| 92 |
-
- **Работа с изображениями** - Работа с изображениями, не связанная с генерацией
|
| 93 |
-
- **Генерация видео** - Ноды для генерации видео
|
| 94 |
-
- **Обработка видео** - Работа с видео, не связанная с генерацией
|
| 95 |
-
- **Анализ изображений** - Группа нод по анализу, оценке и детектированию изображений
|
| 96 |
-
- **Computer vision** - Описание изображений
|
| 97 |
-
|
| 98 |
-
Просмотрите категории и нажмите на любую ноду, чтобы добавить её в рабочее пространство вашего пайплайна.
|
| 99 |
-
|
| 100 |
-
## **3. Взаимодействие с нодой**
|
| 101 |
-
|
| 102 |
-
После добавления ноды в рабочее пространство вы можете взаимодействовать с ней с помощью значков управления, которые появляются при наведении курсора на ноду:
|
| 103 |
-
|
| 104 |
-

|
| 105 |
-
|
| 106 |
-
### Значки управления:
|
| 107 |
-
|
| 108 |
-
- **Значок ладони (🖐️)** - Нажмите и перетащите для перемещения ноды по рабочему пространству
|
| 109 |
-
- **Значок блокнота (📝)** - Открывает панель настроек ноды
|
| 110 |
-
|
| 111 |
-
## **4. Настройка ноды**
|
| 112 |
-
|
| 113 |
-
Нажатие на значок блокнота открывает панель настроек ноды, где вы можете настроить поведение ноды:
|
| 114 |
-
|
| 115 |
-
Панель настроек включает несколько вкладок:
|
| 116 |
-
|
| 117 |
-
- **Inputs** - Определение входных параметров и источников данных
|
| 118 |
-
- **Design** - Настройка входных и выходных параметров
|
| 119 |
-
- **Script** - Редактирование JavaScript кода логики ноды
|
| 120 |
-
- **Environment** - Настройка переменных окружения
|
| 121 |
-
- **Catalog** - Просмотр метаданных ноды и её публикация
|
| 122 |
-
- **YAML** - Доступ к YAML ноды
|
| 123 |
-
|
| 124 |
-
## **5. Удаление нод**
|
| 125 |
-
|
| 126 |
-
Чтобы удалить ноду из вашего пайплайна:
|
| 127 |
-
|
| 128 |
-
1. Нажмите на значок блокнота, чтобы открыть настройки ноды
|
| 129 |
-
2. Найдите красную кнопку **Delete** в верхнем левом углу панели настроек
|
| 130 |
-
3. Нажмите Delete, чтобы окончательно удалить ноду из вашего пайплайна
|
| 131 |
-
|
| 132 |
-

|
| 133 |
-
|
| 134 |
-
Будьте осторожны при удалении нод, так как это действие нельзя отменить и оно может нарушить соединения в вашем пайплайн.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/advanced-development/node-script.mdx
CHANGED
|
@@ -2,92 +2,215 @@
|
|
| 2 |
sidebar_position: 2
|
| 3 |
---
|
| 4 |
|
| 5 |
-
#
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-

|
| 10 |
|
| 11 |
+
## Структура кода
|
| 12 |
|
| 13 |
+
Все ноды Piper, включая кастомные, следуют определенной структуре JavaScript:
|
| 14 |
|
| 15 |
```javascript
|
| 16 |
export async function run({ inputs }) {
|
| 17 |
const { FatalError, NextNode } = DEFINITIONS;
|
| 18 |
|
| 19 |
+
// Ваш код здесь
|
| 20 |
|
| 21 |
return NextNode.from({
|
| 22 |
outputs: {
|
| 23 |
+
// Ваши результаты
|
| 24 |
}
|
| 25 |
});
|
| 26 |
}
|
| 27 |
```
|
| 28 |
|
| 29 |
+
Эта структура гарантирует, что ваша нода может правильно получать данные от предыдущих нод и передавать результаты следующим в вашем пайплайне.
|
| 30 |
|
| 31 |
+
### Оригинальный код Input Text
|
| 32 |
+
Базовая нода **Input Text** имеет эту простую структуру:
|
| 33 |
+
|
| 34 |
+
```javascript
|
| 35 |
+
export async function run({ inputs }) {
|
| 36 |
+
const { FatalError, NextNode } = DEFINITIONS;
|
| 37 |
|
| 38 |
+
const text = inputs.input_text;
|
| 39 |
|
| 40 |
+
return NextNode.from({
|
| 41 |
+
outputs: {
|
| 42 |
+
output_text: text
|
| 43 |
+
}
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
```
|
| 47 |
|
| 48 |
+
### Кастомный код Merge Text to JSON
|
| 49 |
+
Нам нужно заменить это логикой, которая обрабатывает несколько строковых входов и создает JSON массив:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
```javascript
|
| 52 |
+
export async function run({ inputs }) {
|
| 53 |
+
const { FatalError, NextNode } = DEFINITIONS;
|
| 54 |
|
| 55 |
+
const jsonArray = [];
|
| 56 |
+
|
| 57 |
+
if (inputs.string1) {
|
| 58 |
+
jsonArray.push(inputs.string1);
|
| 59 |
+
}
|
| 60 |
+
if (inputs.string2) {
|
| 61 |
+
jsonArray.push(inputs.string2);
|
| 62 |
+
}
|
| 63 |
+
if (inputs.string3) {
|
| 64 |
+
jsonArray.push(inputs.string3);
|
| 65 |
+
}
|
| 66 |
+
if (inputs.string4) {
|
| 67 |
+
jsonArray.push(inputs.string4);
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
return NextNode.from({
|
| 71 |
+
outputs: {
|
| 72 |
+
json_output: jsonArray
|
| 73 |
+
}
|
| 74 |
+
});
|
| 75 |
+
}
|
| 76 |
+
```
|
| 77 |
+
## Понимание кастомной логики
|
| 78 |
|
| 79 |
+
Кастомный скрипт реализует следующую логику:
|
| 80 |
|
| 81 |
+
1. **Инициализация пустого массива** - `const jsonArray = []` создает пустой массив для хранения наших текстовых строк
|
| 82 |
+
2. **Проверка каждого входа** - Условия `if` проверяют, что каждый вход имеет значение перед добавлением
|
| 83 |
+
3. **Построение массива** - Только непустые входы добавляются в `jsonArray` с помощью `push()`
|
| 84 |
+
4. **Возврат JSON выхода** - Финальный массив возвращается как `json_output`, соответствуя нашей конфигурации во вкладке Design
|
| 85 |
|
| 86 |
+
Этот подход гарантирует, что:
|
| 87 |
+
- Пустые или неопределенные входы игнорируются
|
| 88 |
+
- Только валидные текстовые строки включаются в финальный JSON массив
|
| 89 |
+
- Формат выхода соответствует JSON типу, который мы определили во вкладке Design
|
| 90 |
|
| 91 |
+
## Типы выполнения
|
| 92 |
|
| 93 |
+
Выберите подходящий тип выполнения в зависимости от того, сколько времени требуется вашей ноде для работы:
|
| 94 |
|
| 95 |
+
| Тип | Время | Описание |
|
| 96 |
+
|------------|-------------|-----------------------|
|
| 97 |
+
| Rapid | 0-20 sec | Быстрые операции |
|
| 98 |
+
| Regular | 21-60 sec | Стандартная обработка |
|
| 99 |
+
| Deferred | 60-120 sec | Сложные операции |
|
| 100 |
+
| Protracted | 120-300 sec | Тяжелые задачи обработки |
|
| 101 |
|
| 102 |
+
Для нашей ноды **Merge text to JSON** подходит выполнение **Rapid**, поскольку мы только манипулируем текстовыми строками и нет обращений к стороннему сервису по API.
|
| 103 |
+
|
| 104 |
+
## Сохранение изменений
|
| 105 |
+
|
| 106 |
+
Всегда сохраняйте изменения в скрипте, нажимая кнопку **Save** внизу интерфейса. Любые изменения в коде следует сохранять по нажатию клавиши Save внизу интерфейса.
|
| 107 |
+
|
| 108 |
+
Вкладка Script - это ядро функциональности вашей ноды, где вы преобразуете входные данные в выходные с помощью кода JavaScript.
|
| 109 |
+
|
| 110 |
+
--- eng ---
|
| 111 |
+
|
| 112 |
+
# Script Tab in Node Settings
|
| 113 |
+
|
| 114 |
+
The **Script** tab is designed for placing JavaScript code that handles the node's programmatic logic. Here you define what exactly your node does - whether it processes text, calls APIs, transforms data, or performs calculations.
|
| 115 |
|
| 116 |
+

|
| 117 |
+
|
| 118 |
+
## Code Structure
|
| 119 |
+
|
| 120 |
+
All Piper nodes, including custom ones, follow a specific JavaScript structure:
|
| 121 |
|
| 122 |
```javascript
|
| 123 |
export async function run({ inputs }) {
|
| 124 |
const { FatalError, NextNode } = DEFINITIONS;
|
| 125 |
|
| 126 |
+
// Your code here
|
| 127 |
|
| 128 |
return NextNode.from({
|
| 129 |
outputs: {
|
| 130 |
+
// Your results
|
| 131 |
}
|
| 132 |
});
|
| 133 |
}
|
| 134 |
```
|
| 135 |
|
| 136 |
+
This structure ensures that your node can properly receive data from previous nodes and pass results to the next ones in your pipeline.
|
| 137 |
|
| 138 |
+
### Original Input Text Code
|
| 139 |
+
The basic **Input Text** node has this simple structure:
|
| 140 |
|
| 141 |
+
```javascript
|
| 142 |
+
export async function run({ inputs }) {
|
| 143 |
+
const { FatalError, NextNode } = DEFINITIONS;
|
| 144 |
|
| 145 |
+
const text = inputs.input_text;
|
| 146 |
+
|
| 147 |
+
return NextNode.from({
|
| 148 |
+
outputs: {
|
| 149 |
+
output_text: text
|
| 150 |
+
}
|
| 151 |
+
});
|
| 152 |
+
}
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
### Custom Merge Text to JSON Code
|
| 156 |
+
We need to replace this with logic that processes multiple string inputs and creates a JSON array:
|
| 157 |
+
|
| 158 |
+
```javascript
|
| 159 |
+
export async function run({ inputs }) {
|
| 160 |
+
const { FatalError, NextNode } = DEFINITIONS;
|
| 161 |
+
|
| 162 |
+
const jsonArray = [];
|
| 163 |
+
|
| 164 |
+
if (inputs.string1) {
|
| 165 |
+
jsonArray.push(inputs.string1);
|
| 166 |
+
}
|
| 167 |
+
if (inputs.string2) {
|
| 168 |
+
jsonArray.push(inputs.string2);
|
| 169 |
+
}
|
| 170 |
+
if (inputs.string3) {
|
| 171 |
+
jsonArray.push(inputs.string3);
|
| 172 |
+
}
|
| 173 |
+
if (inputs.string4) {
|
| 174 |
+
jsonArray.push(inputs.string4);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
return NextNode.from({
|
| 178 |
+
outputs: {
|
| 179 |
+
json_output: jsonArray
|
| 180 |
+
}
|
| 181 |
+
});
|
| 182 |
+
}
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
## Understanding Custom Logic
|
| 186 |
+
|
| 187 |
+
The custom script implements the following logic:
|
| 188 |
+
|
| 189 |
+
1. **Initialize empty array** - `const jsonArray = []` creates an empty array to store our text strings
|
| 190 |
+
2. **Check each input** - `if` conditions check that each input has a value before adding
|
| 191 |
+
3. **Build array** - Only non-empty inputs are added to `jsonArray` using `push()`
|
| 192 |
+
4. **Return JSON output** - The final array is returned as `json_output`, matching our configuration in the Design tab
|
| 193 |
+
|
| 194 |
+
This approach ensures that:
|
| 195 |
+
- Empty or undefined inputs are ignored
|
| 196 |
+
- Only valid text strings are included in the final JSON array
|
| 197 |
+
- The output format matches the JSON type we defined in the Design tab
|
| 198 |
+
|
| 199 |
+
## Execution Types
|
| 200 |
+
|
| 201 |
+
Choose the appropriate execution type based on how much time your node requires to work:
|
| 202 |
+
|
| 203 |
+
| Type | Time | Description |
|
| 204 |
|------------|-------------|-----------------------|
|
| 205 |
+
| Rapid | 0-20 sec | Fast operations |
|
| 206 |
+
| Regular | 21-60 sec | Standard processing |
|
| 207 |
+
| Deferred | 60-120 sec | Complex operations |
|
| 208 |
+
| Protracted | 120-300 sec | Heavy processing tasks |
|
| 209 |
|
| 210 |
+
For our **Merge text to JSON** node, **Rapid** execution is suitable since we're only manipulating text strings and there are no API calls to external services.
|
| 211 |
|
| 212 |
+
## Saving Changes
|
| 213 |
+
|
| 214 |
+
Always save changes to the script by clicking the **Save** button at the bottom of the interface. Any changes to the code should be saved by pressing the Save button at the bottom of the interface.
|
| 215 |
|
| 216 |
+
The Script tab is the core of your node's functionality, where you transform input data into output using JavaScript code.
|
docs/advanced-development/node-yaml.mdx
CHANGED
|
@@ -2,81 +2,125 @@
|
|
| 2 |
sidebar_position: 3
|
| 3 |
---
|
| 4 |
|
| 5 |
-
#
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-

|
| 10 |
|
| 11 |
+
## Что такое YAML представление?
|
| 12 |
|
| 13 |
+
Вкладка YAML служит "исходным кодом" вашей ноды. Она объединяет:
|
| 14 |
|
| 15 |
+
- Определения входных и выходных данных из вкладки Design
|
| 16 |
+
- JavaScript код из вкладки Script
|
| 17 |
+
- Технические метаданные из вкладки Catalog
|
| 18 |
+
- Переменные окружения из вкладки Environment
|
| 19 |
+
- Позиционирование ноды и связи внутри пайплайна
|
| 20 |
|
| 21 |
+
Это полное представление позволяет точно дублировать ноды, копируя их YAML конфигурацию в другие пайплайны.
|
| 22 |
|
| 23 |
+
## Структура YAML
|
| 24 |
|
| 25 |
+
YAML конфигурация организована в логические секции:
|
| 26 |
|
| 27 |
+
### Техническая информация
|
| 28 |
```yaml
|
| 29 |
+
_id: merge_text_to_json
|
| 30 |
version: 1
|
| 31 |
category:
|
| 32 |
+
_id: processing
|
| 33 |
+
title: en=Processing;ru=Обработка
|
| 34 |
+
package: custom
|
| 35 |
+
title: en=Merge text to JSON;ru=Объединение текста в JSON
|
| 36 |
+
source: node
|
| 37 |
+
execution: regular
|
| 38 |
```
|
| 39 |
|
| 40 |
+
Эти поля определяют идентификатор ноды, версию, классификацию по категориям и привязку к пакету.
|
| 41 |
|
| 42 |
+
### Скрипт выполнения
|
| 43 |
```yaml
|
| 44 |
+
script: |-
|
| 45 |
+
export async function run({ inputs }) {
|
| 46 |
+
const { NextNode } = DEFINITIONS;
|
| 47 |
+
|
| 48 |
+
const jsonArray = [];
|
| 49 |
+
|
| 50 |
+
if (inputs.string1) {
|
| 51 |
+
jsonArray.push(inputs.string1);
|
| 52 |
+
}
|
| 53 |
+
if (inputs.string2) {
|
| 54 |
+
jsonArray.push(inputs.string2);
|
| 55 |
+
}
|
| 56 |
+
if (inputs.string3) {
|
| 57 |
+
jsonArray.push(inputs.string3);
|
| 58 |
+
}
|
| 59 |
+
if (inputs.string4) {
|
| 60 |
+
jsonArray.push(inputs.string4);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return NextNode.from({
|
| 64 |
+
outputs: {
|
| 65 |
+
json_output: jsonArray
|
| 66 |
+
}
|
| 67 |
+
});
|
| 68 |
}
|
| 69 |
```
|
| 70 |
|
| 71 |
+
Содержит полный кастомный JavaScript код, который мы написали во вкладке Script.
|
| 72 |
|
| 73 |
+
### Позиционирование ноды
|
| 74 |
```yaml
|
| 75 |
arrange:
|
| 76 |
+
x: 170
|
| 77 |
+
y: 290
|
| 78 |
```
|
| 79 |
|
| 80 |
+
Определяет точное положение ноды в рабочем пространстве пайплайна.
|
| 81 |
|
| 82 |
+
### Определения входных/выходных данных
|
| 83 |
```yaml
|
| 84 |
inputs:
|
| 85 |
+
string1:
|
| 86 |
+
title: en=String 1;ru=Строка 1
|
| 87 |
+
type: string
|
| 88 |
+
required: false
|
| 89 |
+
string2:
|
| 90 |
+
title: en=String 2;ru=Строка 2
|
| 91 |
+
type: string
|
| 92 |
+
required: false
|
| 93 |
+
string3:
|
| 94 |
+
title: en=String 3;ru=Строка 3
|
| 95 |
type: string
|
| 96 |
+
required: false
|
| 97 |
+
string4:
|
| 98 |
+
title: en=String 4;ru=Строка 4
|
| 99 |
+
type: string
|
| 100 |
+
required: false
|
| 101 |
|
| 102 |
outputs:
|
| 103 |
+
json_output:
|
| 104 |
+
title: en=JSON;ru=JSON
|
| 105 |
+
type: json
|
| 106 |
```
|
| 107 |
|
| 108 |
+
Полные спецификации для всех 4 входных параметров и 1 выходного параметра, которые мы настроили во вкладке Design.
|
| 109 |
|
| 110 |
+
### Информация каталога (опционально)
|
| 111 |
+
```yaml
|
| 112 |
+
catalog:
|
| 113 |
+
_id: merge_text_to_json
|
| 114 |
+
version: 1
|
| 115 |
+
category:
|
| 116 |
+
_id: service_nodes
|
| 117 |
+
title: Service Nodes
|
| 118 |
+
package: service_nodes
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
Метаданные для публикации и организации вашей кастомной ноды в каталоге.
|
| 122 |
+
|
| 123 |
+
### Переменные окружения (опционально)
|
| 124 |
```yaml
|
| 125 |
environment:
|
| 126 |
OPEN_PAAS_USER:
|
|
|
|
| 129 |
scope: global
|
| 130 |
```
|
| 131 |
|
| 132 |
+
Все переменные окружения и API ключи, необходимые для подключения ноды к внешним провайдерам.
|
| 133 |
|
| 134 |
+
## Копирование и повторное использование нод
|
| 135 |
|
| 136 |
+
Самая мощная функция вкладки YAML - возможность создания точных дубликатов ноды:
|
| 137 |
|
| 138 |
+
1. **Скопируйте YAML** - Выделите весь код во вкладке YAML и скопируйте его
|
| 139 |
+
2. **Создайте новую ноду** - Добавьте новую ноду в любой пайплайн
|
| 140 |
+
3. **Вставьте конфигурацию** - Замените YAML новой ноды на скопированный код
|
| 141 |
+
4. **Сохраните изменения** - Нода будет воссоздана с идентичной функциональностью
|
| 142 |
|
| 143 |
+
Этот процесс сохраняет все настройки, код и конфигурацию, делая простым повторное использование любых нод в разных пайплайнах.
|
| 144 |
|
| 145 |
+
## Только для чтения
|
| 146 |
|
| 147 |
+
Вкладка YAML в основном предназначена для просмотра и копирования. Хотя вы можете видеть полную конфигурацию ноды здесь, изменения следует вносить через соответствующие вкладки (Script для изменений кода, Design для модификации входных/выходных данных и т.д.), чтобы обеспечить правильную валидацию и форматирование.
|
| 148 |
|
| 149 |
+
--- eng ---
|
| 150 |
|
| 151 |
+
# YAML Tab in Node Settings
|
| 152 |
|
| 153 |
+
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.
|
| 154 |
|
| 155 |
+

|
| 156 |
|
| 157 |
+
## What is the YAML View?
|
| 158 |
|
| 159 |
+
The YAML tab serves as the "source code" of your node. It combines:
|
| 160 |
|
| 161 |
+
- Input and output definitions from the Design tab
|
| 162 |
+
- JavaScript code from the Script tab
|
| 163 |
+
- Technical metadata from the Catalog tab
|
| 164 |
+
- Environment variables from the Environment tab
|
| 165 |
+
- Node positioning and connections within the pipeline
|
| 166 |
|
| 167 |
+
This complete representation allows you to precisely duplicate nodes by copying their YAML configuration to other pipelines.
|
| 168 |
|
| 169 |
+
## YAML Structure
|
| 170 |
|
| 171 |
+
The YAML configuration is organized into logical sections:
|
| 172 |
|
| 173 |
+
### Technical Information
|
| 174 |
```yaml
|
| 175 |
+
_id: merge_text_to_json
|
| 176 |
version: 1
|
| 177 |
category:
|
| 178 |
+
_id: processing
|
| 179 |
+
title: en=Processing;ru=Обработка
|
| 180 |
+
package: custom
|
| 181 |
+
title: en=Merge text to JSON;ru=Объединение текста в JSON
|
| 182 |
+
source: node
|
| 183 |
+
execution: regular
|
| 184 |
```
|
| 185 |
|
| 186 |
+
These fields define the node's identifier, version, category classification, and package binding.
|
| 187 |
|
| 188 |
+
### Execution Script
|
| 189 |
```yaml
|
| 190 |
+
script: |-
|
| 191 |
+
export async function run({ inputs }) {
|
| 192 |
+
const { NextNode } = DEFINITIONS;
|
| 193 |
+
|
| 194 |
+
const jsonArray = [];
|
| 195 |
+
|
| 196 |
+
if (inputs.string1) {
|
| 197 |
+
jsonArray.push(inputs.string1);
|
| 198 |
+
}
|
| 199 |
+
if (inputs.string2) {
|
| 200 |
+
jsonArray.push(inputs.string2);
|
| 201 |
+
}
|
| 202 |
+
if (inputs.string3) {
|
| 203 |
+
jsonArray.push(inputs.string3);
|
| 204 |
+
}
|
| 205 |
+
if (inputs.string4) {
|
| 206 |
+
jsonArray.push(inputs.string4);
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
return NextNode.from({
|
| 210 |
+
outputs: {
|
| 211 |
+
json_output: jsonArray
|
| 212 |
+
}
|
| 213 |
+
});
|
| 214 |
}
|
| 215 |
```
|
| 216 |
|
| 217 |
+
Contains the complete custom JavaScript code that we wrote in the Script tab.
|
| 218 |
|
| 219 |
+
### Node Positioning
|
| 220 |
```yaml
|
| 221 |
arrange:
|
| 222 |
+
x: 170
|
| 223 |
+
y: 290
|
| 224 |
```
|
| 225 |
|
| 226 |
+
Defines the exact position of the node in the pipeline workspace.
|
| 227 |
|
| 228 |
+
### Input/Output Definitions
|
| 229 |
```yaml
|
| 230 |
inputs:
|
| 231 |
+
string1:
|
| 232 |
+
title: en=String 1;ru=Строка 1
|
| 233 |
+
type: string
|
| 234 |
+
required: false
|
| 235 |
+
string2:
|
| 236 |
+
title: en=String 2;ru=Строка 2
|
| 237 |
+
type: string
|
| 238 |
+
required: false
|
| 239 |
+
string3:
|
| 240 |
+
title: en=String 3;ru=Строка 3
|
| 241 |
type: string
|
| 242 |
+
required: false
|
| 243 |
+
string4:
|
| 244 |
+
title: en=String 4;ru=Строка 4
|
| 245 |
+
type: string
|
| 246 |
+
required: false
|
| 247 |
|
| 248 |
outputs:
|
| 249 |
+
json_output:
|
| 250 |
+
title: en=JSON;ru=JSON
|
| 251 |
+
type: json
|
| 252 |
```
|
| 253 |
|
| 254 |
+
Complete specifications for all 4 input parameters and 1 output parameter that we configured in the Design tab.
|
| 255 |
|
| 256 |
+
### Catalog Information (Optional)
|
| 257 |
+
```yaml
|
| 258 |
+
catalog:
|
| 259 |
+
_id: merge_text_to_json
|
| 260 |
+
version: 1
|
| 261 |
+
category:
|
| 262 |
+
_id: service_nodes
|
| 263 |
+
title: Service Nodes
|
| 264 |
+
package: service_nodes
|
| 265 |
+
```
|
| 266 |
+
|
| 267 |
+
Metadata for publishing and organizing your custom node in the catalog.
|
| 268 |
+
|
| 269 |
+
### Environment Variables (Optional)
|
| 270 |
```yaml
|
| 271 |
environment:
|
| 272 |
OPEN_PAAS_USER:
|
|
|
|
| 275 |
scope: global
|
| 276 |
```
|
| 277 |
|
| 278 |
+
All environment variables and API keys required to connect the node to external providers.
|
| 279 |
|
| 280 |
+
## Copying and Reusing Nodes
|
| 281 |
|
| 282 |
+
The most powerful feature of the YAML tab is the ability to create exact duplicates of nodes:
|
| 283 |
|
| 284 |
+
1. **Copy YAML** - Select all code in the YAML tab and copy it
|
| 285 |
+
2. **Create New Node** - Add a new node to any pipeline
|
| 286 |
+
3. **Paste Configuration** - Replace the new node's YAML with the copied code
|
| 287 |
+
4. **Save Changes** - The node will be recreated with identical functionality
|
| 288 |
|
| 289 |
+
This process preserves all settings, code, and configuration, making it simple to reuse any nodes across different pipelines.
|
| 290 |
|
| 291 |
+
## Read-Only
|
| 292 |
|
| 293 |
+
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.
|
docs/advanced-development/pipeline-yaml.mdx
CHANGED
|
@@ -2,68 +2,65 @@
|
|
| 2 |
sidebar_position: 4
|
| 3 |
---
|
| 4 |
|
| 5 |
-
#
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
##
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
1.
|
| 14 |
-
2.
|
| 15 |
|
| 16 |
-

|
| 17 |
|
| 18 |
+
Это откроет редактор YAML, где вы можете его просматривать и изменять.
|
| 19 |
|
| 20 |
+
## Структура YAML
|
| 21 |
|
| 22 |
+
YAML пайплайна следует определенной иерархической структуре:
|
| 23 |
|
| 24 |
+
### 1. Метаданные пайплайна
|
| 25 |
```yaml
|
| 26 |
+
name: Pipeline Name
|
| 27 |
version: 1
|
| 28 |
+
description: Pipeline description
|
| 29 |
readme: {}
|
| 30 |
category:
|
| 31 |
_id: category_id
|
| 32 |
+
title: Category
|
|
|
|
| 33 |
```
|
| 34 |
|
| 35 |
+
Этот раздел содержит базовую информацию о пайплайне, включая название, описание и категоризацию.
|
| 36 |
|
| 37 |
+
### 2. Конфигурация запуска
|
| 38 |
```yaml
|
| 39 |
start:
|
| 40 |
nodes:
|
| 41 |
- first_node_id
|
| 42 |
```
|
| 43 |
|
| 44 |
+
Определяет, какая нода служит стартовой точкой для выполнения пайплайна.
|
| 45 |
|
| 46 |
+
### 3. Входы и выходы
|
| 47 |
```yaml
|
| 48 |
inputs:
|
| 49 |
+
string1:
|
| 50 |
+
title: String 1
|
|
|
|
| 51 |
type: string
|
| 52 |
+
# Параметры входных данных
|
|
|
|
| 53 |
|
| 54 |
outputs:
|
| 55 |
+
json_output:
|
| 56 |
+
title: JSON
|
| 57 |
+
type: json
|
| 58 |
+
# Параметры выходных данных
|
| 59 |
```
|
| 60 |
|
| 61 |
+
Здесь определены все входы и выходы для всех нод, размещённые на рабочем пространстве пайплайны.
|
| 62 |
|
| 63 |
+
### 4. Потоки (соединения нод)
|
| 64 |
```yaml
|
| 65 |
flows:
|
| 66 |
connection_name:
|
|
|
|
| 70 |
input: input_parameter
|
| 71 |
```
|
| 72 |
|
| 73 |
+
Этот раздел описывает, как данные передаются между нодами, связывая выходы одной ноды с входами другой.
|
| 74 |
|
| 75 |
+
### 5. Конфигурация нод
|
| 76 |
```yaml
|
| 77 |
nodes:
|
| 78 |
node_id:
|
|
|
|
| 81 |
source: node|catalog
|
| 82 |
execution: rapid|regular|deferred|protracted
|
| 83 |
script: |
|
| 84 |
+
// JavaScript код
|
| 85 |
inputs:
|
| 86 |
+
# Определения входов ноды
|
| 87 |
outputs:
|
| 88 |
+
# Определения выходов ноды
|
| 89 |
+
arrange:
|
| 90 |
+
# Расположение ноды
|
| 91 |
```
|
| 92 |
|
| 93 |
+
Каждая нода в пайплайне полностью описана со всеми параметрами и кодом.
|
| 94 |
|
| 95 |
+
## Редактирование и сохранение
|
| 96 |
|
| 97 |
+
При внесении изменений в YAML пайплайна:
|
| 98 |
|
| 99 |
+
1. **Внесите свои изменения** в редакторе YAML
|
| 100 |
+
2. **Нажмите Save** внизу интерфейса
|
| 101 |
+
3. **Проверьте индикатор состояния** - зеленый индикатор "Saved" появится справа, если нет ошибок
|
| 102 |
|
| 103 |
+

|
| 104 |
|
| 105 |
+
Любые синтаксические ошибки или проблемы конфигурации будут выделены, предотвращая операцию сохранения до их устранения.
|
| 106 |
|
| 107 |
+
## Возврат в рабочее пространство пайплайна
|
| 108 |
|
| 109 |
+
Чтобы вернуться в визуальное рабочее пространство пайплайна:
|
| 110 |
|
| 111 |
+
- Нажмите синюю кнопку **Pipeline** слева в интерфейсе
|
| 112 |
|
| 113 |
+
Это переключит вас обратно в графический редактор пайплайна.
|
| 114 |
|
| 115 |
+
--- eng ---
|
| 116 |
|
| 117 |
+
# Pipeline YAML
|
| 118 |
|
| 119 |
+
**Pipeline YAML** provides a comprehensive overview of your entire pipeline configuration in YAML format. This includes all nodes with their positioning, executable code, relationships, and various technical information that defines how the pipeline operates.
|
| 120 |
|
| 121 |
+
## Accessing Pipeline YAML
|
| 122 |
|
| 123 |
+
To access the pipeline YAML configuration:
|
| 124 |
|
| 125 |
+
1. Click the **More** button in the pipeline interface
|
| 126 |
+
2. Select **YAML** from the dropdown menu
|
| 127 |
|
| 128 |
+

|
| 129 |
|
| 130 |
+
This opens the YAML editor where you can view and modify it.
|
| 131 |
|
| 132 |
+
## YAML Structure
|
| 133 |
|
| 134 |
+
The pipeline YAML follows a specific hierarchical structure:
|
| 135 |
|
| 136 |
+
### 1. Pipeline Metadata
|
| 137 |
```yaml
|
| 138 |
+
name: Pipeline Name
|
| 139 |
version: 1
|
| 140 |
+
description: Pipeline description
|
| 141 |
readme: {}
|
| 142 |
category:
|
| 143 |
_id: category_id
|
| 144 |
+
title: Category
|
|
|
|
| 145 |
```
|
| 146 |
|
| 147 |
+
This section contains basic information about the pipeline, including name, description, and categorization.
|
| 148 |
|
| 149 |
+
### 2. Start Configuration
|
| 150 |
```yaml
|
| 151 |
start:
|
| 152 |
nodes:
|
| 153 |
- first_node_id
|
| 154 |
```
|
| 155 |
|
| 156 |
+
Defines which node serves as the starting point for pipeline execution.
|
| 157 |
|
| 158 |
+
### 3. Inputs and Outputs
|
| 159 |
```yaml
|
| 160 |
inputs:
|
| 161 |
+
string1:
|
| 162 |
+
title: String 1
|
|
|
|
| 163 |
type: string
|
| 164 |
+
# Input parameters
|
|
|
|
| 165 |
|
| 166 |
outputs:
|
| 167 |
+
json_output:
|
| 168 |
+
title: JSON
|
| 169 |
+
type: json
|
| 170 |
+
# Output parameters
|
| 171 |
```
|
| 172 |
|
| 173 |
+
Here all inputs and outputs for all nodes placed in the pipeline workspace are defined.
|
| 174 |
|
| 175 |
+
### 4. Flows (Node Connections)
|
| 176 |
```yaml
|
| 177 |
flows:
|
| 178 |
connection_name:
|
|
|
|
| 182 |
input: input_parameter
|
| 183 |
```
|
| 184 |
|
| 185 |
+
This section describes how data flows between nodes, connecting outputs of one node to inputs of another.
|
| 186 |
|
| 187 |
+
### 5. Node Configuration
|
| 188 |
```yaml
|
| 189 |
nodes:
|
| 190 |
node_id:
|
|
|
|
| 193 |
source: node|catalog
|
| 194 |
execution: rapid|regular|deferred|protracted
|
| 195 |
script: |
|
| 196 |
+
// JavaScript code
|
| 197 |
inputs:
|
| 198 |
+
# Node input definitions
|
| 199 |
outputs:
|
| 200 |
+
# Node output definitions
|
| 201 |
+
arrange:
|
| 202 |
+
# Node positioning
|
| 203 |
```
|
| 204 |
|
| 205 |
+
Each node in the pipeline is fully described with all its parameters and code.
|
| 206 |
|
| 207 |
+
## Editing and Saving
|
| 208 |
|
| 209 |
+
When making changes to the pipeline YAML:
|
| 210 |
|
| 211 |
+
1. **Make your changes** in the YAML editor
|
| 212 |
+
2. **Click Save** at the bottom of the interface
|
| 213 |
+
3. **Check the status indicator** - a green "Saved" indicator will appear on the right if there are no errors
|
| 214 |
|
| 215 |
+

|
| 216 |
|
| 217 |
+
Any syntax errors or configuration issues will be highlighted, preventing the save operation until they are resolved.
|
| 218 |
|
| 219 |
+
## Returning to Pipeline Workspace
|
| 220 |
|
| 221 |
+
To return to the visual pipeline workspace:
|
| 222 |
|
| 223 |
+
- Click the blue **Pipeline** button on the left in the interface
|
| 224 |
|
| 225 |
+
This will switch you back to the graphical pipeline editor.
|
docs/img/{create-node-3.webp → create-node-1.png}
RENAMED
|
File without changes
|
docs/img/{Node-YAML.jpg → create-node-2.png}
RENAMED
|
File without changes
|
docs/img/{create-node-1.webp → create-node-3.png}
RENAMED
|
File without changes
|
docs/img/{create-node-2.webp → create-node-4.png}
RENAMED
|
File without changes
|
docs/img/create-node-4.webp
DELETED
Git LFS Details
|
docs/img/create-node-5.png
ADDED
|
Git LFS Details
|
docs/img/create-node-6.png
ADDED
|
Git LFS Details
|
docs/img/create-node-7.png
ADDED
|
Git LFS Details
|
docs/img/create-node-8.png
ADDED
|
Git LFS Details
|
docs/img/node-yaml.png
ADDED
|
Git LFS Details
|