Master data extraction using a custom n8n node. This n8n workflow template uses RegEx in a Function node to parse unstructured email bodies into clean JSON objects, ideal for automation.
Download this n8n workflow template and start using it instantly.
Automation specialists needing to extract structured data from inconsistent text formats.
n8n developers looking for advanced RegEx and Function n8n node examples.
Users building robust intake systems that process emails or text files where key-value pairs are separated by newlines.
Anyone needing highly reliable n8n templates for data preprocessing.
This powerful n8n workflow addresses the common challenge of dealing with unstructured text data, such as standard inquiry emails or form submissions, where keys and values are listed but not cleanly separated. By leveraging the flexibility of the n8n Function node and targeted Regular Expressions, this n8n template automatically identifies and extracts specific fields (like Name, Email, Subject) based on a defined list of labels.
This process transforms messy text into standardized, usable JSON outputs, making subsequent steps in your n8n workflow — such as updating a CRM or Google Sheet — reliable and straightforward. This sophisticated n8n node configuration is a must-have tool for data cleanup, providing a repeatable structure for complex text extraction within any large-scale n8n automation.
On clicking 'execute' n8n trigger. In a production environment, you would swap this for a real n8n trigger (like a Gmail n8n node or Webhook n8n node) that provides the email body text.Set values n8n node simulates an incoming dataset. It defines the raw text to be parsed (body) and provides a comma-separated list of the fields (or labels) the script must look for (Name,Email,Subject,Message).Email Parser Snippet n8n node (a Function node). This n8n node contains the custom JavaScript logic and RegEx.labels. For each label, it constructs a RegEx pattern to find the label, followed by a colon or space, and then captures the subsequent value. The logic is specifically designed to handle the last label in the list differently, allowing it to capture multi-line text (like a full message body) until the end of the input, making this n8n workflow highly versatile.Email Parser Snippet n8n node to understand how the RegEx handles different fields. Modify the Set values n8n node to test the extraction with your specific text format.On clicking 'execute' n8n trigger with your desired input n8n trigger (e.g., Gmail, IMAP, or a Webhook) to run the n8n workflow live. Ensure the input data from the real n8n trigger sets the body and labels variables correctly for the Function n8n node. On clicking 'execute' (n8n trigger):
Function: Acts as a manual start n8n trigger for testing and development of the n8n workflow.
Key Configuration: Standard manual n8n trigger setup.
Set values (n8n node):
Function: This essential n8n node provides the initial test data. It defines the unstructured input text in the body field and explicitly defines the list of required fields to search for in the labels field.
Key Configuration: body contains the raw simulated email input; labels contains the comma-separated keys ("Name,Email,Subject,Message").
Email Parser Snippet (Function n8n node):
Function: The core processing n8n node. It contains custom JavaScript that iterates through the defined labels and uses sophisticated RegEx patterns to match and extract data from the input body. This n8n node intelligently determines where each field's value ends, ensuring clean extraction, even for multi-line messages.
Key Configuration*: Custom JavaScript logic for RegEx parsing.
Automate DMARC report processing using this robust n8n workflow. It monitors a dedicated mailbox, parses zipped XML reports, stores data in MySQL, and triggers immediate alerts via Slack or email upon detecting DKIM or SPF failures. This n8n template ensures continuous email security monitoring.

Use this powerful n8n workflow to automatically parse CV PDFs from Gmail using OCR and OpenAI GPT, organizing candidate data directly into Notion. Explore useful n8n templates for HR automation.

Use this powerful n8n workflow to automatically parse order confirmation emails using AI agents, extract structured data, and sync real-time status updates to your Notion database.

Use this powerful n8n workflow to convert unread or starred Gmail messages into structured Todoist tasks. Leverage AI to summarize content, propose actions, and draft replies automatically.

Use this powerful n8n workflow to automatically monitor Outlook for invoices, classify attachments using Google Gemini AI, extract critical data, and append structured output to Microsoft Excel 365.









































