Overview
This node processes YAML data in various ways, with the "Extract From YAML" operation specifically designed to transform YAML content from a binary input file into structured JSON output. It is useful when you have YAML files (e.g., configuration files, data exports) and want to parse their contents for further automation or processing within n8n workflows.
Common scenarios include:
- Reading YAML configuration files uploaded as binary data and extracting their content for conditional logic.
- Parsing YAML-formatted API responses stored as files.
- Converting YAML documents into JSON objects for integration with other systems that require JSON.
For example, you might upload a YAML file containing user settings, extract its data, and then use it to configure subsequent workflow steps dynamically.
Properties
| Name | Meaning |
|---|---|
| Input Binary Field | The name of the input binary field containing the YAML file data to be processed. Example: data. |
| Destination Output Field | The name of the output field where the extracted JSON data will be stored after parsing the YAML. Example: data. |
| Options | Collection of additional options: - File Encoding: Specifies the encoding of the input file. Defaults to utf8. Supports many encodings such as ascii, base64, utf16, windows1252, etc.- Strip BOM: Whether to remove the Byte Order Mark from the file (only applicable for certain encodings like utf8). Default is true.- Keep Source: Determines what parts of the original input item to keep in the output: • JSON — keep only JSON data • Binary — keep only binary data • Both — keep both JSON and binary data |
Output
The node outputs items where the parsed YAML content is available in the specified destination output field as JSON data. This means the YAML structure is converted into native JSON objects/arrays suitable for further processing in the workflow.
If the "Keep Source" option is set, the output can also retain the original input's JSON and/or binary data alongside the extracted YAML content.
No binary output is produced by this operation itself; it purely converts binary YAML input into JSON output.
Dependencies
- Requires the input YAML data to be provided as a binary file in the specified input binary field.
- Supports multiple text encodings for reading the YAML file, so correct encoding selection is important.
- No external API keys or services are required.
- The node depends on internal YAML parsing libraries bundled with the node implementation.
Troubleshooting
- Incorrect encoding errors or garbled output: Ensure the file encoding matches the actual encoding of the YAML file. Mismatched encoding can cause parsing failures or incorrect data extraction.
- Empty or missing output data: Verify that the input binary field contains valid YAML content and that the field name is correctly specified.
- Parsing errors due to invalid YAML syntax: The node expects well-formed YAML. Invalid YAML files will cause parsing errors. Validate your YAML before using the node.
- BOM-related issues: If the YAML file includes a Byte Order Mark and causes problems, try toggling the "Strip BOM" option.
- Output does not contain expected fields: Check the "Destination Output Field" property to ensure you are looking at the correct output key.