YAML icon

YAML

Convert data to YAML or from YAML

Overview

This node provides functionality to convert data between YAML and JSON formats, as well as other YAML-related operations. Specifically, the "YAML to JSON" operation converts YAML-formatted text into JSON objects. This is useful when you receive or work with data in YAML format but need to process it in JSON form within your workflow.

Common scenarios include:

  • Parsing configuration files or API responses provided in YAML.
  • Integrating systems that output YAML but require JSON for further processing.
  • Automating data transformation pipelines where YAML input must be converted to JSON for compatibility.

For example, if you have a YAML string representing user settings, this node can convert it into JSON so subsequent nodes can easily access and manipulate the data.

Properties

Name Meaning
Input Yaml Field The name of the property in the input items that contains the YAML data to convert to JSON.
If your YAML is inside a binary file, use the 'Extract YAML from File' node to convert it to text first A notice informing users that if their YAML data is stored in a binary file, they should first extract it as text before using this operation.

Output

The node outputs JSON data converted from the input YAML string. The output is structured as standard JSON objects accessible via the json field of each output item.

If the input YAML represents complex nested structures, these will be reflected accordingly in the JSON output.

No binary data output is produced by this operation.

Dependencies

  • No external services or API keys are required.
  • The node relies on internal parsing libraries bundled within the node's implementation to perform YAML to JSON conversion.
  • No special environment variables or n8n configurations are necessary.

Troubleshooting

  • Empty or invalid YAML input: If the specified input property does not contain valid YAML text, the node may throw a parsing error or produce empty output. Ensure the input field contains correctly formatted YAML.
  • Incorrect input property name: If the "Input Yaml Field" property does not match the actual property name containing YAML in the incoming data, the node will not find any data to convert. Double-check the property name.
  • Binary data input: If the YAML data is inside a binary file, this operation cannot parse it directly. Use a preceding node to extract the YAML text from the binary file first.
  • Parsing errors: Common error messages relate to malformed YAML syntax. Validate your YAML content with an external tool if needed.

Links and References

Discussion