Overview
The node parses binary .msg files (Microsoft Outlook email message files) and converts their contents into JSON objects. It extracts the main message data and any attachments embedded within the .msg file, converting attachments to base64 strings for easy handling downstream.
This node is useful when you need to process or analyze email messages stored as .msg files in workflows, such as extracting email metadata, body content, or attachments for further automation, archiving, or integration with other systems.
Example use cases:
- Extracting email content and attachments from
.msgfiles uploaded to a system. - Automating processing of emails saved as
.msgfiles for CRM or ticketing systems. - Converting
.msgfiles to JSON format for easier manipulation or storage.
Properties
| Name | Meaning |
|---|---|
| Input Binary Field | The name of the input binary field containing the .msg file to be extracted (default: "data"). |
Output
The node outputs an array of items where each item's json property contains the parsed .msg file data as a JSON object. This includes:
- All standard fields extracted from the
.msgfile (e.g., subject, sender, recipients, body). - An
attachmentDataarray if attachments exist, where each element has:name: The attachment's filename.base64: The attachment content encoded as a base64 string.
If no binary data is found on the specified input field, the output JSON will be empty.
Binary data from the input is removed after parsing (binary property is deleted), so the output only contains JSON data.
Dependencies
- Uses the external library
@kenjiuno/msgreaderto parse.msgfiles. - Requires the input binary data to be accessible via n8n's binary data helpers.
- No additional API keys or external services are needed.
Troubleshooting
- Common issues:
- Specifying an incorrect input binary field name will cause the node to fail because it cannot find the
.msgfile data. - Providing non-
.msgbinary files will likely result in parsing errors.
- Specifying an incorrect input binary field name will cause the node to fail because it cannot find the
- Error messages:
- Parsing errors from the underlying
.msgparser may occur if the file is corrupted or not a valid.msgfile. - If
continueOnFailis disabled, the node will throw an error and stop execution on the first failure. - Enabling
continueOnFailallows the workflow to continue, returning error details alongside successful results.
- Parsing errors from the underlying
Links and References
@kenjiuno/msgreaderGitHub repository – Library used for parsing.msgfiles.- Microsoft Outlook MSG File Format – Official documentation on
.msgfile structure.