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 with a consistent string value, for example, adding a label, category, or note to all items passing through a workflow.

Practical examples:

  • Adding a status label like "processed" or "pending" to each item.
  • Tagging data with a source identifier or batch name.
  • Injecting a constant string value needed for downstream processing or filtering.

Properties

Name Meaning
My String The description text; any string value to set on each item's myString field.

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 overwritten property called myString, whose value is the string provided by the user in the node's input property.

Output structure example (simplified):

{
  "json": {
    "myString": "User provided string",
    "...": "original properties"
  }
}

No binary data is produced by this node.

Dependencies

  • No external services or API keys are required.
  • This node only depends on the n8n core framework.

Troubleshooting

  • Common issues:

    • If the input data is empty or not structured as expected, the node will still run but output items will only have the myString property set.
    • Errors during execution typically relate to invalid input data or internal errors.
  • Error messages:

    • If an error occurs on a specific item, and the node is configured to continue on failure, the error details will be attached to that item’s output.
    • Otherwise, the node throws an error indicating which item caused the failure.

Links and References

Discussion