8
n8n 中文网amn8n.com

周边旧货集市(展示)

高级

这是一个Other领域的自动化工作流,包含 20 个节点。主要使用 If, Set, Html, Filter, SplitOut 等节点。 📍 通过Telegram发送每日附近旧货集市提醒

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "xR7g6JLAHXJScFEG",
  "meta": {
    "instanceId": "89af474e60c70a1e45bf242e266e9ca1446dd974ab86f6d185b8ccded3effed2",
    "templateCredsSetupCompleted": true
  },
  "name": "Garage Sales Around  (Showcase)",
  "tags": [
    {
      "id": "NabIyPgRf7ZggE5B",
      "name": "Showcase",
      "createdAt": "2025-06-03T15:41:30.076Z",
      "updatedAt": "2025-06-03T15:41:30.076Z"
    }
  ],
  "nodes": [
    {
      "id": "edb6065a-738e-41c8-9719-0ae928f8cace",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1200,
        -1005
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6ee2fbb2-3f5b-496d-97a3-74c9a33c5166",
      "name": "Get Brocabrac",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -540,
        -880
      ],
      "parameters": {
        "url": "={{ $json.URL }}",
        "options": {},
        "responseFormat": "string"
      },
      "typeVersion": 1
    },
    {
      "id": "1e824e88-b943-4b58-80c2-3761a821bd64",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        340,
        -880
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "ev"
      },
      "typeVersion": 1
    },
    {
      "id": "c11bbebc-cae5-4f55-a65c-3eaa943c117f",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        560,
        -880
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "42a7ed20-b88c-4ae7-8299-e753a4311982",
      "name": "Every day at 7 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1200,
        -800
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "30 7 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cabda7f6-6c14-4bbc-863f-403e129c1517",
      "name": "Get location",
      "type": "n8n-nodes-base.homeAssistant",
      "position": [
        -980,
        -880
      ],
      "parameters": {
        "entityId": "Your_Smartphone_location_sensor",
        "resource": "state"
      },
      "credentials": {
        "homeAssistantApi": {
          "id": "VurjB0xfUjis4pXd",
          "name": "Home Assistant account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3098fb12-99a0-4bf8-9cbc-a782c1b62663",
      "name": "Set URL to parse",
      "type": "n8n-nodes-base.set",
      "position": [
        -760,
        -880
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "54a5f609-4267-4367-bbbb-2c692730b536",
              "name": "URL",
              "type": "string",
              "value": "=https://brocabrac.fr/{{ $json.attributes.postal_code.slice(0,2) }}/{{ $json.attributes.locality }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "de23ed8b-d907-4bbb-ac22-08378c48e457",
      "name": "Extract Date & Blocks",
      "type": "n8n-nodes-base.html",
      "position": [
        -320,
        -880
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "Date",
              "attribute": "data-date",
              "cssSelector": "div.block.ev-list > div:nth-child(1) > div.section-title",
              "returnValue": "attribute"
            },
            {
              "key": "HTMLBlock",
              "cssSelector": "div.block.ev-list > div",
              "returnValue": "html"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "44b70afd-e751-4817-b853-187e290db2b4",
      "name": "Get Rank & Distance",
      "type": "n8n-nodes-base.set",
      "position": [
        1000,
        -880
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f5d111d1-3790-41c9-a395-69f1f327ef09",
              "name": "Distance",
              "type": "number",
              "value": "={{ $json.Distance.slice(0,-3) }}"
            },
            {
              "id": "6f72f72c-3a16-4a1a-87d9-13fdff32b25d",
              "name": "Rank",
              "type": "string",
              "value": "={{ $json.Rank.replaceAll('•','x') }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "e3da6c6a-0a45-4cb7-abd7-f4fc49555a06",
      "name": "Filter on close and bigger events",
      "type": "n8n-nodes-base.filter",
      "position": [
        800,
        -1660
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "143b57f3-23e9-4675-b667-4a08e74db9c1",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.Rank }}",
              "rightValue": ""
            },
            {
              "id": "3cfb49b7-5e8b-4783-af0b-b0b9f658b14c",
              "operator": {
                "type": "number",
                "operation": "lte"
              },
              "leftValue": "={{ $json.Distance }}",
              "rightValue": 20
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "76ed047f-ddc9-4fff-b8f6-1c2b36f06be1",
      "name": "Any today?",
      "type": "n8n-nodes-base.if",
      "position": [
        -100,
        -880
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "03b76adc-e818-44cc-9a99-12d03a33b099",
              "operator": {
                "type": "dateTime",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Date.toDateTime() }}",
              "rightValue": "={{ $today.plus({days}) }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7c9021a5-6907-4956-9b86-c8d6a960fff5",
      "name": "Extract Garage Sales Events",
      "type": "n8n-nodes-base.html",
      "position": [
        120,
        -880
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "dataPropertyName": "HTMLBlock",
        "extractionValues": {
          "values": [
            {
              "key": "ev",
              "cssSelector": "div.ev",
              "returnArray": true,
              "returnValue": "html"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ba984d37-184f-4a8d-b2aa-b06f78222292",
      "name": "Get each Garage Sale info",
      "type": "n8n-nodes-base.html",
      "position": [
        780,
        -880
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "dataPropertyName": "ev",
        "extractionValues": {
          "values": [
            {
              "key": "City",
              "cssSelector": "span.city"
            },
            {
              "key": "Distance",
              "cssSelector": "span.dist"
            },
            {
              "key": "Rank",
              "cssSelector": "span.dots"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a790ab8e-746b-46ba-bcb3-a611662636df",
      "name": "Send an Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1500,
        -1660
      ],
      "webhookId": "42c6d21a-ea60-4b37-8822-46a41ef9bdf1",
      "parameters": {
        "text": "={{ $json.message }}",
        "chatId": "Your_Chat_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "ANiBkg3Tng36ZRwP",
          "name": "Telegram account (n8n)"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c05d53df-98f2-4f29-8b69-e3652e9443f6",
      "name": "Shape the response",
      "type": "n8n-nodes-base.set",
      "position": [
        1020,
        -1660
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3516d92b-fda3-4441-a059-639db5bd29cf",
              "name": "Brocante",
              "type": "string",
              "value": "={{ $json.City }} ({{ $json.Rank }} à {{ $json.Distance }} km)"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ec425780-841b-451d-8160-b66890828fd4",
      "name": "Set the message",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        -1660
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "22ff618b-d768-46bf-83b6-64c60ed1407b",
              "name": "message",
              "type": "string",
              "value": "=📦🏡 Voici les brocantes : - {{ $json.Brocante }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ea4f3e9d-291e-4557-b242-eea7dac2dd5c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -820,
        -1320
      ],
      "parameters": {
        "width": 640,
        "height": 660,
        "content": "## 1️⃣ Fetch & Parse Garage Sale Data\n### What happens:\n- An HTTP request retrieves the HTML content of the Brocabrac page for the current location.\n- The workflow extracts two pieces of data:\n  - Date (the day events are listed for)\n  - HTMLBlock (the full block of garage sales info)\n- It checks if any events are scheduled for today.\n- If yes, it extracts all div.ev entries representing individual garage sales.\n\n### Purpose:\nConverts a static webpage into structured data, ready for processing."
      },
      "typeVersion": 1
    },
    {
      "id": "6692692d-c5f7-427f-a95b-ebe00042bb91",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -1320
      ],
      "parameters": {
        "width": 1400,
        "height": 660,
        "content": "## 2️⃣ Process, Filter & Extract Relevant Events\nWhat happens:\n- Splits the list of garage sale entries and loops over each.\n- From each block, it extracts:\n  - City\n  - Distance\n  - Rank (event importance indicator using dots)\n- Cleans up the data (e.g., removes \"km\" from distance, replaces \"•\" in rank).\n- Filters events based on two criteria:\n  - Distance ≤ 20 km\n  - Rank must be present (indicating notable size or popularity)\n\nPurpose:\nFilters out irrelevant or too-distant events to surface only the best nearby options."
      },
      "typeVersion": 1
    },
    {
      "id": "33aa481c-f216-4fee-aa0f-01fdd0db92ae",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -2040
      ],
      "parameters": {
        "width": 1020,
        "height": 620,
        "content": "## 3️⃣ Format & Send Notifications via Telegram\n### What happens:\n- The remaining filtered events are formatted into a clean string like:\n  ```\n  City (Rank à Distance km)\n  ```\n- These are combined into a single message like:\n  ```\n  📦🏡 Voici les brocantes : - City1 (...) - City2 (...)\n  ```\n- The final message is sent to the user via Telegram.\n\n### Purpose:\nDelivers timely, relevant alerts about today’s garage sales in a user-friendly way."
      },
      "typeVersion": 1
    },
    {
      "id": "05b97c78-ece0-4b20-8d4a-9814aaabaf4c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1380,
        -1320
      ],
      "parameters": {
        "width": 520,
        "height": 660,
        "content": "## 0️⃣ Daily Trigger & Geolocation Setup\n### What happens:\n- The workflow is triggered either manually or automatically every day at 7 AM (Schedule Trigger node).\n- It fetches the current location of a mobile phone using a Home Assistant sensor.\n- It then builds a dynamic URL based on the user’s geolocation (postal code and locality) to query Brocabrac.fr for local garage sales.\n\n### Purpose:\nEnsures the data being fetched is location-aware and always relevant to the user's current position."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ab2abd4b-1f04-4e48-bd2f-79ff028962c4",
  "connections": {
    "1e824e88-b943-4b58-80c2-3761a821bd64": {
      "main": [
        [
          {
            "node": "c11bbebc-cae5-4f55-a65c-3eaa943c117f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "76ed047f-ddc9-4fff-b8f6-1c2b36f06be1": {
      "main": [
        [
          {
            "node": "7c9021a5-6907-4956-9b86-c8d6a960fff5",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "cabda7f6-6c14-4bbc-863f-403e129c1517": {
      "main": [
        [
          {
            "node": "3098fb12-99a0-4bf8-9cbc-a782c1b62663",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6ee2fbb2-3f5b-496d-97a3-74c9a33c5166": {
      "main": [
        [
          {
            "node": "de23ed8b-d907-4bbb-ac22-08378c48e457",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c11bbebc-cae5-4f55-a65c-3eaa943c117f": {
      "main": [
        [
          {
            "node": "e3da6c6a-0a45-4cb7-abd7-f4fc49555a06",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ba984d37-184f-4a8d-b2aa-b06f78222292",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ec425780-841b-451d-8160-b66890828fd4": {
      "main": [
        [
          {
            "node": "a790ab8e-746b-46ba-bcb3-a611662636df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3098fb12-99a0-4bf8-9cbc-a782c1b62663": {
      "main": [
        [
          {
            "node": "6ee2fbb2-3f5b-496d-97a3-74c9a33c5166",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "42a7ed20-b88c-4ae7-8299-e753a4311982": {
      "main": [
        [
          {
            "node": "cabda7f6-6c14-4bbc-863f-403e129c1517",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c05d53df-98f2-4f29-8b69-e3652e9443f6": {
      "main": [
        [
          {
            "node": "ec425780-841b-451d-8160-b66890828fd4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "44b70afd-e751-4817-b853-187e290db2b4": {
      "main": [
        [
          {
            "node": "c11bbebc-cae5-4f55-a65c-3eaa943c117f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "de23ed8b-d907-4bbb-ac22-08378c48e457": {
      "main": [
        [
          {
            "node": "76ed047f-ddc9-4fff-b8f6-1c2b36f06be1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ba984d37-184f-4a8d-b2aa-b06f78222292": {
      "main": [
        [
          {
            "node": "44b70afd-e751-4817-b853-187e290db2b4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7c9021a5-6907-4956-9b86-c8d6a960fff5": {
      "main": [
        [
          {
            "node": "1e824e88-b943-4b58-80c2-3761a821bd64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e3da6c6a-0a45-4cb7-abd7-f4fc49555a06": {
      "main": [
        [
          {
            "node": "c05d53df-98f2-4f29-8b69-e3652e9443f6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "edb6065a-738e-41c8-9719-0ae928f8cace": {
      "main": [
        [
          {
            "node": "cabda7f6-6c14-4bbc-863f-403e129c1517",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 其他

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量20
分类1
节点类型12
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Thibaud

Thibaud

@tderouze

Automation consultant with over 10 years experience helping Sales & Marketing teams to streamline their processes.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34