Automation sounds complex, but N8N makes it accessible. This tutorial walks you through building a complete working automation in 10 minutes. No coding required. By the end, you will have a functional workflow that saves time on a real task.
We will build an email-to-task automation: when you star an email in Gmail, create a task in your task management tool and send a Slack notification. This covers the most common automation pattern: trigger + action + action.
Getting Started
Before starting, ensure you have:
- N8N cloud account (free tier works) or self-hosted instance running
- Gmail account with starred emails
- Slack workspace where you can receive notifications
The examples use Gmail and Slack, but N8N supports hundreds of integrations. The concepts transfer to any apps you use.
Step 1: Create a New Workflow
Open N8N and click “New Workflow.” You will see a blank canvas with a single ”+” node waiting to be configured.
The canvas is your workspace. Nodes go on the canvas, and lines between them define execution order.
Step 2: Add Your Trigger
Every workflow starts with a trigger node that determines when the workflow runs.
- Click the ”+” on the canvas
- Search for “Gmail” and select it
- Configure authentication by connecting your Gmail account (OAuth or App Password)
- Select “Email Labeled Trigger” as the trigger type
- Set the label to “Starred”
This trigger fires whenever you star an email. In production, you might use specific labels or folders instead.
Click the node’s “Test” button to verify the connection works. You should see recent starred emails appear in the output panel.
Step 3: Add a Filter (Optional)
Before creating tasks, add a filter to ensure only relevant emails trigger the workflow.
- Click the ”+” between Gmail and where you will add the next node
- Search for “IF” and add it
- Configure the condition: “Subject contains [your keyword]”
- This ensures only emails matching your criteria create tasks
The IF node splits your workflow into “true” and “false” branches. Only the true branch continues.
Step 4: Create a Task
Connect the “true” branch to your task management action.
- Click ”+” on the true branch
- Search for your task tool (Asana, Todoist, Notion, etc.)
- Authenticate your account
- Select “Create Task” action
- Configure task fields:
- Title:
{{ $json.subject }}(pulls email subject) - Description:
From: {{ $json.from.email }} \n\n {{ $json.body }}
- Title:
- Use expressions (the {{ }} syntax) to pull data from previous nodes
Expressions let you reference data from any previous node in the workflow.
Test this step to verify task creation works.
Step 5: Send a Slack Notification
Complete the automation by notifying yourself in Slack.
- Add another node after the task creation
- Search for “Slack” and select it
- Authenticate your Slack workspace
- Select “Send Message”
- Configure:
- Channel: Your name or a specific channel
- Message:
New task created from email: {{ $json.subject }}
This confirms the automation ran successfully and provides visibility into what was automated.
Step 6: Connect the Nodes
If nodes were added separately, connect them by dragging from output ports to input ports. The workflow should flow:
Gmail Trigger → IF Filter → Create Task (true branch) → Send Slack Notification
The false branch of the IF node should connect to a “Stop Workflow” node set to exit silently. This prevents errors when emails do not match your filter.
Step 7: Activate and Test
Toggle the workflow to “Active” status using the switch in the top right.
Star a test email in Gmail. Within seconds, you should see:
- The workflow trigger in N8N’s execution log
- A new task created in your task tool
- A Slack notification appear
Congratulations. You just built your first automation.
Common Issues and Fixes
Trigger not firing: Verify the Gmail trigger uses the correct label. Labels must match exactly, including case.
Task not creating: Check that task tool authentication is still valid. Tokens expire periodically.
Slack message not sending: Ensure the bot has access to the specified channel.
Expanding Your Automation
Now that you understand the basics, consider adding:
- Error handling with “Error Trigger” nodes
- Conditional logic for different email types
- Data transformation with “Set” nodes
- Multiple parallel actions using “Split In Batches”
Key Takeaways
- Workflows consist of trigger nodes + action nodes
- IF nodes add conditional logic
- Expressions ({{ }}) pull data between nodes
- Test each node individually before activating
- Execution logs show what happened when things go wrong
FAQ
How long does this workflow take to run? Most executions complete in under 10 seconds. Complex workflows with API calls may take longer.
What happens if Slack is down? Workflow execution pauses until Slack responds. Subsequent executions queue or retry based on your configuration.
Can I run this on a schedule instead of email trigger? Yes, use the Schedule Trigger node instead of Gmail trigger to run workflows at specific times.
How do I monitor if my workflow runs correctly? N8N provides execution history. Enable error alerts to get notified of failures.
Can I share workflows with my team? Yes, on Pro and Enterprise plans. Workflows can be shared and managed collaboratively.