MsgParser icon

MsgParser

Convert binary msg file to json object

Overview

The node named "MsgParser" is designed to convert binary .msg files (commonly Microsoft Outlook email message files) into JSON objects. It reads the binary content of the input file, parses it using a specialized library, and outputs the extracted data as structured JSON. This node is useful in workflows where email message contents need to be analyzed, processed, or integrated with other systems without manual extraction.

Practical examples:

  • Extracting email metadata and body from .msg files stored in a binary field for further processing.
  • Automating email archival by converting .msg files into JSON format for database storage.
  • Integrating email content into CRM or ticketing systems by parsing .msg attachments.

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 content of the .msg file as a JSON object. The original binary data is removed after parsing (binary property is set to undefined). The JSON structure includes all extracted fields from the .msg file such as sender, recipients, subject, body, attachments metadata, and other email properties as provided by the underlying parser library.

No binary output is produced by this node.

Dependencies

  • Uses the external library @kenjiuno/msgreader to parse .msg files.
  • Requires the input data to contain a binary field with the .msg file content.
  • No explicit API keys or external services are required.
  • Must be run in an environment where the @kenjiuno/msgreader package is available.

Troubleshooting

  • Common issues:
    • If the specified input binary field does not exist or is empty, the node will output an empty JSON object for that item.
    • Corrupted or unsupported .msg files may cause parsing errors.
  • Error messages:
    • Parsing errors will throw exceptions unless "Continue On Fail" is enabled, in which case the error details are added to the output item.
    • Errors include context about the item index to help identify problematic inputs.
  • Resolution tips:
    • Verify the input binary field name matches the actual field containing the .msg file.
    • Ensure the .msg files are valid and not corrupted.
    • Enable "Continue On Fail" to allow partial processing when some items fail.

Links and References

Discussion