Email parsing for n8n

n8n Email Parser: Parse Email Body and Extract Data to Excel, CSV, and JSON

A reliable way to parse email body data in your n8n workflows without hand-coding regex

If you parse email in n8n today, you trigger on the IMAP Email node and then carve the body apart with a Code node, a Set node, or a label snippet that breaks when a sender changes their layout. MailParse reads the fields you name from the body and HTML tables, returns Excel, CSV, and JSON, and drops straight into n8n through a webhook or HTTP Request node.

No Code node regex
Excel, CSV & JSON output
Reads body & HTML tables
Webhook & HTTP Request friendly

Last updated August 2026

Convert your email files
No install

Connect a mailbox to pull .eml/.msg in bulk, or paste a raw email to test the converter now.

or paste an email to test
Output format
Columns to extract
Extract your own custom fields
Popular:

Create a free account to download. No credit card required.

Quick answer

n8n has no dedicated email parser node. Its IMAP and Gmail nodes fetch a message and hand you the raw body, so pulling out an order number or a table row means writing and maintaining regex in a Code node. MailParse does the parsing step instead, returning named fields as JSON your n8n workflow consumes over HTTP or webhook, so a layout change does not quietly break the flow.

No regex
Name fields, skip the Code node
Excel / CSV / JSON
Spreadsheet & API output
HTML tables
Parses layout the body trips on
Attachments
Listed by filename, type, and size

n8n is a strong automation platform, and it can pull data out of an email. The usual recipe starts with the Email Trigger (IMAP) node, which fires when a new message arrives and hands you the subject, sender, plain text and HTML body, and any attachments as binary data. From there you parse the body yourself: a Code node running JavaScript and regular expressions, an Edit Fields (Set) node, or one of the community email parser templates that match labels in the text and return the values that follow. If you would rather use AI, the Information Extractor node can read unstructured text, though it needs an LLM credential and an API key to run. For a short, plain text email that always arrives in the same shape, any of these works.

The trouble starts when the email is not that tidy. Regular expressions in a Code node are landmark based: they look for a label or a colon and grab what comes next, so when a vendor renames a heading, reorders a line, or adds a logo, the workflow quietly grabs the wrong value or throws an error in the middle of a run. HTML emails with real tables are worse, because the body comes through as markup that your expressions have to untangle row by row. Attachments add another layer: n8n gives you the file as binary, but reading the values in a PDF or CSV means wiring up more nodes or an extra service. MailParse takes that parsing work off your plate. You connect a mailbox or forward a message, name the fields you want such as invoice_number, order_total, or tracking_number, and it reads them from the body and from HTML tables, then returns a clean Excel workbook, a CSV, or JSON you can pull into n8n with a Webhook or HTTP Request node. For the node-by-node build, see the walkthrough on how to parse emails in n8n, and if you are weighing platforms, the same job in Microsoft's stack is covered under Power Automate parse email body. This page is an honest look at where MailParse is the simpler path and where staying inside n8n still makes sense.

What the converter does

Everything you need to turn a pile of email files into a spreadsheet your team can actually use.

Name fields instead of writing regex

Skip the Code node and the brittle pattern matching. Describe the values you want once and MailParse extracts them, so a heading change in a sender email does not send you back into the workflow editor at 2am.

Reads HTML tables the body buries

Order confirmations and reports arrive as HTML tables that a Code node has to parse cell by cell. MailParse reads HTML emails with tables and repeating rows, so line items come through as clean spreadsheet rows.

Lists every attachment by filename

n8n hands you an attachment as binary data. MailParse records each one by filename, type, and size. When a value is locked in a PDF or CSV, extract the file with a document tool first, then parse the result with your named fields.

Holds up when senders change formatting

Regex relies on fixed landmarks and breaks when a vendor reorders a line or adds a banner. MailParse reads the fields you name across senders that format the same data differently, so one setup covers many layouts.

JSON that drops into your workflow

Take JSON from the MailParse API or a webhook and pull it into n8n with a Webhook node or HTTP Request node, then route it to a database, a Google Sheet, a CRM, or any of the 400+ n8n integrations you already use.

Excel and CSV for the people downstream

Not everything needs to stay in the workflow. Download a formatted .xlsx or CSV for a spreadsheet, an accounting import, or a teammate who just wants the numbers, without building an export branch in n8n.

How to parse an email body without the Code node

Four steps to replace the IMAP trigger and regex chain with named fields.

1

Connect or forward

Connect the Gmail, Outlook, Microsoft 365, or IMAP inbox your emails arrive in, or forward a sample message to a dedicated MailParse parsing address.

2

Name your fields

List the values your Code node currently carves out with regex as fields. Describe what you want instead of writing match patterns.

3

Pick a format

Choose Excel, CSV, or JSON. Point the JSON at a Webhook or HTTP Request node in n8n so the rest of your workflow keeps running exactly as it does today.

4

Run and reuse

Parse a backlog in one pass and let new mail flow in automatically. Adjust fields anytime from a form, with no regex to re-debug when a sender changes their layout.

Who moves email parsing out of the Code node

n8n builders whose emails have tables, attachments, or layouts the regex cannot keep up with.

Automation builders & agencies

Keep your n8n workflows orchestrating the process, but hand the fragile email parsing to a service that reads named fields instead of a regex chain you have to babysit for every client.

Accounting & AP teams

Pull totals, dates, and invoice numbers from the email body and HTML tables, then export to Excel for a QuickBooks or Xero import or push JSON into your workflow. When a figure is locked in a PDF, extract the file with a document tool first, then parse the result.

Ecommerce & operations

Parse HTML order and shipping confirmations with line item tables into clean rows, the kind of layout a Code node has to walk cell by cell.

Developers & SaaS teams

Replace a Code node full of patterns with JSON from an API and webhooks that holds up when message formats drift over time.

MailParse vs parsing email in n8n

No regex to write

n8n parsing leans on a Code node with JavaScript and regular expressions, a Set node, or a label snippet. MailParse asks you to name the fields you want and extracts them for you.

Reads HTML tables, lists attachments

A Code node parses HTML tables row by row, and reading a PDF or CSV attachment needs extra nodes. MailParse parses HTML tables directly and lists each attachment by filename, type, and size.

Stable when formats change

Landmark-based regex breaks when a sender reorders a line or adds a logo. MailParse reads named fields across varied layouts, so one setup covers many senders.

Plugs into your workflow

MailParse exports Excel and CSV for sheets and JSON through webhooks, which you pull into n8n with a Webhook or HTTP Request node and route anywhere your workflow already goes.

Ways to parse email in n8n, compared

An n8n builder has four honest ways to turn an incoming message into structured fields, and the right one depends on how messy the email is and how much code you want to own. Here is how they line up on the choices that actually matter, with credit to each native path where it wins. To route the result as JSON, see the email parser API; for the wider field, the best email parser guide.

What matters MailParse Code node (JavaScript + regex) Edit Fields / Set node AI Information Extractor node
What it does Reads the fields you name from the body and HTML tables, then returns Excel, CSV, or JSON You write JavaScript and regular expressions to carve values out of the body text You map values with expressions when the body arrives in a fixed, predictable shape An LLM reads the unstructured text and returns the fields you describe
Setup and skills Name the fields on a form, no code JavaScript and regex skills, plus ongoing maintenance Expression syntax and a body that does not move around An LLM credential and API key, plus a schema you define
Reads body fields Name a value like order_total or tracking_number and get each back as a field Anything you can match with a pattern, until the pattern breaks Works when the label and value sit in a fixed position Strong on free text the model can interpret
Attachments Lists each attachment by filename, type, and size No, n8n hands you binary data, so you add more nodes or a service No, the Set node does not read inside files Text only, you extract the file contents first before the model sees them
HTML tables in the body Parses HTML tables and repeating rows into clean spreadsheet rows You walk the markup row by row in code Not practical for real tables Can interpret a table, with variable accuracy and token cost
Holds up when senders change format Reads named fields across varied layouts, so one setup covers many senders Landmark regex breaks when a heading or line order changes Breaks when the value moves to a new position More tolerant of wording changes than regex
Output and destinations Excel, CSV, or JSON through a Webhook or HTTP Request node Whatever you build downstream from the parsed values Fields you pass to the next node JSON the model returns, into your workflow
Best for Tables and layouts that drift, on any inbox Developers who want full control and will maintain the code Short, fixed plain text emails that never change shape Free text extraction when you already run an LLM credential

n8n node capabilities reflect the platform as of June 2026 and vary by version and the community nodes you install. The AI Information Extractor node requires an LLM credential and API key. No pricing is implied here.

Frequently asked questions

How do I parse an email body in n8n?

In n8n you trigger on the Email Trigger (IMAP) node, which gives you the subject, sender, text and HTML body, and attachments, then parse the body with a Code node running JavaScript and regex, an Edit Fields (Set) node, or a community email parser template that matches labels in the text. It works for short, consistent plain text emails but gets fragile with tables, attachments, or changing layouts. MailParse does the same job by letting you name the fields you want and returning JSON you pull back into n8n with a webhook.

Does n8n have an email parser node?

n8n does not ship a single dedicated email parser node. It gives you the Email Trigger (IMAP) node to receive mail and then expects you to extract the values yourself with a Code node, a Set node, or the AI Information Extractor node, which needs an LLM credential. Community templates fill the gap with label-based parsing. MailParse is a purpose-built email parser: name the fields, get clean Excel, CSV, or JSON, and feed it into n8n.

How do I extract data from an email in n8n?

You receive the message with the Email Trigger (IMAP) node, then extract data in a following node: regular expressions in a Code node, expressions in a Set node, or the Information Extractor node for AI extraction. The catch is the pattern work and how easily it breaks when a sender changes formatting. MailParse extracts the fields you name from the body and HTML tables, and returns structured data you can route through n8n.

How do I get the email body in n8n?

The Email Trigger (IMAP) node returns the message body in two forms, a plain text field and an HTML field, alongside the subject, sender, and any attachments as binary data. You then reference that body in a later node to parse it. Getting the body is the easy part; reliably pulling the right values out of it is where a Code node and regex get brittle, which is the job MailParse handles for you.

Can n8n parse email attachments?

n8n gives you an attachment as binary data through the IMAP trigger, but reading a PDF or CSV is not built in. You add more nodes or an external service to pull out the contents. MailParse records each attachment by filename, type, and size, and reads the fields you name from the body and HTML tables. When a value is locked in a PDF, extract the file with a document tool first, then parse the result.

How do I parse an HTML table from an email in n8n?

Parsing an HTML table in n8n is the hard case, because the body arrives as markup and a Code node has to walk the table row by row to rebuild the structure. People use HTML extraction nodes, custom JavaScript, or regex, which are slow and brittle. MailParse reads HTML tables and repeating rows directly, so each line item becomes a clean spreadsheet row without that workaround.

Can n8n parse an .eml or MIME file?

n8n has no native node for parsing a raw .eml or MIME file into subject, body, and attachments; it is a long-standing community feature request, so people fall back to Code nodes or external libraries. MailParse reads .eml and .msg files directly, pulls the fields you name out of them, and gives you Excel, CSV, or JSON you can bring back into n8n.

Is there a simpler alternative to a Code node for parsing emails in n8n?

Yes. If the regex and breakage are the problem, a dedicated email parser is simpler: you name the fields you want and it reads them from the body and HTML tables without writing or maintaining patterns. MailParse exports to Excel, CSV, and JSON and still plugs into n8n through a Webhook or HTTP Request node, so your workflow keeps orchestrating everything around the parse.

Parse your email body without the Code node

Connect a mailbox or paste an email and see the fields you name, including data from HTML tables, land in clean JSON your n8n workflow can use in seconds.