Overview
This node provides various operations to work with YAML data, including converting JSON data to YAML format. Specifically, the "JSON to YAML" operation takes JSON input from a specified field and converts it into YAML format, outputting the result in another specified field. This is useful when you need to transform structured JSON data into human-readable YAML for configuration files, documentation, or integration with systems that require YAML input.
Practical examples:
- Converting API response JSON data into YAML to be used in configuration management tools.
- Transforming JSON payloads into YAML format for easier editing or version control.
- Preparing data for systems or workflows that accept YAML but not JSON.
Properties
| Name | Meaning |
|---|---|
| Input Json Field | The name of the property in the input data that contains the JSON data to convert. |
| Destination Output Field | The name of the property where the converted YAML data will be stored in the output item. |
Output
The node outputs items where each item's JSON data includes a property (named as per the "Destination Output Field") containing the YAML representation of the original JSON data. The output does not include binary data; all transformed data is provided as JSON properties.
Example output structure snippet:
{
"json": {
"<destinationKey>": "yaml formatted string here"
}
}
Dependencies
- The node relies on internal helper modules for the conversion logic (
jsonToYaml.operation), which likely use a YAML processing library internally. - No explicit external API keys or services are required.
- No special environment variables or n8n configurations are needed beyond standard node setup.
Troubleshooting
- Invalid JSON input: If the input field does not contain valid JSON data, the conversion will fail. Ensure the input property specified actually holds well-formed JSON.
- Incorrect property names: Using wrong property names for input or output fields will cause the node to not find the data or not store the result correctly. Double-check the property names.
- Large or complex JSON objects: Very large or deeply nested JSON might cause performance issues or errors during conversion.
- Error messages: Errors related to parsing or conversion typically indicate malformed input or unsupported data types. Validate input data before running the node.
Links and References
- YAML Official Site
- JSON to YAML Conversion Concepts
- n8n Documentation on Custom Nodes and Data Transformation (available on n8n.io)