Build Your First Automated Email Alert Workflow in n8n Step by Step
You already check a dashboard or inbox every morning just to see whether something important changed. You know that routine does not scale. This guide gives you a working n8n workflow that watches a real data source and sends you an email alert only when a condition you define is met. You will build the automation step by step, learn what each node does and why the order matters, and finish with a repeatable template you can adapt to other alerts. By the end, the manual check is gone. The notification comes to you.
What an Automated Email Alert Workflow Solves and When to Use It
An automated email alert workflow replaces manual checking. Instead of refreshing a website, API, database, or dashboard every hour, you set a schedule and a condition. When that condition matches, n8n sends an email to you or your team. The real value is consistency. A machine checks on the same interval, evaluates the same condition, and never forgets.
This pattern suits monitoring and notification problems. Common examples: watching stock levels in an inventory system, detecting new form submissions that need follow-up, checking whether a server is returning errors, tracking weather thresholds for outdoor operations, or pulling new content from an API such as job listings or news items. The logic is always the same—look for a change or a threshold crossing, then send one email with the relevant details.
The workflow fits best when two conditions hold. First, the trigger condition is simple, expressible as a comparison or filter like “stock is below 10” or “status code is not 200.” Second, the action is always the same email notification, even if the recipient or subject line varies slightly based on the data. When both hold, an email alert workflow is usually the right tool.
There are clear cases where this pattern is not the right choice. Complex branching logic—sending different emails to different teams based on multiple nested conditions—or a required human approval step before the email goes out means you should consider a different design. Multi-step approvals, conditional routing with many paths, or actions that call different systems depending on the data belong in a larger workflow with explicit decision nodes. Forcing that complexity into a simple alert workflow makes it harder to maintain and debug.
A practical example clarifies the boundary. You monitor a product inventory API and want an email when any product stock falls below 5 units. Simple comparison, single email action. This fits the pattern well. Now suppose you want to send a low-stock email to the purchasing team only if the supplier is in Europe, otherwise create a ticket in a project management tool, and also notify a manager only when the total value of low-stock items exceeds €1,000. That is not an email alert workflow. It is a broader automation with multiple conditions and actions, and it should be built as such.
Start with the simple version. Build the monitoring and email notification first, confirm it works reliably, then extend it only if the new requirements remain close to the core pattern.
What You Need Before Starting Your First Workflow
Before you open the n8n editor, gather a few essentials. This prevents the common pattern of building half a workflow, then stopping to hunt for credentials or a test API. You need four things: an n8n workspace, an email service you can send through, a public API endpoint that returns JSON, and a place to keep sample data.
1. Access to an n8n workspace. You can use n8n Cloud, which gives you a hosted instance with a free tier suitable for testing, or run n8n yourself. A self-hosted instance can run locally with Docker (docker run -it --rm --name n8n -p 5678:5678 n8nio/n8n) or on a small virtual private server. The editor looks and behaves the same either way. If you self-host, make sure port 5678 is reachable from your browser and that you have set up at least one user account so the instance is not open to the public internet.
2. An email service with SMTP credentials or a pre-built email node. n8n includes dedicated nodes for Gmail, Outlook, and a generic SMTP node. For a first workflow, the Gmail node is the fastest if you already use Gmail: you authenticate once through Google’s OAuth screen and n8n stores the connection. If you prefer SMTP, you need four values: host, port, username, and password. For Gmail SMTP, use smtp.gmail.com, port 465 with SSL enabled, or port 587 with STARTTLS. If your account uses two-factor authentication, generate an app password rather than using your normal login password. The SMTP node also requires a “From” address that matches the account you authenticate with.
3. A free public API endpoint that returns JSON. Choose one that does not require an API key for your first workflow, so you can focus on the automation logic rather than authentication headers. Good options include the Open-Meteo weather API (https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true), the CoinGecko simple price endpoint (https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd), or a placeholder service like JSONPlaceholder (https://jsonplaceholder.typicode.com/posts/1). Open the URL in your browser first and confirm it returns readable JSON.
4. A text editor or notes app. Copy the full JSON response from your chosen API into a plain text file. You will refer to this when mapping fields in the workflow, because you need to know the exact key names (such as current_weather.temperature or bitcoin.usd) to reference them correctly in later nodes.
5. Basic familiarity with JSON structure. You do not need to write JSON by hand. You only need to recognize that JSON is a set of key-value pairs, that curly braces {} contain objects, and that square brackets [] contain arrays. When you see a response like {"current_weather": {"temperature": 14.2}}, you should understand that temperature is nested inside current_weather. n8n displays this hierarchy visually in its data mapping panel, so this is a reading skill, not a writing skill.
Tip: Test your API URL and SMTP credentials before you start building. A credential failure halfway through a workflow is the most common source of frustration. Open the API URL in a browser and send yourself a test email from the email node alone, then proceed.
How n8n Nodes and Triggers Work in Plain Terms
Think of a workflow as a chain of dominoes. The first domino is the trigger node, which starts the chain automatically. Each following node is an action that receives data from the previous node, does one specific job, and passes the result forward.
Before you build anything, you need to understand the two fundamental building blocks that make up every n8n workflow. Once you grasp this, the canvas stops looking like a confusing graph and starts looking like a logical sequence of small, manageable decisions.
Understanding Trigger Nodes Versus Action Nodes
Every workflow has exactly one starting point: the trigger node. This is the only node that does not require input from a previous step. It waits for something to happen or fires on a schedule, then creates the first piece of data that travels through your workflow.
- Trigger nodes start a workflow: Schedule Trigger, Webhook, or Manual Trigger are the most common for beginners
- Action nodes perform work: HTTP Request, IF, Set, and Email nodes are typical building blocks
- Every node has input and output connectors on its left and right sides
- Clicking a node opens its configuration panel where you set parameters and credentials
- The connection line between nodes shows the flow of data from one step to the next
A common beginner mistake is placing an action node first and wondering why nothing runs. n8n will show an error because an action node has no trigger feeding it data. Always start by dragging a trigger node onto the canvas, configure it, then add action nodes to the right.
For your first email alert workflow, use a Schedule Trigger set to a short interval, such as every minute, while you test. This gives you immediate feedback without waiting hours. Later, you can switch the trigger to a Webhook or a real data source.
Reading the JSON Data That Flows Between Nodes
n8n passes data between nodes as JSON, which is simply a structured text format made of keys and values. You do not need to write JSON to use n8n, but you do need to read it to map fields correctly.
- n8n automatically converts API responses and node outputs into JSON objects
- Each node shows an “Output Data” tab where you can inspect the exact JSON it received and produced
- Use the “Schema” view to see field names and data types at a glance
- Refer to these field names when mapping data into later nodes, such as the email subject or body
- Copy a sample JSON response into a text editor to understand nested arrays and objects
Here is a practical example. Suppose your workflow fetches weather data from an API. After running the HTTP Request node once, open its Output Data tab. You might see something like this:
{
"location": {
"name": "Berlin",
"country": "Germany"
},
"current": {
"temp_c": 14,
"condition": "Partly cloudy"
}
}
To use the temperature in your email body, you would reference the field using an expression like {{ $json.current.temp_c }}. The dot notation follows the nesting you see in the JSON: current is an object inside the top level, and temp_c is a key inside that object.
Tip: If a field reference returns nothing in your email, open the previous node’s Output Data and check the exact field name. A missing letter or wrong case is enough to break the mapping silently.
When you inspect the output of a node that returns multiple items, such as a list of new emails or database rows, you will see an array at the top level. Each item in the array is a separate JSON object. Most action nodes process all items automatically, but the Email node sends one email per item by default. If you want a single summary email instead, add an Aggregate node or use a function to combine the items first. For more details on how nodes handle arrays and other edge cases, the n8n documentation covers these patterns thoroughly.
Building the Trigger and Fetching Data from an External API
Adding a Manual Trigger for Testing and a Schedule Trigger for Production
Start with a Manual Trigger. It gives you a predictable, on-demand way to execute the workflow while you build and debug each node. You don’t want to wait for a schedule or rely on an external webhook when you’re still checking whether the API returns the data you expect.
- Open your n8n workflow canvas and press the + button to add your first node.
- Search for Manual Trigger and select it. The node appears on the canvas with no required configuration.
- Connect the Manual Trigger to your next node by dragging a line from its output connector to the input connector of the node you add later.
- Add a second trigger node by searching for Schedule Trigger and placing it on the canvas.
- Open the Schedule Trigger and set Trigger Interval to Days, Hours, or Minutes, depending on how often you want the workflow to run. For a first alert workflow, choose Minutes and set the value to 5 so you can confirm the schedule works without waiting long.
- Leave the Schedule Trigger disconnected or disabled while you build the rest of the workflow. This keeps every manual test run independent from the production schedule.
- Before relying on the workflow in production, delete the Manual Trigger or disable it using the toggle in its settings panel, then connect the Schedule Trigger to the next node.
Tip: Keep the Manual Trigger connected during development even if the Schedule Trigger is also present. n8n runs only the path that starts from the trigger you execute, so a manual run will not accidentally trigger the scheduled branch.
Configuring the HTTP Request Node to Call a Public API
The HTTP Request node is the workhorse for fetching external data. For this section, use a public API that returns JSON without authentication so you can focus on the request and response structure.
- Add an HTTP Request node and connect it to the output of the Manual Trigger.
- Open the HTTP Request node and set Method to GET.
- In the URL field, paste the full API endpoint. For example, to monitor the current price of Bitcoin in US dollars from CoinGecko, use:
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
- Leave Authentication set to None because this endpoint is public. If you use an API that requires a key, add it under Authentication as a Generic Credential Type with the key name the API expects, or add individual headers under Headers.
- Click Execute Node in the HTTP Request node panel. n8n runs the request and shows the response in the Output Data tab on the right.
- Inspect the returned JSON. For the CoinGecko example, you should see a structure similar to:
{
"bitcoin": {
"usd": 67234
}
}
- Identify the exact field or array element you want to monitor. In this example, the relevant value is the number at
bitcoin.usd, which you will reference later in the condition node for the email alert.
Warning: Do not test the HTTP Request node by executing the whole workflow yet if the Schedule Trigger is connected and active. Execute the node directly to avoid creating duplicate runs or sending test emails before you finish the logic.
Adding Logic to Decide When an Email Alert Should Be Sent
Using the IF Node to Check a Condition in the API Response
The IF node is where your workflow stops being a passive data pipe and starts making decisions. It evaluates a value from your HTTP Request node and routes the workflow down one of two paths.
- Add an “IF” node after the HTTP Request node by clicking the plus icon on the HTTP Request node and selecting “IF” from the node panel.
- Open the IF node and click “Add Condition.”
- In the left field of the condition, click the expression icon and select the field from the API response that contains the value you want to evaluate. For a weather API, this might be
temperature; for a stock API,price; for a service status API,status. - In the middle dropdown, choose the comparison operator. Common choices are “greater than,” “equals,” “contains,” or “smaller than.” The correct operator depends on the type of data: use “greater than” or “smaller than” for numbers, “equals” for exact matches, and “contains” for partial text matches.
- In the right field, enter the threshold value that triggers the alert. For example, if you want an alert when the temperature exceeds 30 degrees, enter
30. - Confirm that the IF node now shows two output connectors at the bottom: one labeled “true” and one labeled “false.” The true branch activates when the condition is met; the false branch activates when it is not.
- Leave the false branch unconnected for now if you only want to act on positive matches. The workflow simply ends when the condition is false.
Tip: Test the condition with a value you know should pass and one you know should fail before building the rest of the workflow. Open the IF node, click “Execute Node,” and check which output lights up. This catches incorrect field mappings early.
Mapping Only the Needed Data into the Email Node
The Email node on the true branch receives the API data and formats it into a readable message. You do not need to pass every field from the API response, only the ones that matter to the recipient.
- Add an “Email” node to the true branch of the IF node by clicking the plus icon on the true connector and selecting “Email.”
- In the “To” field, enter the recipient email address as a static value, such as
alerts@yourcompany.com. For multiple recipients, separate addresses with commas. - In the “Subject” field, type static text that describes the alert, then click the expression icon to insert a dynamic value from the API response. For example, type
Temperature alert:and then insert thetemperaturefield, so the subject readsTemperature alert: 32.5when the workflow runs. - In the “Body” field, combine static text with multiple dynamic fields. Click the expression icon wherever you want to insert a value. A practical body might read:
The current temperature in Berlin is {{$json["temperature"]}}°C, which is above the threshold of 30°C. Recorded at {{$json["timestamp"]}}. - Use the “Add Field” option below the body field to include a CC or BCC address if a second person or an archive mailbox should receive the alert.
- Save the workflow and run a manual test with a condition that evaluates to true. Check the inbox for the test email and verify that the dynamic values rendered correctly.
Warning: Do not leave the Email node’s “From” field set to the default n8n address if your SMTP provider requires a verified sender. Configure your SMTP credentials in the Email node and set a sender address that matches your domain, or the message may be rejected or marked as spam.
Testing the Workflow Step by Step and Verifying the Email
Testing an n8n workflow is a short sequence of deliberate checks, not a single action. You want to confirm three things in order: the trigger fires, data passes through each node correctly, and the final action produces the expected result in the outside world. Work through the following steps every time you build a new automation, and you’ll catch most configuration mistakes before they cause real problems.
Click the Execute Workflow button in the top toolbar while the Manual Trigger node is connected to the rest of the chain. This runs the entire workflow once, from trigger to final node. You should see a small banner appear at the top of the canvas confirming that the execution has started.
Watch each node on the canvas as the execution progresses. Nodes light up briefly as they run, and a green checkmark appears on each node that completes successfully. If any node shows a red warning icon, stop and inspect that node before continuing. A red icon means the workflow did not reach the email-sending step with valid data.
Open the Output Data tab on the HTTP Request node by clicking the node once. The tab appears on the right side of the editor. Confirm that the API returned the data you expected: check the status code, the JSON structure, and at least one field value that should be dynamic, such as a price or a stock level. If the output is empty or the status code is not 200, the problem is in the request configuration, not in the later logic. If you’re unsure which service to connect to, the n8n integrations catalog is a good place to browse supported apps and APIs.
Open the Output Data tab on the IF node. Verify that the node evaluated the condition correctly and that the data came out through the correct branch. The tab shows which output branch was used, and you should see the same data that entered the node. If the wrong branch was selected, check the comparison operator and the field name you referenced. A common mistake is comparing a string value against a number, which makes the condition evaluate in an unexpected way.
Check the email inbox you configured in the email node. Open the message and confirm that the subject line and body contain the correct dynamic values from the HTTP Request output. For example, if the workflow alerts you when a stock price falls below a threshold, the subject might read “Alert: EUR/USD below 1.08” and the body should show the actual current price returned by the API. If the values are blank or show the expression syntax instead of the data, the field references in the email node are incorrect.
Test the false condition deliberately. Temporarily change the threshold in the IF node so that the condition cannot be true, then execute the workflow again. Confirm that the IF node routes the data to the false branch and that no email arrives in the inbox. This step verifies that the workflow does not send alerts when the condition is not met, which is just as important as confirming it sends them when it is.
Tip: After testing, always change the threshold back to its original value. Leaving a test value in place is an easy mistake that leads to silent failures later, when the workflow runs on a schedule and you are not watching the canvas.
Common Mistakes Beginners Make and How to Fix Them
Most failed n8n workflows are not broken by complex logic. They fail because of small configuration errors that are easy to spot once you know where to look. Here are the mistakes I see most often and the exact steps to correct them.
Forgetting to save credentials for the email node
You configure the SMTP or Gmail node, enter your username and password, click outside the fields, and assume everything is stored. It is not. n8n keeps credentials as a separate resource that must be explicitly created and saved before you can use it in a node.
- Open the email node and click the Credential for SMTP (or Gmail) dropdown.
- Select Create New Credential and fill in the host, port, user, and password fields.
- Click Save in the credential dialog, then click Save again in the node settings.
- Hover over the credential name in the dropdown. You should see a small shield icon and the credential label, not a red warning.
- Execute the workflow once. The node should return a success message instead of an authentication error.
Tip: If you see “No credential selected” or a red border around the credential field at execution time, the credential was never saved. Delete the node connection line, re-add the credential, and test again before continuing.
Using the wrong JSON field name in the IF node or email expression
APIs return data with specific field names, and n8n does not guess them. If the IF node checks {{ $json.price }} but the HTTP Request node returns {{ $json.amount }}, the condition silently evaluates as false and the alert never triggers.
- Run the HTTP Request node alone and open the Output tab in the node details panel.
- Copy the exact field name from the JSON structure, including any nested path such as
data[0].price. - Open the IF node and replace the value expression with the copied field path.
- Open the email node and do the same for any field you reference in the subject or body.
- Execute the workflow and confirm that the IF node output shows the expected value in the true branch.
Connecting the email node to the false branch of the IF node
This is a wiring error, not a logic error. The IF node has two output connectors: the top one for the true branch and the bottom one for the false branch. If you drag the email node from the bottom connector, alerts fire only when your condition is not met.
- Click the connection line between the IF node and the email node and press Delete.
- Drag a new connection from the true output connector at the top of the IF node to the email node input.
- Hover over the connection line. It should show a small label reading “true” near the IF node.
- Run a test with data that meets the condition. The email node should execute and the false branch should remain idle.
Leaving the Manual Trigger connected when switching to a Schedule Trigger
If you add a Schedule Trigger but keep the Manual Trigger also connected to the first node, the workflow has two entry points. A manual click and the scheduled run can both start the same execution path, which leads to duplicate emails or duplicate data writes.
- Open the workflow canvas and locate the Manual Trigger node.
- Click the connection line between the Manual Trigger and the next node and delete it.
- Delete the Manual Trigger node itself unless you need it for testing.
- Connect the Schedule Trigger to the first node in the workflow.
- Save the workflow and activate it. Only the schedule should trigger executions.
Not testing the HTTP Request node alone before building downstream logic
A workflow with five nodes is five times harder to debug than one node. If the HTTP Request returns an error or unexpected data, every downstream node fails or behaves unpredictably. Test the data source in isolation first.
- Add the HTTP Request node and configure the method, URL, headers, and query parameters.
- Click Execute Node on the HTTP Request node only.
- Inspect the output. Confirm the status code is 200 and the JSON structure matches what you expect.
- Only then add the IF node, email node, and any other logic.
- If the data changes later, re-run the HTTP Request node alone before debugging anything downstream.
Ignoring rate limits on free public APIs
Many free APIs limit requests to a certain number per minute or per day. If your schedule runs every five minutes and the API allows only ten requests per hour, you will see intermittent failures that are hard to reproduce. Check the API documentation for the exact limit.
- Identify the rate limit for your chosen API. For example, a free weather API might allow 60 requests per hour.
- Set the Schedule Trigger interval to a safe value that stays below the limit, such as every 15 minutes.
- Add an Error Trigger or a simple Wait node after the HTTP Request node if you need to space out retries.
- If the API returns a 429 status code, pause the workflow for at least the retry-after period before running the node again.
Warning: Some APIs count failed requests against your quota. Do not repeatedly execute a failing HTTP Request node while testing. Fix the request configuration first, then test once.
Making the Workflow Reliable and Preparing for More Advanced Automations
A workflow that works once in testing is not the same as one you can trust. Before you extend this automation or connect it to other services, add basic resilience and make it easy to restore if something breaks.
Adding Retry and Timeout Settings to the HTTP Request Node
The HTTP Request node is the most likely point of failure in this workflow because it depends on an external API. A temporary network issue or a slow server should not require you to run the entire workflow again by hand.
- Open the HTTP Request node that fetches data from your chosen API, then locate the Options section near the bottom of the node settings.
- Set Retry on Fail to
true. This tells n8n to attempt the request again automatically when the first attempt fails. - Set Max Retries to
2or3. Two retries is usually enough for transient failures; three adds a little more tolerance if the API is occasionally slow to respond. - Set Timeout to a value in milliseconds, such as
10000for ten seconds. This prevents the workflow from hanging indefinitely when the API accepts the connection but never sends a response. - Open the On Error dropdown and choose Continue if the rest of the workflow can still run without the missing data, or Stop if the data is essential and a partial run would create bad records downstream.
- Test the retry behaviour by temporarily pointing the request at an invalid URL and running the workflow. You should see n8n attempt the request multiple times before applying the On Error setting.
Tip: Retries and a timeout cover temporary failures, but they do not tell you when a workflow has failed permanently. Add a separate workflow with an Error Trigger node later so that n8n can email or message you when the main workflow stops with an error.
Exporting and Versioning Your Workflow as JSON
Once the workflow is stable, save a copy outside n8n. This protects you from accidental deletions and gives you a simple way to move the automation between instances.
- Open the workflow menu in the top-right corner of the editor and choose Download. n8n saves the complete workflow as a JSON file.
- Store that JSON file in a Git repository or another version control system. Commit a new version after each meaningful change so you can compare or roll back later.
- To reuse the workflow on another n8n instance, create a new workflow there, open the workflow menu, and choose Import from File. Select the JSON file and confirm the import.
- Before making major changes inside n8n, open the workflow menu and choose Duplicate. Work on the duplicate and leave the original workflow active until you have verified the new version.
- Add a short note to each node using the Notes field in the node settings. Write one sentence about what the node does and why it is needed, for example “Fetches new signups from the CRM API and returns only records updated in the last hour.” This makes the workflow much easier to understand when you return to it weeks later.
Warning: A JSON export contains credentials references but not the credential values themselves. When you import a workflow into another n8n instance, you must reconnect each node to a credential that already exists in that instance.
Conclusion
You now have a working n8n workflow that watches for a trigger, processes data through a filter or transformation node, and sends an automated email alert without manual intervention. This same pattern—trigger, logic, action—scales to almost any notification use case, from form submissions to inventory thresholds. Your next step: run three test events through the workflow and confirm each one arrives in your inbox with the correct subject line and body content. After that, connect a real data source such as a webhook or a spreadsheet row, and let the workflow run in the background for a full day.
Frequently asked questions
What exactly is n8n and what can I use it for?
n8n is an open-source workflow automation tool that connects apps and services to move or transform data without manual copying. You can use it to automate repetitive tasks like sending email notifications, syncing rows between spreadsheets and databases, posting to chat tools, or processing form submissions. It runs either on your own server or via a cloud instance, and you build automations visually by connecting nodes.
Do I need to know how to code to build workflows in n8n?
No, you can build most beginner workflows entirely through the visual node editor without writing code. Each node has a configuration panel where you map fields, set conditions, or choose operations from dropdowns. Some advanced transformations may use small JavaScript expressions, but for starting out you can rely on built-in node options and simple drag-and-drop connections.
What is a workflow, a node, and a connection in n8n?
A workflow is the entire automation you design, from the first trigger to the final action. A node is a single step inside that workflow, such as reading a Google Sheet row, filtering data, or sending a Slack message. A connection is the line you draw between nodes that tells n8n which data passes from one step to the next.
How do I start my first automation in n8n?
Start by clicking the plus button to create a new workflow, then add a trigger node such as Schedule Trigger, Webhook, or a specific app event like a new Gmail email. After the trigger, add one action node, for example sending a message to a chat app or creating a spreadsheet row. Connect the two nodes, open the action node to map fields from the trigger output, then save and activate the workflow.
What is the difference between a trigger node and a regular node?
A trigger node starts the workflow and waits for an event like a schedule time, a webhook call, or a new row in an app. Regular nodes execute only after a trigger fires and usually perform an action, transform data, or branch logic. Every workflow needs at least one trigger node, and it must be the first node in the chain.
How do I connect two apps that do not have a direct integration in n8n?
Use an intermediate node such as HTTP Request, Webhook, or Code to bridge between the two apps. For example, if app A can send a webhook and app B has an API, you can receive the webhook in n8n, map the data, then use the HTTP Request node to send it to app B. This lets you automate between almost any tools that expose webhooks or APIs.
How do I test a workflow before activating it?
Use the Execute Workflow button in the editor to run the current workflow manually. You can inspect the output data of each node by clicking the small output connector or opening the node and viewing the Items tab. Fix any mapping errors, then activate the workflow only after the test run produces the expected result.
Can I schedule a workflow to run at regular intervals?
Yes, add a Schedule Trigger node as the first node and set the interval in cron syntax or using the simple interval options. You can choose minutes, hours, days, or custom cron expressions. The workflow will then run automatically at those times without any manual action.
What should I do when a node fails during execution?
Open the failed execution from the Executions list and click the node with the error to read the detailed message. Common causes include missing credentials, wrong field mapping, or rate limits from the connected app. Fix the node configuration or credentials, then re-run the workflow manually to confirm the error is resolved before activating it again.