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. This node is useful when you want to annotate or tag your data items with a consistent string value or inject a static piece of information into each item for further processing.

Practical examples:

  • Adding a fixed label or category name to all incoming records.
  • Injecting a constant comment or note into each data item before sending it downstream.
  • Setting a placeholder or default string value for subsequent nodes that require it.

Properties

Name Meaning
My String The description text. This is the string value that will be assigned to the myString field of each input item. Users can enter any text here.

Output

The output consists of the same array of items received as input, but each item's JSON data will have a new or updated property called myString set to the value provided by the user.

  • json: Each item’s JSON object includes a myString field containing the user-defined string.
  • No binary data is produced or modified by this node.

Dependencies

  • No external services or API keys are required.
  • This node operates purely on the input data within n8n workflows.

Troubleshooting

  • Error handling: If an error occurs while setting the myString property on an item, the node either continues processing remaining items (if configured to continue on fail) or throws an error indicating which item caused the failure.
  • Common issues:
    • Providing an invalid type for the My String property (e.g., non-string) might cause unexpected behavior, though the node expects a string input.
    • If no input data is provided, the node will simply return an empty output array.
  • To resolve errors, ensure the input data is valid and the My String property is correctly set as a string.

Links and References

Discussion