노드 기본 파일의 구조
노드 기본 파일은 다음과 같은 기본 구조를 따릅니다:
- import 문 추가.
- 노드에 대한 클래스를 생성합니다.
- 노드 클래스 내에서 노드를 정의하는
description
객체를 생성합니다.
프로그래밍 스타일의 노드는 execute()
메서드도 있으며, 이 메서드는 들어오는 데이터와 매개변수를 읽고, 요청을 작성합니다. 선언적 스타일은 descriptions
내의 properties
객체에서 routing
키를 사용하여 이를 처리합니다.
선언적 스타일 노드에 대한 개요 구조
이 코드 조각은 노드 구조의 개요를 제공합니다.
| import { INodeType, INodeTypeDescription } from 'n8n-workflow';
export class ExampleNode implements INodeType {
description: INodeTypeDescription = {
// 기본 노드 세부 정보
properties: [
// 리소스 및 작업
]
};
}
|
모든 노드 유형에서 사용할 수 있는 매개변수에 대한 정보는 Standard parameters를 참조하십시오. 선언적 스타일 노드에서 사용할 수 있는 매개변수에 대한 정보는 Declarative-style parameters를 참조하십시오.
프로그래밍 스타일 노드에 대한 개요 구조
이 코드 조각은 노드 구조의 개요를 제공합니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | import { IExecuteFunctions } from 'n8n-core';
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
export class ExampleNode implements INodeType {
description: INodeTypeDescription = {
// 기본 노드 세부 정보
properties: [
// 리소스 및 작업
]
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// 데이터 처리 및 반환
}
};
|
모든 노드 유형에서 사용할 수 있는 매개변수에 대한 정보는 Standard parameters를 참조하십시오. 프로그래밍 스타일 노드 작업에 대한 자세한 내용은 Programmatic-style parameters 및 Programmatic-style execute method를 참조하십시오.