This workflow corresponds to n8n.io template #12433 — we link there as the canonical source.
This workflow follows the Agent → Google Gemini 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 →
{
"id": "dAGxJYdLo4qGeDkJ",
"name": "Monitor real estate filings via Telegram, BrowserAct and Gemini",
"tags": [],
"nodes": [
{
"id": "587e2c01-0dd7-4c02-9641-483580bf7221",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-160,
656
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n \"type\": \"chat\"\n}"
},
"typeVersion": 1.3
},
{
"id": "4b48e12d-ca1b-42f9-8b95-a7a87f248ed1",
"name": "Validate user Input",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-272,
448
],
"parameters": {
"text": "=User Input :{{ $('User Sends Message to Bot').first().json.message.text }}",
"options": {
"systemMessage": "You are an Intent Classifier and Data Mapper.\n\nInput Format\nYou will receive a single text string containing three labeled parts: User Input : [TEXT]\n\nLogic Rules\nCASE 1: Real Estate / Lis Pendens Request\nCondition: The \"User Input\" text asks for \"real estate data,\" \"Lis Pendens,\" \"filings,\" or \"records.\"\n\nAction:\n\nSet type to \"Real_State\".\n\nOutput:\n\n\n{\n \"type\": \"Real_State\",\n}\nCASE 2: Chat\nCondition: The \"User Input\" is a greeting, joke, or general conversation.\n\nAction: Flag as chat and set dates to null.\n\nOutput:\n\n\n{\n \"type\": \"chat\",\n}\nOutput Format\nReturn ONLY the JSON object. No markdown, no whitespace padding, no backticks."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3
},
{
"id": "218e56b4-a771-4984-9a78-d09b41875b55",
"name": "Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
384,
1056
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "18f7d5e8-7c78-44fa-9925-bcb41e43744d",
"name": "Send Alert",
"type": "n8n-nodes-base.telegram",
"position": [
448,
288
],
"parameters": {
"text": "=Ok give me few minutes.",
"chatId": "={{ $('User Sends Message to Bot').first().json.message.chat.id }}",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "7498192b-b94d-4a33-85fc-46999779e970",
"name": "Structured Output",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1552,
752
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n \"Telegram\": [\n \"String 1 (Header + Records 1-N)\",\n \"String 2 (Records N+1 to End)\"\n ]\n}"
},
"typeVersion": 1.3
},
{
"id": "eadb29d1-316e-41b8-95ca-f41f5d2b287d",
"name": "OpenRouter Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
1408,
768
],
"parameters": {
"model": "openai/gpt-4.1",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "9ff19cd1-665d-4f29-97b7-5e855e4817be",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2304,
528
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "3064ab17-d8df-4ff7-b689-1244fd904019",
"name": "OpenRouter Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-304,
672
],
"parameters": {
"model": "openai/gpt-4.1",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "691a5056-a4c0-49c5-910c-5fa1bbe82aca",
"name": "Check For Input Type",
"type": "n8n-nodes-base.switch",
"position": [
80,
448
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9e003f66-d011-459a-a313-b603c0e14551",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.type }}",
"rightValue": "Real_State"
}
]
}
},
{
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2ebb24ec-bd32-4e96-a022-93d066fda17f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.output.type }}",
"rightValue": "chat"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.4
},
{
"id": "ae9e6c4f-3075-4f95-baf1-bc242d3c2888",
"name": "Today's Date",
"type": "n8n-nodes-base.dateTime",
"position": [
400,
608
],
"parameters": {
"options": {},
"outputFieldName": "Today"
},
"typeVersion": 2
},
{
"id": "6ae16ce2-5cc5-4a04-9c25-687e0194f8b6",
"name": "Calculate \"To_Date\"",
"type": "n8n-nodes-base.dateTime",
"position": [
448,
432
],
"parameters": {
"options": {},
"outputFieldName": "To_Date"
},
"typeVersion": 2
},
{
"id": "de2c6b53-dafe-459a-8190-a7a60a50b4d9",
"name": "Calculate \"From_Date\"",
"type": "n8n-nodes-base.dateTime",
"position": [
528,
608
],
"parameters": {
"options": {},
"duration": -5,
"magnitude": "={{ $json.Today }}",
"operation": "addToDate",
"outputFieldName": "From_Date"
},
"typeVersion": 2
},
{
"id": "6afda203-2e3f-4969-ae63-d7c8739d566c",
"name": "Format To_Date to Specific Format",
"type": "n8n-nodes-base.code",
"position": [
720,
432
],
"parameters": {
"jsCode": "const inputString = $input.first().json.To_Date;\nconst date = new Date(inputString);\n\n// Format the date\nconst formattedDate = date.toLocaleDateString('en-US');\n\n// Return as an array of objects\nreturn [{ \n original_date: inputString,\n to_date: formattedDate \n}];"
},
"typeVersion": 2
},
{
"id": "db14cc65-787a-4c06-8ebf-301737fcff17",
"name": "Format From_Date to Specific Format",
"type": "n8n-nodes-base.code",
"position": [
720,
608
],
"parameters": {
"jsCode": "const inputString = $input.first().json.From_Date;\nconst date = new Date(inputString);\n\n// Format the date\nconst formattedDate = date.toLocaleDateString('en-US');\n\n// Return as an array of objects\nreturn [{ \n original_date: inputString,\n from_date: formattedDate \n}];"
},
"typeVersion": 2
},
{
"id": "a230a29b-807a-4c53-8d9f-2013eddb7a67",
"name": "Wait for Both Paths",
"type": "n8n-nodes-base.merge",
"position": [
944,
528
],
"parameters": {
"mode": "chooseBranch"
},
"typeVersion": 3.2
},
{
"id": "580f65d5-05e2-4a46-b05a-8276647a1dff",
"name": "Extract Lis Pendens Data",
"type": "n8n-nodes-browseract.browserAct",
"position": [
1104,
528
],
"parameters": {
"type": "WORKFLOW",
"workflowId": "72087493450042645",
"workflowConfig": {
"value": {
"input-Today": "={{ $('Format To_Date to Specific Format').first().json.to_date }}",
"input-From_Date": "={{ $('Format From_Date to Specific Format').first().json.from_date }}"
},
"schema": [
{
"id": "input-Texas_Records",
"type": "string",
"display": true,
"removed": true,
"required": false,
"description": "If left blank, the default value defined in BrowserAct will be used.",
"displayName": "Texas_Records",
"defaultMatch": true
},
{
"id": "input-From_Date",
"type": "string",
"display": true,
"removed": false,
"required": false,
"description": "If left blank, the default value defined in BrowserAct will be used.",
"displayName": "From_Date",
"defaultMatch": true
},
{
"id": "input-Today",
"type": "string",
"display": true,
"removed": false,
"required": false,
"description": "If left blank, the default value defined in BrowserAct will be used.",
"displayName": "Today",
"defaultMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"input-Today"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"open_incognito_mode": false
},
"credentials": {
"browserActApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "7cdee7d5-508e-496a-a530-e8428235e552",
"name": "Analyze Data & Format for Telegram",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1456,
528
],
"parameters": {
"text": "={{ $json.output.string }}",
"options": {
"systemMessage": "**Role:**\nYou are a Real Estate Data Formatting Agent. Your goal is to convert raw JSON data regarding \"Lis Pendens\" filings into a structured, highly readable Telegram HTML format.\n\n**Input:**\nYou will receive a JSON array containing objects with the following keys: `file_number`, `file_date`, `names`, `legal_description`, and `film_code_link`.\n\n**Task:**\n1. Parse the input JSON.\n2. Format each object into a visually appealing HTML text block suitable for Telegram.\n3. Consolidate these blocks into messages.\n4. Ensure no single message exceeds 3500 characters. If the content exceeds this limit, split it into multiple strings within the output array.\n5. Return the final result as a valid JSON object.\n\n**Formatting Guidelines (Per Record):**\nFor each item in the input array, generate a block using the following template:\n\n---\n\ud83d\udcc2 <b>File:</b> <code>{file_number}</code>\n\ud83d\udcc5 <b>Date:</b> {file_date}\n\ud83d\udccd <b>Legal Desc:</b> {legal_description}\n\ud83d\udc65 <b>Parties:</b>\n{names_processed}\n\n\ud83d\udd17 <a href=\"{film_code_link}\"><b>DOWNLOAD DOCUMENT</b></a>\n\u26a0\ufe0f <i>(Sign-in required to view)</i>\n---\n\n**Processing Rules:**\n1. **HTML Tags:** Use only Telegram-supported tags: `<b>`, `<i>`, `<u>`, `<s>`, `<a>`, `<code>`, `<pre>`.\n2. **Names Field:** The `names` field often contains multiple parties separated by semicolons (`;`). You must formatting this field for readability. Replace semicolons with a newline character combined with a small bullet point (e.g., `\\n\u25ab\ufe0f `).\n3. **Links:** Embed the `film_code_link` into the text \"DOWNLOAD DOCUMENT\".\n4. **Separators:** distinct records must be separated by an empty line to ensure readability.\n5. **Header:** The *first* message in the array should start with a summary header: \"\ud83d\udce2 <b>New Lis Pendens Filings</b>\\n\\n\".\n6. **Splitting:**\n * Continuously estimate the character count of the generated HTML.\n * If adding the next record would push the character count above 3500 characters, stop the current string, close it, and start a new string in the output array.\n * Do not break a single record in half; split only *between* records.\n\n**Output Format:**\nYou must output strict JSON only. Do not add markdown code blocks (```json) around the output.\n\nStructure:\n{\n \"Telegram\": [\n \"String 1 (Header + Records 1-N)\",\n \"String 2 (Records N+1 to End)\",\n ...\n ]\n}"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3
},
{
"id": "38cbb09f-e463-4799-8355-c3a1ea91e202",
"name": "Split Out Generated Content",
"type": "n8n-nodes-base.splitOut",
"position": [
2112,
528
],
"parameters": {
"options": {},
"fieldToSplitOut": "output.Telegram"
},
"typeVersion": 1
},
{
"id": "3deefef0-536a-416a-ada6-b0eba12b5783",
"name": "Prevent Rate Limits",
"type": "n8n-nodes-base.wait",
"position": [
2528,
480
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "527a0211-c8d1-47bd-a2a2-2207e66cd7b0",
"name": "Send Lead Data to Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
2768,
544
],
"parameters": {
"text": "={{ $('Loop Over Items').item.json[\"output.Telegram\"] }}",
"chatId": "={{ $('User Sends Message to Bot').first().json.message.chat.id }}",
"additionalFields": {
"parse_mode": "HTML"
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "36227764-de02-481d-b1eb-1ddb5ddbae74",
"name": "Chatting With User",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
384,
912
],
"parameters": {
"text": "=Input type : {{ $json.output.Type }} | User Input : {{ $('User Sends Message to Bot').item.json.message.text }}",
"options": {
"systemMessage": "if the user input type is chat, analyze the user input and generate single response\nsend the result out as a raw text.\navoid using any tags or notations like ```text ```"
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "e166b9cb-e91d-461e-b6a5-c8574ee29359",
"name": "Answer the User",
"type": "n8n-nodes-base.telegram",
"position": [
688,
912
],
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('User Sends Message to Bot').item.json.message.chat.id }}",
"additionalFields": {
"parse_mode": "HTML",
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "6fe30f91-b082-4d8b-9649-a5b9369cc0f7",
"name": "Documentation",
"type": "n8n-nodes-base.stickyNote",
"position": [
-864,
-160
],
"parameters": {
"color": 6,
"width": 380,
"height": 524,
"content": "## \u26a1 Workflow Overview & Setup\n\n**Summary:** This automation monitors real estate public records (specifically Lis Pendens filings) via Telegram, using BrowserAct to scrape government databases and Gemini to deliver structured lead reports.\n\n### Requirements\n* **Credentials:** Telegram, BrowserAct, OpenRouter (GPT-4), Google Gemini (PaLM).\n* **Mandatory:** BrowserAct API (Template: **Texas Foreclosure Leads**)\n\n### How to Use\n1. **Credentials:** Configure your API keys for Telegram, BrowserAct, and the respective AI models in n8n.\n2. **BrowserAct Template:** Ensure you have the **Texas Foreclosure Leads** template saved in your BrowserAct account.\n3. **Operation:** Send a message like \"Get recent filings\" to your Telegram bot. The system will automatically calculate the date range (last 5 days) and start the extraction.\n\n### Need Help?\n[How to Find Your BrowserAct API Key & Workflow ID](https://docs.browseract.com)\n[How to Connect n8n to BrowserAct](https://docs.browseract.com)\n[How to Use & Customize BrowserAct Templates](https://docs.browseract.com)"
},
"typeVersion": 1
},
{
"id": "1e17ab9d-b1ff-40f5-bdd3-fd12eadd0c44",
"name": "Step 1 Explanation",
"type": "n8n-nodes-base.stickyNote",
"position": [
-448,
240
],
"parameters": {
"color": 7,
"width": 636,
"height": 124,
"content": "### \ud83d\udd75\ufe0f Step 1: Input Classification\n\nThe workflow triggers via Telegram and uses an AI agent to distinguish between a casual chat and a specific real estate records request. If a data request is detected, the system immediately calculates a dynamic 5-day date range for the search."
},
"typeVersion": 1
},
{
"id": "48a745ab-f345-4ad0-a28d-df7a6704ea1d",
"name": "Step 2 Explanation",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
128
],
"parameters": {
"color": 7,
"width": 892,
"height": 124,
"content": "### \ud83c\udf10 Step 2: Automated Data Extraction\n\nBrowserAct executes an automated browser session to access public records databases. It inputs the generated date range and scrapes all relevant Lis Pendens filings, including file numbers, parties involved, and legal descriptions."
},
"typeVersion": 1
},
{
"id": "922c16a8-1206-44a6-aa58-6d47ca222fce",
"name": "Step 3 Explanation",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
352
],
"parameters": {
"color": 7,
"width": 716,
"height": 128,
"content": "### \ud83d\udcca Step 3: AI Analysis & Formatting\n\nA Data Formatting agent parses the raw JSON results, sanitizing the party names and legal text. It structures the data into scannable blocks, ensuring that each Telegram message stays within the 3500-character safety limit to avoid API errors."
},
"typeVersion": 1
},
{
"id": "729d980d-b561-443e-a2d0-f4e7c27415b9",
"name": "Step 4 Explanation",
"type": "n8n-nodes-base.stickyNote",
"position": [
2096,
352
],
"parameters": {
"color": 7,
"width": 840,
"height": 120,
"content": "### \ud83d\ude80 Step 4: Final Delivery\n\nThe formatted reports are split into sequential messages and delivered to the user via Telegram. The workflow includes rate-limit prevention to ensure reliable delivery of high-volume filing reports."
},
"typeVersion": 1
},
{
"id": "cf443073-5c4e-4f7f-9a47-6419789c4077",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-432,
-160
],
"parameters": {
"color": 6,
"width": 608,
"height": 352,
"content": "@[youtube](Q2zUXDDhD8w)"
},
"typeVersion": 1
},
{
"id": "29fc46cf-7496-46ad-b770-e5d39b9abbb7",
"name": "Step 4 Explanation1",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
1168
],
"parameters": {
"color": 7,
"width": 580,
"height": 120,
"content": "### \ud83d\udcac Step 2-2: Conversational Fallback\n\nThis branch engages the user in natural conversation and answers them."
},
"typeVersion": 1
},
{
"id": "3704528b-6430-46d0-a45b-d32b8719c107",
"name": "User Sends Message to Bot",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-432,
448
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "379ab091-362f-4c28-be52-73217d862020",
"connections": {
"Today's Date": {
"main": [
[
{
"node": "Calculate \"From_Date\"",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini": {
"ai_languageModel": [
[
{
"node": "Chatting With User",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Prevent Rate Limits",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Model": {
"ai_languageModel": [
[
{
"node": "Analyze Data & Format for Telegram",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Structured Output",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Model1": {
"ai_languageModel": [
[
{
"node": "Validate user Input",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Structured Output Parser",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output": {
"ai_outputParser": [
[
{
"node": "Analyze Data & Format for Telegram",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Chatting With User": {
"main": [
[
{
"node": "Answer the User",
"type": "main",
"index": 0
}
]
]
},
"Calculate \"To_Date\"": {
"main": [
[
{
"node": "Format To_Date to Specific Format",
"type": "main",
"index": 0
}
]
]
},
"Prevent Rate Limits": {
"main": [
[
{
"node": "Send Lead Data to Telegram",
"type": "main",
"index": 0
}
]
]
},
"Validate user Input": {
"main": [
[
{
"node": "Check For Input Type",
"type": "main",
"index": 0
}
]
]
},
"Wait for Both Paths": {
"main": [
[
{
"node": "Extract Lis Pendens Data",
"type": "main",
"index": 0
}
]
]
},
"Check For Input Type": {
"main": [
[
{
"node": "Send Alert",
"type": "main",
"index": 0
},
{
"node": "Calculate \"To_Date\"",
"type": "main",
"index": 0
},
{
"node": "Today's Date",
"type": "main",
"index": 0
}
],
[
{
"node": "Chatting With User",
"type": "main",
"index": 0
}
]
]
},
"Calculate \"From_Date\"": {
"main": [
[
{
"node": "Format From_Date to Specific Format",
"type": "main",
"index": 0
}
]
]
},
"Extract Lis Pendens Data": {
"main": [
[
{
"node": "Analyze Data & Format for Telegram",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Validate user Input",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"User Sends Message to Bot": {
"main": [
[
{
"node": "Validate user Input",
"type": "main",
"index": 0
}
]
]
},
"Send Lead Data to Telegram": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Split Out Generated Content": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Format To_Date to Specific Format": {
"main": [
[
{
"node": "Wait for Both Paths",
"type": "main",
"index": 0
}
]
]
},
"Analyze Data & Format for Telegram": {
"main": [
[
{
"node": "Split Out Generated Content",
"type": "main",
"index": 0
}
]
]
},
"Format From_Date to Specific Format": {
"main": [
[
{
"node": "Wait for Both Paths",
"type": "main",
"index": 1
}
]
]
}
}
}
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.
browserActApigooglePalmApiopenRouterApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow transforms your Telegram bot into an automated real estate monitoring tool. Send a message like "Check filings for the last 5 days," and the bot will scrape the official county clerk site for "Lis Pendens" (pre-foreclosure) filings, format the messy legal data into…
Source: https://n8n.io/workflows/12433/ — 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 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"
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
This workflow acts as an AI-powered "Viral Architect" for YouTube creators. Simply send a video topic (e.g., "Kling 2.6") to your Telegram bot, and it will scrape top-performing competitor thumbnails,
This workflow acts as an intelligent content engine. Simply send a link to your Telegram bot (e.g., a product page or news article), and it will automatically scrape the content, rewrite it into a hig
This workflow transforms text-based resume data into visually stunning images by leveraging Google Gemini's reasoning and vision capabilities. It autonomously analyzes the candidate's profile, selects