Skip to content

节点基础文件(Node base file)#

节点基础文件包含节点的核心代码。所有节点都必须有一个基础文件。该文件的内容因你构建的是声明式节点还是编程式节点而异。关于选择哪种构建方式的指导,请参阅 选择你的节点构建方法

🌐 The node base file contains the core code of your node. All nodes must have a base file. The contents of this file are different depending on whether you're building a declarative-style or programmatic-style node. For guidance on which style to use, refer to Choose your node building approach.

这些文档提供了简短的代码片段,帮助理解代码结构和概念。有关构建节点的完整演练,包括实际代码示例,请参阅 构建声明式节点构建编程式节点

🌐 These documents give short code snippets to help understand the code structure and concepts. For full walk-throughs of building a node, including real-world code examples, refer to Build a declarative-style node or Build a programmatic-style node.

你还可以探索 n8n-nodes-starter 和 n8n 自身的 节点 以获取更多示例。Starter 包含可以在其基础上开发的基本示例。n8n 的 Mattermost 节点 是一个更复杂的编程风格节点的好例子,包括版本控制。

🌐 You can also explore the n8n-nodes-starter and n8n's own nodes for a wider range of examples. The starter contains basic examples that you can build on. The n8n Mattermost node is a good example of a more complex programmatic-style node, including versioning.

要使用所有节点,请参阅:

🌐 For all nodes, refer to the:

有关声明式节点,请参阅:

🌐 For declarative-style nodes, refer to the:

对于程序化风格的节点,请参阅:

🌐 For programmatic-style nodes, refer to the: