Telegram Amazon Product Scraper and AI Assistant - n8n Workflow

Use this powerful n8n workflow to build a smart Telegram assistant that performs real-time Amazon product searches using Apify scraping and OpenRouter AI intent detection. Highly flexible n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

E-commerce Entrepreneurs: Users needing fast, on-demand competitor price checks or product monitoring.
Automation Specialists: Those looking to integrate AI intent detection (using OpenRouter) with web scraping within a single n8n workflow.
Technical Users of Telegram: Individuals wanting to build custom bots leveraging Telegram as an interactive frontend.
n8n Developers: Users searching for complex n8n templates that combine multiple services (AI, scraping, messaging) effectively.

Overview

This sophisticated n8n workflow automates the process of handling user queries via Telegram, determining intent using AI, cleaning the input, and performing specific actions—either delivering a conversational response or scraping product data from Amazon. Utilizing an n8n trigger (Telegram), this solution offers a streamlined way to provide real-time shopping assistance. Unlike simple bots, this n8n automation includes robust input cleaning and conditional logic, making the interaction smooth and reliable. This specific n8n workflow demonstrates how to combine core logic flow control with external APIs (OpenRouter for AI, Apify for scraping) to build high-value n8n templates.

How it Works

The entire process is initiated by an n8n trigger. When a user sends a message to the integrated Telegram bot:


  1. Trigger and Cleaning: The Recieve Message n8n trigger captures the input. The Clean userInput n8n node cleans the text by normalizing it, removing extraneous phrases (like 'in amazon'), and URL-encoding the query.

  2. AI Intent Detection: The Intent Detection LangChain Agent, powered by the OpenRouter n8n node, analyzes the cleaned text. It returns a boolean flag indicating if the request is a productQuery or general conversation.

  3. Routing: The Product Vs Response Switch n8n node directs the flow based on the AI's output.

  4. Product Search Path (True): If a product query is detected, the workflow proceeds to the Send Post request and get datset items n8n node (HTTP Request). This node sends the sanitized query to the Apify Amazon Scraper API, requesting a maximum of five items.

  5. Response Delivery (Product): The scraped data is received and formatted into clear messages (Title, URL, Price). The Send Amazone Products Telegram n8n node sends these structured results back to the original Telegram chat ID.

  6. Chat Path (False): If the query is conversational, the Response for General LangChain Agent uses a different prompt (via OpenRouter Chat Model2) to generate a polite, shopping-assistant response.

  7. Response Delivery (General): The Send Response Telegram n8n node delivers the AI-generated chat message.

Installation Guide

To set up this powerful n8n workflow using these n8n templates, follow these steps:


  1. Import: Copy the provided JSON and import it directly into your n8n instance.

  2. Telegram Credentials: Set up the credentials for the Telegram Trigger (Recieve Message) and the Telegram actions (Send Amazone Products, Send Response). This requires your Telegram Bot token.

  3. OpenRouter Credentials: Configure the 'OpenRouter account' credential used by the OpenRouter Chat Model and OpenRouter Chat Model2 n8n node instances. This AI integration handles intent.

  4. Apify Setup (Optional but Recommended): Although the Apify key is typically managed externally or via a dedicated Apify n8n node (not shown here, but assumed via the HTTP Request), ensure your environment variables or the Send Post request node body is correctly configured to interface with the Apify Amazon Scraper API (Actor). The current setup sends a raw POST request, requiring you to configure the appropriate Apify API endpoint outside of the current n8n templates.

  5. Activation: Once all credentials and API connections are set, activate the n8n workflow. The Telegram n8n trigger will immediately begin listening for messages.

Node Details

Recieve Message (n8n trigger / Telegram Trigger): The starting point of the n8n workflow. It monitors a configured Telegram bot for new messages.
Clean userInput (Code n8n node): Essential pre-processing step. It sanitizes the user text by removing platform mentions ('in amazon', 'on flipkart') and standardizes the input for better search accuracy and URL encoding.
Intent Detection (LangChain Agent n8n node): Uses the connected OpenRouter Chat Model to classify the incoming message, outputting a JSON object that includes the productQuery boolean flag.
Product Vs Response (Switch n8n node): The core decision-making n8n node. It analyzes the productQuery flag generated by the AI to route the execution path: either scraping (True) or chatting (False).
Send Post request and get datset items (HTTP Request n8n node): Executes the web scraping action. It dynamically inserts the cleaned search term into the Amazon URL and sends a POST request to the Apify API to initiate scraping, limited to 5 results.
Send Amazone Products (Telegram n8n node): Formats the scraped product data into a readable message containing the Title, URL, and Price, and sends it back via Telegram, completing the product search n8n workflow path.


  • Response for General (LangChain Agent n8n node): Used when the input is not a search query. It generates a friendly, focused response, defining the bot's capabilities.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Parth Pansuriya
Parth Pansuriya

I build smart and scalable automation workflows using n8n to simplify tasks, connect apps, and boost productivity. From WhatsApp bots to AI-powered systems, I create seamless automations tailored for business and creators.

Featured*