Example Node

Basic Example Node

Overview

This node, named "Example Node," is a basic transformation node designed to add or overwrite a string property in each input item’s JSON data. It takes an input string from the user and sets this string as the value of the myString field on every incoming data item.

Common scenarios for this node include:

  • Adding a constant or user-defined string value to all items passing through a workflow.
  • Overwriting or initializing a specific field with a fixed string for further processing or routing.
  • Simple testing or demonstration purposes where a static string needs to be injected into data.

For example, if you want to tag all incoming data items with a label or note, you can use this node to set that label uniformly.

Properties

Name Meaning
My String The string value to assign to the myString field in each item's JSON data. This value will be set for every input item processed by the node.

Output

The output consists of the same number of items as the input. Each output item contains the original JSON data with an added or updated property:

{
  "myString": "<value provided in 'My String' property>"
}

No binary data is produced by this node.

Dependencies

  • No external services or API keys are required.
  • The node operates purely on the input data it receives within the n8n workflow environment.

Troubleshooting

  • Error when setting the string: If the node throws an error during execution, it may be due to invalid input data structure or unexpected data types. Ensure that the input items have valid JSON objects.
  • Continue On Fail behavior: If enabled, the node will continue processing subsequent items even if one fails, appending error information to the output. Otherwise, it will stop execution on the first error.
  • Empty string handling: Providing an empty string as the "My String" property will overwrite the existing myString field with an empty value.

Links and References

Discussion