Example Node

Basic Example Node

Overview

This node, named "Example Node," is a basic transform node designed to add or overwrite a string property in each input item’s JSON data. It takes an input array of items and for each item, it sets the myString field in the JSON to the value provided by the user through the node's parameter.

Common scenarios where this node is useful include:

  • Adding a constant or user-defined string value to every item passing through a workflow.
  • Overwriting or injecting metadata or tags into existing data items.
  • Simple data transformation tasks where a fixed string needs to be appended or set.

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

Properties

Name Meaning
My String The string value to set on each item's myString field. This is a free text input where you can enter any string.

Output

The output is an array of items where each item’s JSON object includes a new or updated property called myString. Its value corresponds to the string entered in the node’s input property.

Example output JSON structure for one item:

{
  "myString": "User provided string value",
  // ... other original properties remain unchanged
}

No binary data is produced by this node.

Dependencies

  • No external services or API keys are required.
  • The node depends on the n8n core framework and uses standard node methods such as getInputData() and getNodeParameter().

Troubleshooting

  • Empty or missing myString value: If the input property is left empty, the node will set the myString field to an empty string, which might not be intended. Ensure you provide a meaningful string.
  • Errors during execution: If an error occurs while 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 stopping the workflow.
  • Incorrect input data format: The node expects input items to have a JSON structure. Supplying non-JSON or malformed data may cause errors.

Links and References

Discussion