构建工作流

Work with nodes

Nodes1 are the key building blocks of a workflow2. They perform a range of actions, including:

  • Starting the workflow.
  • Fetching and sending data.
  • Processing and manipulating data.

n8n provides a collection of built-in nodes, as well as the ability to create your own nodes. Refer to:

Add a node to your workflow

Add a node to an empty workflow

  1. Select Add first step. n8n opens the nodes panel, where you can search or browse trigger nodes3.
  2. Select the trigger you want to use.

Choose the correct app eventIf you select On App Event, n8n shows a list of all the supported services. Use this list to browse n8n's integrations and trigger a workflow in response to an event in your chosen service. Not all integrations have triggers. To see which ones you can use as a trigger, select the node. If a trigger is available, you'll see it at the top of the available operations list.For example, this is the trigger for Asana:

Screenshot of the Asana node operations list, showing the Recommended section at the top of the list

Add a node to an existing workflow

Select the Add node

Add node icon

connector. n8n opens the nodes panel, where you can search or browse all nodes.

When you add a node to a workflow, n8n displays a list of available operations. An operation is something a node does, such as getting or sending data.

There are two types of operation:

  • Triggers start a workflow in response to specific events or conditions in your services. When you select a Trigger, n8n adds a trigger node to your workflow, with the Trigger operation you chose pre-selected. When you search for a node in n8n, Trigger operations have a bolt icon
Trigger icon

.

  • Actions are operations that represent specific tasks within a workflow, which you can use to manipulate data, perform operations on external systems, and trigger events in other systems as part of your workflows. When you select an Action, n8n adds a node to your workflow, with the Action operation you chose pre-selected.

Node controls

To view node controls, hover over the node on the canvas:

  • Execute step
Execute step icon

: Run the node.

  • Deactivate
Deactivate node icon

: Deactivate the node.

  • Delete
Delete node icon

: Delete the node.

  • Node context menu
Node context menu icon

: Select node actions. Available actions:

  • Open node
  • Execute step
  • Rename node
  • Deactivate node
  • Pin node
  • Copy node
  • Duplicate node
  • Tidy up workflow
  • Convert node to sub-workflow
  • Select all
  • Clear selection
  • Delete node

Node settings

The node settings under the Settings tab allow you to control node behaviors and add node notes.

When active or set, they do the following:

  • Always Output Data: The node returns an empty item even if the node returns no data during execution. Be careful setting this on IF nodes, as it could cause an infinite loop.
  • Execute Once: The node executes once, with data from the first item it receives. It doesn't process any extra items.
  • Retry On Fail: When an execution fails, the node reruns until it succeeds.
  • On Error:
  • Stop Workflow: Halts the entire workflow when an error occurs, preventing further node execution.
  • Continue: Proceeds to the next node despite the error, using the last valid data.
  • Continue (using error output): Continues workflow execution, passing error information to the next node for potential handling.
  • Custom Span Attributes: Add custom key-value attributes to a node's OpenTelemetry span. Keys are plain text, and values support expressions. This setting only appears if you enable OpenTelemetry tracing and have an Enterprise license. Refer to Custom span attributes for details.

You can document your workflow using node notes:

  • Notes: Note to save with the node.
  • Display note in flow: If active, n8n displays the note in the workflow as a subtitle.

Footnotes

  1. In n8n, nodes are individual components that you compose to create workflows. Nodes define when the workflow should run, allow you to fetch, send, and process data, can define flow control logic, and connect with external services.

    Back
  2. An n8n workflow is a collection of nodes that automate a process. Workflows begin execution when a trigger condition occurs and execute sequentially to achieve complex tasks.

    Back
  3. A trigger node is a special node responsible for executing the workflow in response to certain conditions. All production workflows need at least one trigger to determine when the workflow should run.

    Back

官方原文和授权

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

来源、授权与修改

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

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