构建工作流

Code in n8n

n8n is a low-code tool. This means you can do a lot without code, then add code when needed.

Code in your workflows

There are two places in your workflows where you can use code:

  • Expressions

Use expressions1 to transform data in your nodes. You can use JavaScript in expressions, as well as n8n's Built-in methods and variables.

→ Expressions

  • Code node

Use the Code node to add JavaScript or Python to your workflow.

→ Code node

Other technical resources

These are features that are relevant to technical users.

Technical nodes

n8n provides core nodes, which simplify adding key functionality such as API requests, webhooks, scheduling, and file handling.

  • Write a backend

The HTTP Request, Webhook, and Code nodes help you make API calls, respond to webhooks, and write any JavaScript in your workflow.

Use this do things like Create an API endpoint.

→ Core nodes

  • Represent complex logic

You can build complex flows, using nodes like If, Switch, and Merge nodes.

→ Flow logic

Other developer resources

  • The n8n API

n8n provides an API, where you can programmatically perform many of the same tasks as you can in the GUI. There's an n8n API node to access the API in your workflows.

→ API

  • Self-host

You can self-host n8n. This keeps your data on your own infrastructure.

→ Hosting

  • Build your own nodes

You can build custom nodes, install them on your n8n instance, and publish them to npm.

→ Creating nodes

Footnotes

  1. In n8n, expressions allow you to populate node parameters dynamically by executing JavaScript code. Instead of providing a static value, you can use the n8n expression syntax to define the value using data from previous nodes, other workflows, or your n8n environment.

    Back

官方原文和授权

本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。

来源、授权与修改

本站保留许可证、固定提交号、社区作者和修改说明,不代表 n8n 对本站背书。

查看许可证查看来源和修改说明