This workflow corresponds to n8n.io template #10849 — we link there as the canonical source.
This workflow follows the Agent → OpenRouter Chat recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "997553c3-7adc-4f4b-8f50-2ff2cf3611de",
"name": "Filter Only URLs",
"type": "n8n-nodes-base.filter",
"position": [
-2016,
5200
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "17e612d0-d2b2-4f57-bcd3-f377c880ea3f",
"operator": {
"type": "string",
"operation": "regex"
},
"leftValue": "={{ $json.message.text }}",
"rightValue": "=^(https?:\\/\\/)[^\\s/$.?#].[^\\s]*$"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "58895e06-a286-463b-86b1-62dfedcba85e",
"name": "Extract Q&A from URL",
"type": "n8n-nodes-base.airtop",
"position": [
-1824,
5200
],
"parameters": {
"url": "={{ $json.message.text }}",
"prompt": "Extract all questions and answers from this form or document",
"resource": "extraction",
"sessionMode": "new",
"additionalFields": {}
},
"credentials": {
"airtopApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "d9f72563-fa75-400e-93aa-8269554ea629",
"name": "Apply Safety Guardrails",
"type": "@n8n/n8n-nodes-langchain.guardrails",
"position": [
-1632,
5200
],
"parameters": {
"text": "={{ $json.data.modelResponse }}",
"guardrails": {
"pii": {
"value": {
"type": "all"
}
},
"nsfw": {
"value": {
"threshold": 0.7
}
},
"keywords": ""
}
},
"typeVersion": 1
},
{
"id": "415afa93-eead-45a7-8ee0-e189dd605190",
"name": "OpenRouter Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-1632,
5408
],
"parameters": {
"model": "openrouter/sherlock-dash-alpha",
"options": {}
},
"credentials": {},
"typeVersion": 1
},
{
"id": "7b1887a7-1fde-47fa-b1ff-ff3836cd2545",
"name": "Send Safe Response",
"type": "n8n-nodes-base.telegram",
"position": [
-960,
5072
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger1').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {},
"typeVersion": 1.2
},
{
"id": "8c1a7d76-d9f0-4993-b36c-a02b588c00c5",
"name": "Send Violation Alert",
"type": "n8n-nodes-base.telegram",
"position": [
-1312,
5392
],
"parameters": {
"text": "=Failed Guardrail Test",
"chatId": "={{ $('Telegram Trigger1').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {},
"typeVersion": 1.2
},
{
"id": "fcd9f95d-a2b7-41cf-9690-eb77d1247867",
"name": "Tavily Web Search",
"type": "@tavily/n8n-nodes-tavily.tavilyTool",
"position": [
-1152,
5280
],
"parameters": {
"query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
"options": {
"topic": "general",
"max_results": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Max_Results', ``, 'number') }}",
"search_depth": "={{ $fromAI('Search_Depth', 'How detailed the search should be. Either basic or advanced', 'string', basic) }}"
}
},
"credentials": {
"tavilyApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "dc966130-f93c-45e1-accc-1df981b29a94",
"name": "Note: URL Filter",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2144,
5376
],
"parameters": {
"color": 6,
"width": 320,
"height": 192,
"content": "## \ud83d\udd0d Filter Only URLs\n\n**Purpose:** Validates incoming messages as pure URLs using regex.\n\n**Note:** Ignores messages with extra text; adjust regex for flexibility."
},
"typeVersion": 1
},
{
"id": "ad9a45c2-63ab-427e-9d8d-68ac5b0ce541",
"name": "Note: Extraction",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1968,
4976
],
"parameters": {
"color": 3,
"width": 288,
"height": 208,
"content": "## \ud83d\udcdd Extract Q&A from URL\n\n**Purpose:** Uses Airtop to pull structured questions/answers from webpages.\n\n**Note:** Best for text-based docs; prompt can be customized."
},
"typeVersion": 1
},
{
"id": "408a51f1-1748-434a-b932-5f2310a251fb",
"name": "Note: Guardrails",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1648,
4976
],
"parameters": {
"color": 2,
"width": 320,
"height": 208,
"content": "## \ud83d\udee1\ufe0f Apply Safety Guardrails\n\n**Purpose:** Checks extracted content for NSFW/PII violations.\n\n**Note:** Thresholds configurable; fails send alert instead."
},
"typeVersion": 1
},
{
"id": "d34d9ee3-b6dd-4687-9fc2-6f489d6229b9",
"name": "Note: Language Model",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1664,
5584
],
"parameters": {
"color": 5,
"width": 320,
"height": 192,
"content": "## \ud83d\udd24 OpenRouter Model\n\n**Purpose:** Supplies language model for guardrails and agent processing.\n\n**Note:** Uses sherlock-dash-alpha; connect to multiple nodes as needed."
},
"typeVersion": 1
},
{
"id": "dcd19034-e606-4522-a5c2-2dfc18246656",
"name": "Note: Web Search",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
5280
],
"parameters": {
"color": 3,
"width": 320,
"height": 192,
"content": "## \ud83c\udf10 Tavily Web Search\n\n**Purpose:** Provides web search capability to the main agent.\n\n**Note:** Uses AI to determine query depth and results; general topic by default."
},
"typeVersion": 1
},
{
"id": "b112efd1-2f33-4357-857c-9b5e56542a66",
"name": "Overview Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-656,
4608
],
"parameters": {
"color": 5,
"width": 728,
"height": 1312,
"content": "# \ud83e\udd16 Secure URL Q&A Extractor for Telegram with AI Safety\n\n## \ud83d\udccb What This Template Does\nTriggers on Telegram URLs \u2192 extracts Q&A via Airtop \u2192 applies NSFW/PII guardrails \u2192 responds safely with OpenRouter agent & optional Tavily search.\n\n## \ud83d\udd27 Prerequisites\n- Telegram bot (@BotFather)\n- Airtop account\n- OpenRouter account\n- Tavily account\n\n## \ud83d\udd11 Required Credentials\n\n### Telegram API Setup\n1. @BotFather \u2192 /newbot \u2192 get token\n2. Add as **Telegram API**\n\n### Airtop API Setup\n1. https://airtop.ai \u2192 Dashboard \u2192 API Keys \u2192 generate\n2. Add as **Airtop API**\n\n### OpenRouter API Setup\n1. https://openrouter.ai \u2192 API Keys \u2192 generate\n2. Add as **OpenRouter API**\n\n### Tavily API Setup\n1. https://app.tavily.com \u2192 API Keys \u2192 generate\n2. Add as **Tavily API**\n\n## \u2699\ufe0f Configuration Steps\n1. Import JSON\n2. Assign credentials\n3. Activate workflow\n4. Send URL to bot\n5. Adjust thresholds if needed\n\n## \ud83c\udfaf Use Cases\n- Safe research summaries\n- Privacy-focused doc extraction\n- Content insight bots\n- Educational resource analysis\n\n## \u26a0\ufe0f Troubleshooting\n- No response: Check URL format\n- Blocks too much: Tweak guardrails\n- Extraction fails: Test simple sites\n- Limits: Monitor APIs"
},
"typeVersion": 1
},
{
"id": "81a37776-5520-40f4-a8e4-dc474f329218",
"name": "Telegram Trigger1",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-2224,
5200
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {},
"typeVersion": 1.2
},
{
"id": "3e7eda0e-9065-4872-a435-f8015c89d471",
"name": "Note: Trigger2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2352,
4976
],
"parameters": {
"color": 6,
"width": 320,
"height": 192,
"content": "## \ud83d\udce5 Telegram Trigger\n\n**Purpose:** Listens for incoming messages in Telegram chat.\n\n**Note:** Configured for message updates; activate workflow to enable."
},
"typeVersion": 1
},
{
"id": "526608dd-27d7-4794-bfb1-57d3c854029f",
"name": "Note: Agent1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1248,
4848
],
"parameters": {
"color": 5,
"width": 320,
"height": 192,
"content": "## \ud83e\udde0 Main Agent\n\n**Purpose:** Processes safe content with OpenRouter model to generate response.\n\n**Note:** Includes Tavily tool for web searches if needed."
},
"typeVersion": 1
},
{
"id": "14fe6c3a-f1f4-4921-9be6-9b6346831da4",
"name": "Main agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1296,
5072
],
"parameters": {
"options": {
"systemMessage": "Respond to the input question concisely and appropriately."
},
"promptType": "guardrails"
},
"typeVersion": 3
}
],
"connections": {
"Main agent": {
"main": [
[
{
"node": "Send Safe Response",
"type": "main",
"index": 0
}
]
]
},
"Filter Only URLs": {
"main": [
[
{
"node": "Extract Q&A from URL",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Model": {
"ai_languageModel": [
[
{
"node": "Apply Safety Guardrails",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Main agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Tavily Web Search": {
"ai_tool": [
[
{
"node": "Main agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Telegram Trigger1": {
"main": [
[
{
"node": "Filter Only URLs",
"type": "main",
"index": 0
}
]
]
},
"Extract Q&A from URL": {
"main": [
[
{
"node": "Apply Safety Guardrails",
"type": "main",
"index": 0
}
]
]
},
"Apply Safety Guardrails": {
"main": [
[
{
"node": "Main agent",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Violation Alert",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
airtopApitavilyApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Transform your Telegram bot into a secure content analyzer: send any URL, and get safe, structured Q&A extractions with AI-powered safety checks and web search capabilities.
Source: https://n8n.io/workflows/10849/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.
This workflow transforms your Telegram bot into an intelligent creative assistant. It can chat conversationally, fetch trending image prompts from PromptHero for inspiration, or perform a deep "remix"
AI-powered Telegram bot for effortless expense tracking. Send receipts, voice messages, or text - the bot automatically extracts and categorizes your expenses. 📸 Receipt & Invoice OCR - Send photos of
Turn your Telegram into a personal Bloomberg terminal. Ask any question about any stock — get institutional-grade analysis back in seconds. TwelveData Pro Analyst is a complete, ready-to-import n8n wo