For the complete documentation index, see llms.txt. This page is also available as Markdown.

Node UI elements

n8n provides a set of predefined UI components (based on a JSON file) that allows users to input all sorts of data types. The following UI elements are available in n8n.

String

Basic configuration:

{
	displayName: Name, // The value the user sees in the UI
	name: name, // The name used to reference the element UI within the code
	type: string,
	required: true, // Whether the field is required or not
	default: 'n8n',
	description: 'The name of the user',
	displayOptions: { // the resources and operations to display this element with
		show: {
			resource: [
				// comma-separated list of resource names
			],
			operation: [
				// comma-separated list of operation names
			]
		}
	},
}
String

String field for inputting passwords:

Password

String field with more than one row:

Multiple rows

Support drag and drop for data keys

Users can drag and drop data values to map them to fields. Dragging and dropping creates an expression to load the data value. n8n supports this automatically.

You need to add an extra configuration option to support dragging and dropping data keys:

  • requiresDataPath: 'single': for fields that require a single string.

  • requiresDataPath: 'multiple': for fields that can accept a comma-separated list of string.

The Compare Datasets node code has examples.

Number

Number field with decimal points:

Decimal

Collection

Use the collection type when you need to display optional fields.

Collection

DateTime

The dateTime type provides a date picker.

DateTime

Boolean

The boolean type adds a toggle for entering true or false.

Boolean

Color

The color type provides a color selector.

Color

Options

The options type adds an options list. Users can select a single value.

Options

Multi-options

The multiOptions type adds an options list. Users can select more than one value.

Multi-options

Filter

Use this component to evaluate, match, or filter incoming data.

This is the code from n8n's own If node. It shows a filter component working with a collection component where users can configure the filter's behavior.

Filter

Assignment collection (drag and drop)

Use the drag and drop component when you want users to pre-fill name and value parameters with a single drag interaction.

You can see an example in n8n's Edit Fields (Set) node:

A gif showing the drag and drop action, as well as changing a field to fixed

Fixed collection

Use the fixedCollection type to group fields that are semantically related.

Fixed collection

Resource locator

Resource locator

The resource locator element helps users find a specific resource in an external service, such as a card or label in Trello.

The following options are available:

  • ID

  • URL

  • List: allows users to select or search from a prepopulated list. This option requires more coding, as you must populate the list, and handle searching if you choose to support it.

You can choose which types to include.

Example:

Refer to the following for live examples:

Resource mapper

If your node performs insert, update, or upsert operations, you need to send data from the node in a format supported by the service you're integrating with. A common pattern is to use a Set node before the node that sends data, to convert the data to match the schema of the service you're connecting to. The resource mapper UI component provides a way to get data into the required format directly within the node, rather than using a Set node. The resource mapper component can also validate input data against the schema provided in the node, and cast input data into the expected type.

Mapping and matching

Mapping is the process of setting the input data to use as values when updating row(s). Matching is the process of using column names to identify the row(s) to update.

Refer to the Postgres node (version 2) for a live example using a database schema.

Refer to the Google Sheets node (version 2) for a live example using a schema-less service.

Resource mapper type options interface

The typeOptions section must implement the following interface:

Resource mapper method

This method contains your node-specific logic for fetching the data schema. Every node must implement its own logic for fetching the schema, and setting up each UI field according to the schema.

It must return a value that implements the ResourceMapperFields interface:

Refer to the Postgres resource mapping method and Google Sheets resource mapping method for live examples.

JSON

JSON

HTML

The HTML editor allows users to create HTML templates in their workflows. The editor supports standard HTML, CSS in <style> tags, and expressions wrapped in {{}}. Users can add <script> tags to pull in additional JavaScript. n8n doesn't run this JavaScript during workflow execution.

Refer to Html.node.ts for a live example.

Notice

Display a yellow box with a hint or extra info. Refer to Node UI design for guidance on writing good hints and info text.

Notice

Hints

There are two types of hints: parameter hints and node hints:

  • Parameter hints are small lines of text below a user input field.

  • Node hints are a more powerful and flexible option than Notice. Use them to display longer hints, in the input panel, output panel, or node details view.

Add a parameter hint

Add the hint parameter to a UI element:

Add a node hint

Define the node's hints in the hints property within the node description:

Add a dynamic hint to a programmatic-style node

In programmatic-style nodes you can create a dynamic message that includes information from the node execution. As it relies on the node output data, you can't display this type of hint until after execution.

For a live example of a dynamic hint in a programmatic-style node, view the Split Out node code.

Last updated

Was this helpful?