> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/create-nodes/build-your-node/reference/base-files/structure.md).

# Structure

The node base file follows this basic structure:

1. Add import statements.
2. Create a class for the node.
3. Within the node class, create a `description` object, which defines the node.

A programmatic-style node also has an `execute()` method, which reads incoming data and parameters, then builds a request. The declarative style handles this using the `routing` key in the `properties` object, within `descriptions`.

## Outline structure for a declarative-style node <a href="#outline-structure-for-a-declarative-style-node" id="outline-structure-for-a-declarative-style-node"></a>

This code snippet gives an outline of the node structure.

```js
import { INodeType, INodeTypeDescription } from 'n8n-workflow';

export class ExampleNode implements INodeType {
	description: INodeTypeDescription = {
		// Basic node details here
		properties: [
			// Resources and operations here
		]
	};
}
```

Refer to [Standard parameters](/connect/create-nodes/build-your-node/reference/base-files/standard-parameters.md) for information on parameters available to all node types. Refer to [Declarative-style parameters](/connect/create-nodes/build-your-node/reference/base-files/declarative-style-parameters.md) for the parameters available for declarative-style nodes.

## Outline structure for a programmatic-style node <a href="#outline-structure-for-a-programmatic-style-node" id="outline-structure-for-a-programmatic-style-node"></a>

This code snippet gives an outline of the node structure.

```js
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';

export class ExampleNode implements INodeType {
	description: INodeTypeDescription = {
    // Basic node details here
    properties: [
      // Resources and operations here
    ]
  };

  async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
    // Process data and return
  }
};
```

Refer to [Standard parameters](/connect/create-nodes/build-your-node/reference/base-files/standard-parameters.md) for information on parameters available to all node types. Refer to [Programmatic-style parameters](/connect/create-nodes/build-your-node/reference/base-files/programmatic-style-parameters.md) and [Programmatic-style execute method](/connect/create-nodes/build-your-node/reference/base-files/programmatic-style-execute-method.md) for more information on working with programmatic-style nodes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.n8n.io/connect/create-nodes/build-your-node/reference/base-files/structure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
