tutorial

Building a 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.

The Bottom Line: A basic n8n workflow connecting a webhook trigger to a conditional branch and two output actions can be built and tested in under 30 minutes; n8n's visual canvas and built-in execution log make debugging straightforward for first-time users.

Building Your First n8n Workflow: A Step-by-Step Tutorial

n8n is a powerful workflow automation platform that gives teams visual building and code-level control in one tool. This tutorial walks you through building a 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:

  1. n8n installed either self-hosted (Docker recommended) or a cloud account at app.n8n.cloud
  2. GitHub account with a repository to monitor
  3. Slack workspace with permission to install apps
  4. 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 the automation.

  1. Open n8n and click Add workflow
  2. Click the + button to add a first node
  3. Search for GitHub Trigger and select it
  4. Click Create new credential and authenticate with your GitHub account
  5. Configure the trigger:
    • Repository Owner: your GitHub username or organization
    • Repository Name: the repo organizations want to monitor
    • Events: select Issues and check opened
  6. 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:

  1. Click + after the GitHub Trigger node
  2. Add a Set node
  3. 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") }}

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:

  1. Click + after the Set node
  2. Add an IF node
  3. Set the condition: is_bug equals true
  4. 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)

  1. Click + on the true output
  2. Add a Slack node
  3. Connect your Slack workspace credential
  4. 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)

  1. Click + on the false output
  2. Add another Slack node
  3. 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:

  1. Add a Merge node to combine both branches
  2. Add a Google Sheets node
  3. Connect your Google account
  4. Select the spreadsheet and worksheet
  5. Map columns: Date, Title, Author, Type (bug/other), URL

This creates an automatic issue log that the team can reference.

Step 6: Test and Activate

  1. Click Execute Workflow to run a test with the sample data from Step 1
  2. Verify each node executed successfully (green checkmarks)
  3. Check your Slack channels for the test notification
  4. Check your Google Sheet for the logged entry
  5. Fix any field mapping issues
  6. Toggle the workflow to Active in the top-right corner

Error Handling

Add error handling to make the workflow production-ready:

  1. Click on any node and select Settings
  2. Enable Continue on Fail for non-critical nodes (like the Google Sheets logging)
  3. Add an Error Trigger workflow that sends you a notification if the main workflow fails
  4. Set up retry logic for transient API failures

Next Steps

Now that organizations 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 users will build. The concepts transfer directly to more complex workflows.

Last updated: | By Rafal Fila

Tools Mentioned

Related Guides

Related Rankings

Best AI-Powered Automation Tools in 2026

AI-powered automation tools integrate artificial intelligence features — natural language workflow creation, intelligent data mapping, predictive actions, and LLM-based content generation — into their automation platforms. As of March 2026, most major automation platforms have added AI capabilities, but the depth and practical utility of these features varies significantly. This ranking evaluates 8 automation tools on the practical value of their AI features, not marketing claims. The evaluation focuses on whether AI features reduce manual configuration, accelerate workflow creation, and improve outcomes versus doing the same work without AI. Tools that use AI as a core differentiator (not just a checkbox feature) score higher.

Best Automation Tools for Startups in 2026

Startups need automation tools that provide immediate value at minimal cost, with room to scale as the team grows. The best startup automation tools offer generous free tiers, fast time-to-value (first working automation within hours, not days), and a clear scaling path from 5-person team to 50-person company. This ranking evaluates 8 automation platforms specifically for startup relevance as of March 2026. The evaluation prioritizes free tier generosity, speed from signup to first working automation, scalability as the team and workflow count grow, integration breadth covering the typical startup tech stack (Slack, Google Workspace, HubSpot, Stripe, GitHub, Notion), and total cost at early-stage volumes (under 50,000 tasks per month).

Common Questions

What Is Digital Process Automation (DPA)?

Digital Process Automation (DPA) is a discipline focused on digitizing and automating end-to-end business processes to improve operational efficiency and customer experiences. Coined by Forrester in 2017, DPA evolved from traditional BPM to emphasize customer-facing, digital-first process orchestration across multiple systems and departments. As of 2025, the global DPA market is valued at approximately $16.7 billion.

What Is Decision Intelligence?

Decision intelligence is a discipline that combines AI, data analytics, and business rules to automate or augment human decision-making processes. Gartner named it a top strategic technology trend for 2022. As of 2026, approximately 25% of Global 2000 companies have formal decision intelligence initiatives, applying the discipline to pricing, credit risk, fraud detection, and supply chain optimization.

Zapier vs Power Automate: Which Automation Tool Is Better in 2026?

Zapier offers 6,000+ integrations with task-based pricing ($19.99/mo), making it ideal for cross-platform teams. Power Automate provides 1,000+ connectors with deep Microsoft 365 integration and is included with E3/E5 licenses, making it the default for Microsoft-centric organizations. Zapier excels in multi-SaaS environments; Power Automate adds RPA capabilities and enterprise governance through Azure AD. As of March 2026, many organizations use both platforms for different workflow categories.

Monday.com vs Airtable: Which Project Automation Tool Is Better in 2026?

Monday.com is a visual work management platform with board-based project tracking and recipe-style automations ($9/seat/mo). Airtable is a relational database platform with a spreadsheet interface, linked records, and script-based automations ($20/seat/mo). Monday.com suits teams prioritizing visual project tracking and collaboration. Airtable suits teams needing relational data models, custom applications, and data-intensive workflows. As of March 2026, many organizations run both for different use cases.