Building Your First n8n Workflow: A Step-by-Step Tutorial
Step-by-step tutorial for building a GitHub-to-Slack notification workflow in n8n with conditional routing and logging.
Building Your First n8n Workflow: A Step-by-Step Tutorial
n8n is a powerful workflow automation platform that gives you visual building and code-level control in one tool. This tutorial walks you through building your first real workflow from scratch.
What We Will Build
We will create a workflow that monitors a GitHub repository for new issues and sends a formatted notification to a Slack channel with issue details. This is a practical, real-world automation that many development teams use.
Workflow Architecture
Here is the overall flow of our automation:
flowchart TD
A[GitHub Trigger: New Issue Created] --> B[Extract Issue Details]
B --> C{Is it a bug?}
C -->|Yes| D[Format Bug Alert Message]
C -->|No| E[Format General Notification]
D --> F[Send to #bugs Slack Channel]
E --> G[Send to #general Slack Channel]
F --> H[Log to Google Sheet]
G --> H[Log to Google Sheet]
Prerequisites
Before starting, make sure you have:
- n8n installed either self-hosted (Docker recommended) or a cloud account at app.n8n.cloud
- GitHub account with a repository to monitor
- Slack workspace with permission to install apps
- Google account for the Google Sheets logging step (optional)
Step 1: Set Up the GitHub Trigger
Every n8n workflow starts with a trigger node. This is the event that kicks off your automation.
- Open n8n and click Add workflow
- Click the + button to add your first node
- Search for GitHub Trigger and select it
- Click Create new credential and authenticate with your GitHub account
- Configure the trigger:
- Repository Owner: your GitHub username or organization
- Repository Name: the repo you want to monitor
- Events: select Issues and check opened
- Click Listen for Test Event and create a test issue in your repo to capture sample data
The trigger node will now fire every time a new issue is created in your repository.
Step 2: Extract and Transform Issue Data
Add a Set node to extract the fields we need:
- Click + after the GitHub Trigger node
- Add a Set node
- Configure the following fields:
- title:
{{ $json.issue.title }} - body:
{{ $json.issue.body }} - author:
{{ $json.issue.user.login }} - url:
{{ $json.issue.html_url }} - labels:
{{ $json.issue.labels.map(l => l.name).join(", ") }} - is_bug:
{{ $json.issue.labels.some(l => l.name === "bug") }}
- title:
This step normalizes the GitHub webhook data into a clean format for the rest of the workflow.
Step 3: Add Conditional Routing
We want bug reports to go to a dedicated channel. Add an IF node:
- Click + after the Set node
- Add an IF node
- Set the condition: is_bug equals true
- This creates two output branches: true (bugs) and false (other issues)
Step 4: Configure Slack Notifications
Add two Slack nodes, one for each branch:
Bug Alert (True branch)
- Click + on the true output
- Add a Slack node
- Connect your Slack workspace credential
- Configure:
- Channel: #bugs (or your bug channel)
- Message Text: Format a rich message:
:bug: *New Bug Report*
*Title:* {{ $json.title }}
*Author:* {{ $json.author }}
*Labels:* {{ $json.labels }}
*Link:* {{ $json.url }}
{{ $json.body }}
General Notification (False branch)
- Click + on the false output
- Add another Slack node
- Configure similarly but send to #general with a different emoji:
:clipboard: *New Issue*
*Title:* {{ $json.title }}
*Author:* {{ $json.author }}
*Link:* {{ $json.url }}
Step 5: Log to Google Sheets (Optional)
Add a Google Sheets node after both Slack nodes to maintain a log:
- Add a Merge node to combine both branches
- Add a Google Sheets node
- Connect your Google account
- Select your spreadsheet and worksheet
- Map columns: Date, Title, Author, Type (bug/other), URL
This creates an automatic issue log that your team can reference.
Step 6: Test and Activate
- Click Execute Workflow to run a test with the sample data from Step 1
- Verify each node executed successfully (green checkmarks)
- Check your Slack channels for the test notification
- Check your Google Sheet for the logged entry
- Fix any field mapping issues
- Toggle the workflow to Active in the top-right corner
Error Handling
Add error handling to make your workflow production-ready:
- Click on any node and select Settings
- Enable Continue on Fail for non-critical nodes (like the Google Sheets logging)
- Add an Error Trigger workflow that sends you a notification if the main workflow fails
- Set up retry logic for transient API failures
Next Steps
Now that you have a working workflow:
- Add more triggers: Monitor pull requests, comments, or releases
- Enrich notifications: Add assignee information, milestone details, or priority labels
- Build related workflows: Auto-assign issues based on labels, create Jira tickets from GitHub issues, or generate weekly summary reports
- Explore the n8n community: Browse 1,000+ workflow templates at n8n.io/workflows for inspiration
This pattern of trigger, transform, route, and action applies to virtually any automation you will build. The concepts transfer directly to more complex workflows.
Tools Mentioned
Related Rankings
Best Open Source Automation Platforms 2026
Our curated ranking of the top open-source workflow automation platforms for teams that want transparency, self-hosting capabilities, and community-driven development.
Best Workflow Automation Tools 2026
Our curated ranking of the top workflow automation platforms for businesses.
Common Questions
IFTTT vs Zapier: Which automation platform should you choose in 2026?
IFTTT excels at consumer and IoT automation with 800+ services and very affordable pricing starting at $3.49/month. Zapier dominates business automation with 7,000+ apps, multi-step workflows, and team features starting at $19.99/month. Choose IFTTT for smart home; choose Zapier for business processes.
What are the key differences between Zapier and Make?
Zapier is easier to use with 7,000+ app connections and a linear workflow builder, while Make offers better pricing, a visual canvas for complex logic, and stronger data transformation capabilities. Zapier is best for simple automations; Make excels at complex, data-heavy workflows.
What are the best open-source workflow automation tools?
The best open-source automation tools are n8n (most mature, 400+ integrations), ActivePieces (modern UI, MIT license), Windmill (code-first for developers), Huginn (agent-based monitoring), and Automatisch (simplest Zapier alternative). All can be self-hosted for free.
What are the best self-hosted automation tools for privacy-conscious teams?
The best self-hosted automation tools are n8n (most mature, 400+ integrations), ActivePieces (MIT license, modern UI), Windmill (code-first for developers), Huginn (agent-based monitoring), and Automatisch (simplest setup). All support Docker deployment and keep your data on your own infrastructure.