Skip to main content

Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram

Workflow preview

Workflow preview
100%
Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Promo Seeker automatically finds, verifies, and delivers active promo codes to users via Telegram or email using SerpAPI + Gemini (OpenRouter). Saves hours of manual searching and deduplicates resu...

Best for

  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.toolserpapi, n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.scheduletrigger, n8n-nodes-base.set, n8n-nodes-base.noop, n8n-nodes-base.telegramtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Khairul Muhtadin.

Original n8n.io source

1.1 Workflow description

Title
Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram
Workflow name
Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram

Promo Seeker automatically finds, verifies, and delivers active promo codes to users via Telegram or email using SerpAPI + Gemini (OpenRouter). Saves hours of manual searching and deduplicates results into an n8n Data Table for fast reuse.

Why Use This Workflow?

Time Savings: Reduces manual promo hunting from ~2 hours to ~5 minutes per query.

Cost Reduction: Cuts reliance on paid scraping tools or manual services — potential savings of $50–$200/month.

Error Prevention: Cross-references sources and enforces a 30‑day recency filter to reduce expired-code hits by ~60% vs single-source checks.

Scalability: Handles hundreds of queries per day with Data Table upserts and optional scheduling for continuous discovery.

Ideal For

  • Marketing / Growth Managers: Quickly discover competitor or partner discounts to promote in campaigns.
  • Customer Support / Operations: Respond to user requests with verified promo codes via Telegram or email.
  • Affiliate / Content Teams: Aggregate and maintain a clean promo feed for newsletters or site widgets.

How It Works

  1. Trigger: Incoming request via Webhook, Telegram message, Google Form submission, or scheduled run.
  2. Data Collection: The LangChain agent uses SerpAPI search results and Gemini (OpenRouter) to locate recent promo codes.
  3. Processing: Filter for recency (last 30 days), extract code, value, terms, and expiry.
  4. Intelligence Layer: Gemini 2.5 Pro (OpenRouter) + LangChain agent structure and verify results, outputting a standardized JSON.
  5. Output & Delivery: If a code exists in the Data Table, notify the requester via Telegram and Gmail; otherwise, return results and upsert them into the Data Table.
  6. Storage & Logging: Results stored/upserted in an n8n Data Table to prevent duplicates and enable fast lookups.

Setup Guide

Prerequisites

Requirement Type Purpose
n8n instance Essential Execute the workflow — import JSON to your n8n instance
SerpAPI account Essential Web search results for promo code discovery
OpenRouter (Gemini) account Essential Language model (Gemini 2.5 Pro) for extraction and verification
Telegram Bot (BotFather) Essential Receive queries and send promo notifications
Gmail OAuth2 Essential Send rich email notifications
n8n Data Tables Essential Store and deduplicate promo code records

Get your n8n instance here: n8n instance — import the JSON and begin configuration. (Repeat link for convenience) n8n instance

Installation Steps

  1. Import the JSON workflow into your n8n instance.
  2. Configure credentials (use n8n's Credentials UI — do NOT paste keys into nodes):
    • SerpAPI: paste your SerpAPI API Key from your SerpAPI dashboard.
    • OpenRouter API: paste your OpenRouter API Key (for Gemini 2.5 Pro).
    • Telegram API: create bot via @BotFather, then add Bot Token to Telegram credentials.
    • Gmail OAuth2: use n8n's Gmail OAuth2 credential flow and authorize the account.
  3. Update environment-specific values:
    • Webhook path: /v1/promo-seeker (configured in the Webhook node) or replace with your preferred path.
    • Data Table ID: point to your own Data Table
    • Form/webhook recipient fields (email/chatId mappings).
  4. Customize settings:
    • Adjust the LangChain agent prompt (Promo Seeker Agent) for different recency windows or regional focus.
    • Change max results/limit on the Data Table node (default limit = 3).
  5. Test execution:
    • Trigger via Telegram or a POST to the webhook with sample payload:
      { "platform":"example.com", "email":"[email protected]" }
      
    • Confirm notifications arrive and Data Table rows are upserted.

Technical Details

Core Nodes

Node Purpose Key Configuration
SerpAPI Fetch web search results Provide credential; adjust search params in agent prompt
Gemini 2.5Pro (OpenRouter) Extract & verify promo details Use OpenRouter credential; model google/gemini-2.5-pro
Promo Seeker Agent (LangChain) Orchestrates search + parsing System prompt enforces 30‑day recency & result format
Structured Output Parser Validates agent output JSON schema example for platform/code/value/terms/validUntil
Data Table (Get row(s)) Lookup existing promos Filters by platform; limit = 3
If (Code Exist?) Branching logic Checks existence of platform field
Data Table (Upsert row(s)) Insert or update promo Mapping from agent output to Data Table columns
Telegram Trigger / Telegram Receive queries & notify users Webhook-based trigger; parse_mode = HTML for messages
Gmail Send rich HTML emails Uses Gmail OAuth2 credential
Webhook / Form Trigger Alternate inputs Webhook path /v1/promo-seeker and Form trigger for manual submissions

Workflow Logic

  • On trigger, the Platform Set node normalizes the incoming query and receiver.
  • Get row(s) checks Data Table for existing promos.
    • If found: notify via Telegram and send Gmail (email template included).
    • If not found: the Promo Seeker Agent runs SerpAPI searches, parses structured output, then Upsert row(s) saves results and notifications are sent.
  • Structured Output Parser enforces correct JSON to avoid bad upserts.

Customization Options

Basic Adjustments

  • Recency window: change the agent prompt to 7/14/30 days.
  • Result limit: increase Data Table Get limit or change Upsert batch size.

Advanced Enhancements

  • Add Slack or Microsoft Teams notifications (moderate complexity).
  • Add caching layer (Redis) to reduce repeated SerpAPI calls (advanced).
  • Parallelize searches across multiple search engines (higher API usage & complexity).

Performance & Optimization

Metric Expected Performance Optimization Tips
Execution time 8–30s per new search (depends on SerpAPI + LM response) Reduce SerpAPI page depth; cache recent results
API calls 3–10 SerpAPI calls per complex query Batch queries; use higher-quality search params
Error handling Agent retries on malformed output Use retry nodes and set onError strategy for downstream nodes

Troubleshooting

Problem Cause Solution
No results returned Query too vague or rate-limited API Improve query specificity; check SerpAPI quota
Gmail send fails OAuth scope not granted or token expired Reconnect Gmail OAuth2 credential in n8n
Telegram webhook not firing Incorrect bot token or webhook setup Recreate Telegram credential and check bot permissions
Duplicate rows Upsert mapping mismatch Ensure promoCode mapping in Upsert matches structured output
Agent returns malformed JSON LM prompt too permissive Tighten the agent system prompt and validate with Structured Output Parser

Created by: khaisa Studio Category: Marketing Automation

Tags: promo-codes, coupons, serpapi, telegram, gmail, openrouter, data-tables

Need custom workflows or help adapting this template? Contact us

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - SerpAPI

Type / Role
@n8n/n8n-nodes-langchain.toolSerpApi - toolSerpApi
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Promo Seeker Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 5 - Gemini 2.5Pro

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 6 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 7 - Platform

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 9 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 10 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 11 - Get row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 12 - Code Exist?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 13 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 14 - Send a message

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 15 - Upsert row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 16 - notify telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 17 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 18 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram
Complexity advanced
Nodes 19
Categories AI Chatbot
Author Khairul Muhtadin
Published 02 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9172/9172.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Promo seeker: Auto-find promo codes with SerpAPI, Gemini & Telegram do?

Promo Seeker automatically finds, verifies, and delivers active promo codes to users via Telegram or email using SerpAPI + Gemini (OpenRouter). Saves hours of manual searching and deduplicates resu...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your AI Chatbot use case.