Parse email body message
Who we are
We are Aprende n8n, the first n8n Spanish course for all n8n lovers. If you want to learn more, you can find out more at Aprende n8n.
Task goal
This task allows extracting data from any email body with a NoCode snippet.
An small explanation
You receive an email when a user submits a form from your website.
All those emails usually have the same structure as the next one:
Name: Miquel
Email: miquel@aprenden8n.com
Subject: Welcome aboard
Message: Hi Miquel!
Thank you for your signup!
This task allows to parse any email body and assign all values to the defined labels, getting an output like this:
{
"Name": "Miquel",
"Email": "miquel@aprenden8n.com",
"Subject": "Welcome aboard",
"Message" "Hi Miquel! Thank you for your signup!"
}
After importing it
When you import the import, you get the next task in your n8n:
We recommend importing this workflow into your current task and adapting it. You define a couple of variables in the "Set values" SET:
- body: the email body you want to parse. You can add this as an expression from previous variables.
- labels: the keywords you want to detect and parse. Labels are case insensitive.
We define the next values:
Body
Name: Miquel
Email: miquel@aprenden8n.com
Subject: Welcome aboard
Message: Hi Miquel!
Thank you for your signup!
Labels
Name,Email,Subject,Message
A screenshot of the Set output is the next one
If we check the "Function item" Node, we get the next content after executing the task:
Capabilities
The task has the next features:
- You can detect as many labels as you want.
- Label detection is case insensitive.
- You can use the snippet as an independent workflow to call it generically, adding the Function item to the workflow and passing body and labels as paremeters.
Limitations
This task has limitations:
- The parser only accepts the multiline values at the end of the email.
Help and comments
If you have any doubt about this snippet, please, contact us at miquel@aprenden8n.com.
You can contact us at Aprende n8n or in the Spanish n8n community
Parse Email Body Message Workflow
This n8n workflow provides a foundational structure for processing and transforming incoming data, particularly useful for scenarios where you need to manipulate text content, such as email bodies. It uses core n8n nodes to demonstrate data transformation capabilities.
What it does
This workflow is designed to:
- Initiate Workflow: Starts the workflow execution.
- Edit Fields (Set): Allows for setting or modifying fields within the incoming data. This node is typically used to define or adjust the structure of the data that will be processed.
- Function Item: Executes custom JavaScript code to perform more complex data manipulation or logic. This node is highly flexible and can be used to parse, reformat, or extract specific information from the data received from the previous node.
Prerequisites/Requirements
- n8n Instance: An active n8n instance (cloud or self-hosted) to import and run the workflow.
Setup/Usage
- Import the workflow: Download the provided JSON file and import it into your n8n instance.
- Configure the "Edit Fields (Set)" node:
- Open the "Edit Fields (Set)" node.
- Define the fields you want to set or modify. For example, if you are expecting an email body, you might set a field named
emailBodywith a placeholder value or an expression to capture actual incoming data.
- Configure the "Function Item" node:
- Open the "Function Item" node.
- Write your custom JavaScript code to process the data. This is where you would implement the logic to parse an email body, extract specific information (like links, names, or keywords), or reformat the text.
- Example: If the "Edit Fields (Set)" node outputs an item with a
textproperty, your function could accessitem.json.textand return a modified version or extracted data.
- Connect to a Trigger (Optional but Recommended): For a real-world scenario, you would typically connect the "Start" node to a trigger node (e.g., a Webhook, Email Trigger, or IMAP node) to receive actual data.
- Activate the Workflow: Once configured, activate the workflow to start processing data.
Related Templates
Automated YouTube video uploads with 12h interval scheduling in JST
This workflow automates a batch upload of multiple videos to YouTube, spacing each upload 12 hours apart in Japan Standard Time (UTC+9) and automatically adding them to a playlist. ⚙️ Workflow Logic Manual Trigger — Starts the workflow manually. List Video Files — Uses a shell command to find all .mp4 files under the specified directory (/opt/downloads/单词卡/A1-A2). Sort and Generate Items — Sorts videos by day number (dayXX) extracted from filenames and assigns a sequential order value. Calculate Publish Schedule (+12h Interval) — Computes the next rounded JST hour plus a configurable buffer (default 30 min). Staggers each video’s scheduled time by order × 12 hours. Converts JST back to UTC for YouTube’s publishAt field. Split in Batches (1 per video) — Iterates over each video item. Read Video File — Loads the corresponding video from disk. Upload to YouTube (Scheduled) — Uploads the video privately with the computed publishAtUtc. Add to Playlist — Adds the newly uploaded video to the target playlist. 🕒 Highlights Timezone-safe: Pure UTC ↔ JST conversion avoids double-offset errors. Sequential scheduling: Ensures each upload is 12 hours apart to prevent clustering. Customizable: Change SPANHOURS, BUFFERMIN, or directory paths easily. Retry-ready: Each upload and playlist step has retry logic to handle transient errors. 💡 Typical Use Cases Multi-part educational video series (e.g., A1–A2 English learning). Regular content release cadence without manual scheduling. Automated YouTube publishing pipelines for pre-produced content. --- Author: Zane Category: Automation / YouTube / Scheduler Timezone: JST (UTC+09:00)
Monitor bank transactions with multi-channel alerts for accounting teams
Enhance financial oversight with this automated n8n workflow. Triggered every 5 minutes, it fetches real-time bank transactions via an API, enriches and transforms the data, and applies smart logic to detect critical, high, and medium priority alerts based on error conditions, amounts, or risk scores. It sends multi-channel notifications via email and Slack, logs all data to Google Sheets, and generates summary statistics for comprehensive tracking. 💰🚨 Key Features Real-time monitoring every 5 minutes for instant alerts. Smart prioritization (Critical, High, Medium) based on risk and errors. Multi-channel notifications via email and Slack. Detailed logging and summary reports in Google Sheets. How It Works Schedule Trigger: Runs every 5 minutes. Fetch Transactions: HTTP request retrieves real-time transaction data. API Error?: If condition for error logic is met, sends error alert. Enrich & Transform Data: Advanced risk calculation enhances data. Critical Alert?: If condition (50% or risk > 8) is met, raises alert. High Priority?: If condition (5% or risk > 7) is met, raises alert. Medium Priority?: If condition is met, raises alert. Log Priority to Sheet: Google Sheets appends critical, high, or medium priority data. Send Critical Email: HTML email to execute sheets append. Send High Priority Email: Email to finance team. Send High Priority Slack: Slack notification to finance team. Send Medium Priority Email: Email to finance team. Merge All Alerts: Combines all alerts for comprehensive tracking. Generate Summary Stats: Code block for analytics. Log Summary to Sheet: Summary statistics storage. Setup Instructions Import the workflow into n8n and configure the bank API credentials in "Fetch Transactions." Set up Google Sheets OAuth2 and replace the sheet ID for logging nodes. Configure Gmail API Key and Slack Bot Token for alerts. Test the workflow with sample transaction data exceeding risk or amount thresholds. Adjust priority conditions (e.g., 50%, 5%, risk > 8) based on your risk policy. Prerequisites Bank API access with real-time transaction data (e.g., https://api.bank.com) Google Sheets OAuth2 credentials Gmail API Key for email alerts Slack Bot Token (with chat:write permissions) Structured transaction data format Google Sheet Structure: Create a sheet with columns: Transaction ID Amount Date Risk Score Priority (Critical/High/Medium) Alert Sent Summary Stats Updated At Modification Options Adjust the "Schedule Trigger" interval (e.g., every 10 minutes). Modify "Critical Alert?" and "High Priority?" conditions for custom thresholds. Customize email and Slack templates with branded messaging. Integrate with fraud detection tools for enhanced risk analysis. Enhance "Generate Summary Stats" with additional metrics (e.g., average risk). Discover more workflows – Get in touch with us
Detect holiday conflicts & suggest meeting reschedules with Google Calendar and Slack
Who’s it for Remote and distributed teams that schedule across time zones and want to avoid meetings landing on public holidays—PMs, CS/AM teams, and ops leads who own cross-regional calendars. What it does / How it works The workflow checks next week’s Google Calendar events, compares event dates against public holidays for selected country codes, and produces a single Slack digest with any conflicts plus suggested alternative dates. Core steps: Workflow Configuration (Set) → Fetch Public Holidays (via a public holiday API such as Calendarific/Nager.Date) → Get Next Week Calendar Events (Google Calendar) → Detect Holiday Conflicts (compare dates) → Generate Reschedule Suggestions (find nearest business day that isn’t a holiday/weekend) → Format Slack Digest → Post Slack Digest. How to set up Open Workflow Configuration (Set) and edit: countryCodes, calendarId, slackChannel, nextWeekStart, nextWeekEnd. Connect your own Google Calendar and Slack credentials in n8n (no hardcoded keys). (Optional) Adjust the Trigger to run daily or only on Mondays. Requirements n8n (Cloud or self-hosted) Google Calendar read access to the target calendar Slack app with permission to post to the chosen channel A public-holiday API (no secrets needed for Nager.Date; Calendarific requires an API key) How to customize the workflow Time window: Change nextWeekStart/End to scan a different period. Holiday sources: Add or swap APIs; merge multiple regions. Suggestion logic: Tweak the look-ahead window or rules (e.g., skip Fridays). Output: Post per-calendar messages, DM owners, or create tentative reschedule events automatically.