Example Node

Basic Example Node

Overview

The "Example Node" is a basic custom n8n node designed to process input data by adding or updating a field called myString in each item's JSON. The value of myString is taken from the node's input property. This node is useful for simple data transformation tasks, such as injecting static or dynamic string values into your workflow items.

Common scenarios:

  • Adding a user-defined string to every item in a workflow.
  • Tagging or annotating data with a specific label before passing it to subsequent nodes.
  • Testing and demonstration purposes for learning how custom nodes work in n8n.

Practical example:
If you want to add a note or identifier (e.g., "Processed by Example Node") to each item in your data stream, you can use this node to insert that string.

Properties

Name Type Meaning
My String String The description text. Value to be added to each item's myString field.

Output

Each output item will have its json object updated with a new property:

{
  "myString": "<value provided in 'My String' property>"
}
  • If the input item already had other fields, they are preserved; only myString is added or overwritten.
  • If an error occurs and "Continue On Fail" is enabled, the output may include an error field describing the issue.

Dependencies

  • No external services or API keys required.
  • No special n8n configuration or environment variables needed.

Troubleshooting

Common issues:

  • Missing or empty 'My String' value: If not set, the myString field will be empty in the output.
  • Error handling: If an error occurs during processing and "Continue On Fail" is not enabled, the workflow will stop, and an error message will be shown.
  • Error messages:
    • NodeOperationError: Indicates a problem occurred while processing an item. Check the input data and ensure the 'My String' property is correctly configured.

How to resolve:

  • Ensure the 'My String' property is filled in as intended.
  • Enable "Continue On Fail" if you want the workflow to proceed even when some items fail.

Links and References

Discussion