Example Node

Basic Example Node

Overview

This node, named "Example Node," is a basic transformation node designed to process input data items by adding or updating a string property on each item. It takes an input string from the user and assigns it to a field called myString in the JSON data of each incoming item. This node is useful for scenarios where you want to annotate or tag data items with a custom string value, such as labeling records, adding metadata, or preparing data for further processing.

Practical examples:

  • Adding a status label or category to each data item before sending it to another system.
  • Injecting a user-defined note or comment into each record.
  • Tagging data items with environment-specific information (e.g., "test", "production").

Properties

Name Meaning
My String A user-defined string value that will be added to each item's JSON under the key myString. The user can enter any text here.

Output

The node outputs the same number of items as it receives, with each item's JSON data augmented by a new or updated property:

{
  "myString": "user provided string"
}

No binary data output is produced by this node.

Dependencies

  • No external services or API keys are required.
  • The node relies solely on the input data and the user-provided string parameter.
  • No special n8n configurations or environment variables are needed.

Troubleshooting

  • Common issues:

    • If the input data is empty or not structured as expected, the node will still run but simply add the string to whatever JSON exists.
    • Errors during execution may occur if the input data is malformed or if there is an unexpected runtime issue.
  • Error messages:

    • The node throws errors wrapped as operation errors with context about the item index if something goes wrong during processing.
    • If "Continue On Fail" is enabled, the node will append error details to the output instead of stopping execution.
  • Resolution:

    • Ensure input data is valid JSON objects.
    • Use "Continue On Fail" option to handle errors gracefully when processing multiple items.

Links and References

Discussion