Skip to main content
Communication & Messaging Triggered

Telegram Code Create Triggered

3
14 downloads
15-45 minutes
🔌
4
Integrations
Intermediate
Complexity
🚀
Ready
To Deploy
Tested
& Verified

What's Included

📁 Files & Resources

  • Complete N8N workflow file
  • Setup & configuration guide
  • API credentials template
  • Troubleshooting guide

🎯 Support & Updates

  • 30-day email support
  • Free updates for 1 year
  • Community Discord access
  • Commercial license included

Agent Documentation

Standard

Telegram Code Create Triggered – Communication & Messaging | Complete n8n Triggered Guide (Intermediate)

This article provides a complete, practical walkthrough of the Telegram Code Create Triggered n8n agent. It connects HTTP Request, Webhook across approximately 1 node(s). Expect a Intermediate setup in 15-45 minutes. One‑time purchase: €29.

What This Agent Does

This agent orchestrates a reliable automation between HTTP Request, Webhook, handling triggers, data enrichment, and delivery with guardrails for errors and rate limits.

It streamlines multi‑step processes that would otherwise require manual exports, spreadsheet cleanup, and repeated API requests. By centralizing logic in n8n, it reduces context switching, lowers error rates, and ensures consistent results across teams.

Typical outcomes include faster lead handoffs, automated notifications, accurate data synchronization, and better visibility via execution logs and optional Slack/Email alerts.

How It Works

The workflow uses standard n8n building blocks like Webhook or Schedule triggers, HTTP Request for API calls, and control nodes (IF, Merge, Set) to validate inputs, branch on conditions, and format outputs. Retries and timeouts improve resilience, while credentials keep secrets safe.

Third‑Party Integrations

  • HTTP Request
  • Webhook

Import and Use in n8n

  1. Open n8n and create a new workflow or collection.
  2. Choose Import from File or Paste JSON.
  3. Paste the JSON below, then click Import.
  4. Show n8n JSON
    Title:
    Automating Facebook Interest Research with n8n and Telegram: A Dynamic Workflow Guide
    
    Meta Description:
    Learn how to automate Facebook interest keyword research using Telegram, n8n, and the Facebook Graph API. This guide breaks down a powerful workflow that extracts user input, queries interest data, and delivers a downloadable CSV file—all without writing a single line of backend code.
    
    Keywords:
    n8n workflow automation, Facebook Graph API, Telegram bot, interest keyword research, Facebook ads audience, automate CSV report, no-code automation, Facebook marketing tools, Telegram n8n integration, ad keyword research automation
    
    Third-Party APIs Used:
    
    - Telegram API
    - Facebook Graph API
    
    Article:
    
    Automating Facebook Ad Interest Keyword Research Using n8n and Telegram
    
    If you’re in the digital marketing or media-buying world, you know the struggle of manually researching Facebook ad interest keywords. It’s time-consuming, repetitive, and lacks scalability. Enter n8n—an open-source workflow automation tool that, when combined with Telegram and the Facebook Graph API, provides a fully-automated solution to extract user-tagged interests and return detailed data in a downloadable CSV format.
    
    In this article, we’ll walk you through an automated workflow that takes a simple Telegram message starting with “#interest {query}”, processes it through a series of nodes in n8n, and returns a comprehensive interest report straight back to your Telegram group.
    
    🧩 Workflow Overview
    
    Here’s what happens under the hood:
    
    1. A user sends a message in a designated Telegram group with a keyword query (e.g., “#interest fitness”).
    2. n8n captures the message and validates it.
    3. The interest keyword is parsed and extracted.
    4. Facebook’s Graph API is queried via the /search endpoint for related ad interests.
    5. The results are processed into structured variables.
    6. A CSV report is generated.
    7. The report is sent back to the Telegram chat—automatically.
    
    Let’s take a closer look at each stage of this workflow and how it’s constructed.
    
    📩 Step 1: Capturing Telegram Messages
    
    The workflow begins with a Telegram Trigger node titled “Get interest name.” It's configured to listen for incoming messages in a specific group chat (verified using chat ID -1001805495093). The trigger filters only messages that begin with “#interest”, ensuring only relevant queries are processed.
    
    ✅ Step 2: Validating Message Format
    
    The “Check message contents” node performs a two-fold check:
    - It ensures the message originates from the pre-specified Telegram group.
    - It checks that the message starts with “#interest”.
    
    If either condition fails, the workflow hits a “No Operation” node (meaning it does nothing), avoiding unnecessary processing.
    
    🔍 Step 3: Extracting the Keyword
    
    Next, two JavaScript code nodes—“Extract message” and “Split Message”—refine the user’s input. The first node pulls out the raw text of the message, while the second uses a regex pattern to split the keyword from its “#interest” prefix.
    
    For example, from “#interest digital marketing,” it isolates:
    - extractedContent: “interest”
    - remainingContent: “digital marketing”
    
    🌐 Step 4: Querying the Facebook Graph API
    
    Now comes the real magic. The “Connect to Graph API” node sends a dynamically composed request to Facebook’s search endpoint via the Graph API:
    
    /search?type=adinterest&q={{ $json.remainingContent }}&limit=1000000&locale=en_US
    
    This fetches up to a million matching ad interest keywords related to the queried topic in U.S. English localization.
    
    🧮 Step 5: Structuring the Results
    
    Facebook returns a JSON object with detailed information about each interest term, including audience sizes, topics, and descriptions. Two n8n code nodes—“Split Interests into a Table” and “Get variables”—restructure this nested data into a flat, readable format suitable for tabular representation.
    
    📊 Step 6: Creating the Spreadsheet
    
    Using the “Create a Spreadsheet” node, the structured interest data is converted into a CSV file. Fields include:
    - Interest name
    - Audience size (lower & upper bounds)
    - Topic categorization
    - Descriptions
    - Path data from Facebook’s interest taxonomy
    
    📤 Step 7: Sending Back to Telegram
    
    Finally, n8n uses a Telegram Send node ("Send the Spreadsheet file") to return the generated CSV as a downloadable file directly into the Telegram group chat—meaning the user gets instant, formatted, and actionable insight on demand.
    
    🛠️ Tools and APIs at Work
    
    This intelligent automation hinges on the seamless integration of three key technologies:
    
    - Telegram API: Handles incoming queries and file responses via bot integration.
    - Facebook Graph API (v17.0): Powers the ad interest keyword lookup through the /search endpoint.
    - n8n: The orchestration engine that glues everything together—parsing text, calling external APIs, restructuring JSON, and handling file I/O.
    
    📌 Important Note
    
    To access Facebook’s Graph API for this functionality, you will need to set up appropriate credentials. Facebook provides a detailed walkthrough here: https://developers.facebook.com/docs/commerce-platform/setup/api-setup/
    
    💡 Final Thoughts
    
    This workflow is a powerful example of no-code/low-code automation in action. Instead of manually toggling between Facebook’s Ad Manager and spreadsheets, marketers and media buyers can now query mass interest data right from their mobile phone. Whether you're building a custom tool for client reporting or empowering your ad team with better insights, this Telegram-n8n-Facebook Graph hybrid is as efficient as it is elegant.
    
    🧪 Want to Customize?
    
    You can easily expand this workflow by:
    - Adding user-specific filters
    - Incorporating other APIs (e.g., Google Trends for comparative data)
    - Scheduling recurring queries
    - Logging data to Airtable or Google Sheets
    
    Empower your workflows and banish repetitive tasks—with n8n, the automation possibilities are endless.
    
    — END —
  5. Set credentials for each API node (keys, OAuth) in Credentials.
  6. Run a test via Execute Workflow. Inspect Run Data, then adjust parameters.
  7. Enable the workflow to run on schedule, webhook, or triggers as configured.

Tips: keep secrets in credentials, add retries and timeouts on HTTP nodes, implement error notifications, and paginate large API fetches.

Validation: use IF/Code nodes to sanitize inputs and guard against empty payloads.

Why Automate This with AI Agents

AI‑assisted automations offload repetitive, error‑prone tasks to a predictable workflow. Instead of manual copy‑paste and ad‑hoc scripts, your team gets a governed pipeline with versioned state, auditability, and observable runs.

n8n’s node graph makes data flow transparent while AI‑powered enrichment (classification, extraction, summarization) boosts throughput and consistency. Teams reclaim time, reduce operational costs, and standardize best practices without sacrificing flexibility.

Compared to one‑off integrations, an AI agent is easier to extend: swap APIs, add filters, or bolt on notifications without rewriting everything. You get reliability, control, and a faster path from idea to production.

Best Practices

  • Credentials: restrict scopes and rotate tokens regularly.
  • Resilience: configure retries, timeouts, and backoff for API nodes.
  • Data Quality: validate inputs; normalize fields early to reduce downstream branching.
  • Performance: batch records and paginate for large datasets.
  • Observability: add failure alerts (Email/Slack) and persistent logs for auditing.
  • Security: avoid sensitive data in logs; use environment variables and n8n credentials.

FAQs

Can I swap integrations later? Yes. Replace or add nodes and re‑map fields without rebuilding the whole flow.

How do I monitor failures? Use Execution logs and add notifications on the Error Trigger path.

Does it scale? Use queues, batching, and sub‑workflows to split responsibilities and control load.

Is my data safe? Keep secrets in Credentials, restrict token scopes, and review access logs.

Keywords:

Integrations referenced: HTTP Request, Webhook

Complexity: Intermediate • Setup: 15-45 minutes • Price: €29

Requirements

N8N Version
v0.200.0 or higher required
API Access
Valid API keys for integrated services
Technical Skills
Basic understanding of automation workflows
One-time purchase
€29
Lifetime access • No subscription

Included in purchase:

  • Complete N8N workflow file
  • Setup & configuration guide
  • 30 days email support
  • Free updates for 1 year
  • Commercial license
Secure Payment
Instant Access
14
Downloads
3★
Rating
Intermediate
Level