Skip to main content

Trigger Nodes

Trigger nodes are the starting point of every n8n workflow. They define when and how a workflow begins execution. Understanding the different trigger types is essential for building effective automation.

Trigger Types Overview

Webhook Triggers

Instant execution when external service calls your URL

Polling Triggers

Periodic checks for new data or changes

Schedule Triggers

Time-based execution on a schedule

Webhook Triggers

Webhook triggers create HTTP endpoints that external services can call to start your workflow instantly. They are event-driven and execute immediately when triggered.

How Webhooks Work

Architecture:
Key Concepts:
  • Test URL - Used during workflow development
  • Production URL - Used when workflow is active
  • Webhook Methods - Lifecycle management (create, check, delete)
  • Authentication - Built-in security options
When to Use:
  • Real-time event processing
  • Third-party service integrations
  • Form submissions
  • API endpoints
  • IoT device events

Service-Specific Webhook Triggers

Many integrations provide dedicated webhook triggers with automatic registration:
Webhook Events:
  • Push events
  • Pull requests
  • Issues
  • Releases
  • Branch/tag creation
Automatic Setup:
  • Creates webhook in GitHub automatically
  • Handles secret validation
  • Cleans up on workflow deactivation
Configuration:
Implementation Note: Uses webhookMethods for lifecycle management:
  • checkExists() - Verify webhook
  • create() - Register webhook
  • delete() - Remove webhook
Event Types:
  • New messages
  • Reactions added
  • User mentions
  • Channel updates
  • File shared
Setup Requirements:
  1. Create Slack App
  2. Enable Event Subscriptions
  3. Add webhook URL
  4. Subscribe to bot events
Configuration:
Webhook Events:
  • Payment succeeded
  • Customer created
  • Subscription updated
  • Invoice paid
  • Charge refunded
Automatic Registration:
  • Creates endpoint in Stripe
  • Validates webhook signatures
  • Handles event types
Configuration:
Event Types:
  • Channel messages
  • Team updates
  • Meeting scheduled
Implementation:
Webhook Topics:
  • Order created
  • Order updated
  • Product created
  • Customer created
Auto-configuration:
  • Registers webhook via WooCommerce API
  • Sets delivery URL
  • Configures topic and secret

Webhook Node Implementation

The core Webhook node provides maximum flexibility:

Polling Triggers

Polling triggers periodically check external services for new data or changes. They execute at regular intervals and trigger workflows when new items are detected.

How Polling Works

Execution Flow:
State Management:
Key Concepts:
  • Uses polling: true in node description
  • Implements poll() function
  • Stores state in workflow static data
  • Returns null when no new data

Common Polling Triggers

Implementation:
Use Cases:
  • Blog updates
  • News feeds
  • Podcast episodes
  • Content aggregation
Trigger Events:
  • Row added
  • Row updated
  • Row added or updated
Implementation:
Features:
  • Revision-based detection
  • Row-level change tracking
  • Handles updates and additions
Configuration:
State Management:
  • Tracks last message ID
  • Handles pagination
  • Processes attachments
Use Cases:
  • Email automation
  • Attachment processing
  • Notification routing
SOQL Query Polling:
Implementation:
Polling Configuration:
Features:
  • Field-based change detection
  • View-specific polling
  • Formula field support
Database Polling:

Schedule Triggers

Schedule triggers execute workflows based on time patterns - perfect for recurring tasks and maintenance operations.

Schedule Trigger Node

Schedule Types:
  • Simple Intervals - Seconds, minutes, hours, days, weeks, months
  • Specific Times - Daily at specific hour
  • Day of Week - Weekly schedules
  • Custom Cron - Advanced patterns
Features:
  • Multiple schedules per trigger
  • Timezone support
  • Between times constraints
  • Complex recurrence rules
Implementation:

Common Schedule Patterns

Daily at 2 AM:
Use Case: Database backups, data exports, cleanup tasks
Weekly on Sunday at 11 PM:
Use Case: Weekly reports, analytics summaries, invoicing
Every 5 Minutes:
Use Case: Service health checks, API monitoring, uptime tracking
First Monday of Every Month:
Use Case: Monthly cleanups, license checks, subscription renewals

Manual Triggers

Some triggers support manual execution for testing:

Manual Trigger Node

Purpose:
  • Canvas-based testing
  • Manual workflow execution
  • Development and debugging
Implementation:
Features:
  • Instant execution from canvas
  • No external dependencies
  • Sample data generation

Generic Trigger Interface

Some nodes implement custom trigger logic:
Generic Trigger Implementation:
Use Cases:
  • Message queue subscriptions
  • WebSocket connections
  • Database change streams
  • Custom event listeners
Subscribe to Pub/Sub:

Choosing the Right Trigger

Next Steps

Action Nodes

Learn about data processing and transformation nodes

Popular Nodes

Explore commonly used integrations

Build Workflows

Create your first automated workflow

Webhook Guide

Deep dive into webhook configuration