Decode icon

Decode

Basic Example Node

Overview

The "Decode" node is a basic example custom node for n8n. Its primary function is to take an input string provided by the user and attach it to each incoming item under the field myString in the output JSON. This node is useful in scenarios where you want to inject or overwrite a specific string value into your workflow data, such as tagging items, adding metadata, or preparing data for downstream nodes.

Practical Example:
If you have a list of items and want to add a note or label (e.g., "Processed by Decode Node") to each item before sending them to another service, this node can be used to insert that string.

Properties

Name Type Meaning
My String String The description text. This is the string value that will be added to each item's output under the key myString.

Output

Each output item will contain a json object with a new or updated property:

{
  "myString": "<value provided in 'My String'>"
}
  • If there are other fields in the input item, they are preserved.
  • If an error occurs and "Continue On Fail" is enabled, the output may also include an error field describing the issue and a pairedItem index.

Dependencies

  • No external services or API keys are required.
  • No special n8n configuration or environment variables are needed.

Troubleshooting

  • Common Issues:

    • If the "My String" property is left empty, the output field myString will be an empty string.
    • If an unexpected error occurs during processing and "Continue On Fail" is not enabled, the node will throw an error and stop execution.
  • Error Messages:

    • Errors are wrapped in a standard n8n NodeOperationError. If "Continue On Fail" is enabled, errors are attached to the output item under the error field.
    • To resolve most issues, ensure that the "My String" property is set correctly and that input data is valid.

Links and References

Discussion