Skip to content

n8n 公共 REST API(n8n public REST API)#

功能可用性

在免费试用期间,n8n API 无法使用。请升级以访问此功能。

使用 n8n 的公共 API,你可以通过编程执行许多与在 GUI 中相同的任务。本节将介绍 n8n 的 REST API,包括:

🌐 Using n8n's public API, you can programmatically perform many of the same tasks as you can in the GUI. This section introduces n8n's REST API, including:

n8n 提供了一个 n8n API 节点 来在你的工作流程中访问 API。

🌐 n8n provides an n8n API node to access the API in your workflows.

选择你的互动方式(Choose your interaction method)#

REST API(本节)(REST API (This section))#

使用 HTTP 请求直接与 n8n 交互。适用于:

🌐 Interact with n8n directly using HTTP requests. Ideal for:

  • 自定义集成和应用
  • 与语言无关的 HTTP 调用
  • 在工作流中直接使用 REST API

使用 n8n CLI 来获得命令行体验。它封装了公共 API 并针对以下方面进行了优化:

🌐 Use n8n CLI for a command-line experience. It wraps the public API and is optimized for:

  • 命令行自动化与脚本编写
  • CI/CD 流水线集成
  • AI 代理整合(Claude Code、Cursor 等)
  • 偏好使用命令行工具的开发者

了解 REST API(Learn about REST APIs)#

API 文档假设你已经熟悉 REST API。如果你不熟悉,以下资源可能会有帮助:

🌐 The API documentation assumes you are familiar with REST APIs. If you're not, these resources may be helpful:

使用 API 演示环境

游乐场中尝试使用 API 可以帮助你了解 API 的工作原理。如果你担心修改实时数据,可以考虑设置一个测试工作流程,或一个测试 n8n 实例,以安全地进行探索。