Example Node

Example Node

Overview

This node, named "Example Node," is a simple transformation node designed to modify incoming data by adding or updating a JSON property called myString on each input item. It takes an input string from the user via the node's properties and assigns this string to the myString field of every input item's JSON data.

Common scenarios where this node would be beneficial include:

  • Adding a constant or user-defined string value to all items passing through a workflow.
  • Tagging or labeling data items with a specific identifier or note.
  • Preparing data for downstream nodes that require a specific string field.

For example, if you want to add a status label like "processed" to each item in your workflow, you can set the property to "processed", and the node will append this to every item under myString.

Properties

Name Meaning
Properties Display Name A string value to assign to the myString field of each input item's JSON data. This value is user-defined and can be any text.

Output

The output of the node is an array of items where each item's JSON data includes a new or updated field:

{
  "myString": "<value provided in Properties Display Name>"
}

No binary data is produced or handled by this node.

Dependencies

  • No external services or API keys are required.
  • The node relies solely on the n8n workflow environment and its standard methods for accessing input data and parameters.

Troubleshooting

  • Empty or missing input: If the node receives no input items, it will simply return an empty array without modification.
  • Invalid property value: Since the property is a free-text string, invalid values are unlikely; however, ensure the input is a valid string.
  • Error handling: If an error occurs during processing an item, and the node is configured to continue on failure, the error details will be attached to the output item. Otherwise, the node will throw an error indicating which item caused the failure.

Links and References

Discussion