Local Event Finder

Avancé

Ceci est unAI, Marketingworkflow d'automatisation du domainecontenant 28 nœuds.Utilise principalement des nœuds comme JinaAiTool, McpClientTool, Agent, McpTrigger, ToolWorkflow, combinant la technologie d'intelligence artificielle pour une automatisation intelligente. Local Event Finder basé sur l'IA : prend en charge la recherche multi-outils

Prérequis
  • Clé API Google Gemini
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "jzyBdgtZyvqzRcus",
  "meta": {
    "instanceId": "3612a0c89f35a354ddd1216385240db51b4635fde7cae2a0d5004be915b832f3",
    "templateCredsSetupCompleted": true
  },
  "name": "Local Event Finder",
  "tags": [],
  "nodes": [
    {
      "id": "3896a94e-9d40-4bb7-a333-cce2bae94e33",
      "name": "Modèle de chat Google Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -40,
        1560
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-preview-05-20"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "c8jj7D6oz6RJ81qp",
          "name": "Google Gemini Context7"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "15dba0b1-3f9b-4ed4-9efe-f8be50da710b",
      "name": "Simple Mémoire",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        820,
        1620
      ],
      "parameters": {
        "sessionKey": "={{ $execution.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "83c73d4e-f4ae-4618-9ab4-0bcc05339395",
      "name": "brave_web_search",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1160,
        1300
      ],
      "parameters": {
        "toolName": "brave_web_search",
        "operation": "executeTool",
        "connectionType": "http",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', `Generate a JSON object with the parameters for the 'brave_web_search' tool.\nThe tool expects a JSON object with the following keys:\n- \"query\": (string, **required**) The search terms for the web search.\n- \"count\": (number, optional) The number of results to return per page. Maximum is 20. If not provided, a default value will be used by the service.\n- \"offset\": (number, optional) The pagination offset to retrieve a specific page of results. Maximum is 9. If not provided, the first page is returned.\n\nExample (required only):\n{\"query\": \"latest AI research\"}\n\nExample (with optionals):\n{\"query\": \"popular javascript frameworks\", \"count\": 10, \"offset\": 0}`, 'json') }}",
        "descriptionType": "manual",
        "toolDescription": "Performs a general web search using Brave Search. Ideal for finding event listings, articles, official event websites, or when a broader search beyond a specific immediate locality is necessary. Use for queries like 'music festivals [country] [month]' or 'tech conferences [year]'. Parameters: 'query' (required string), 'count' (optional number, max 20), 'offset' (optional number, max 9 for pagination)."
      },
      "credentials": {
        "mcpClientHttpApi": {
          "id": "izP58157WoLmqx5y",
          "name": "smithery brave search"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8ba5272c-d95b-48e3-b48d-0f6bedcdad5c",
      "name": "brave_local_search",
      "type": "n8n-nodes-mcp.mcpClientTool",
      "position": [
        1720,
        1300
      ],
      "parameters": {
        "toolName": "brave_local_search",
        "operation": "executeTool",
        "connectionType": "http",
        "toolParameters": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Tool_Parameters', `Generate a JSON object with the parameters for the 'brave_local_search' tool.\nThe tool expects a JSON object with the following keys:\n- \"query\": (string, **required**) The search terms for the local search (e.g., \"coffee shop downtown\", \"bookstore [zip code]\").\n- \"count\": (number, optional) The number of local results to return. Maximum is 20. If not provided, a default value will be used by the service.\n\nExample (required only):\n{\"query\": \"restaurants near Eiffel Tower\"}\n\nExample (with optional count):\n{\"query\": \"best parks in Berlin\", \"count\": 5}\n\nNote: This tool does not support an 'offset' parameter for pagination. It may fall back to web search if no local results are found.`, 'json') }}",
        "descriptionType": "manual",
        "toolDescription": "Searches for local events, venues, and points of interest using Brave Local Search. Best for queries targeting a specific city or area, like 'live music in [City Name] this weekend' or 'art workshops near [Address/Zip Code]'. May fall back to a general web search if no specific local results are found. Parameters: 'query' (required string), 'count' (optional number, max 20)."
      },
      "credentials": {
        "mcpClientHttpApi": {
          "id": "izP58157WoLmqx5y",
          "name": "smithery brave search"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9be2f212-43d9-4e31-a090-3b3e44195291",
      "name": "find_events",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -60,
        320
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "jzyBdgtZyvqzRcus",
          "cachedResultName": "Local Event Finder"
        },
        "description": "=This tool initiates a detailed search for local events. It gathers specific user requirements such as the type of event, preferred city and country, desired date range, and related interests. These inputs are then passed to an internal workflow to find and return matching event information.",
        "workflowInputs": {
          "value": {
            "city": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('city', `The primary city where the user wishes to find events. This should be a specific city name. Examples: 'Perth', 'Berlin', 'Tokyo'.`, 'string') }}",
            "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('query', `A specific search phrase or natural language description detailing the event(s) the user is looking for. Examples: 'outdoor jazz concerts', 'weekend food and wine festivals', 'mountain biking and craft beer gatherings'.`, 'string') }}",
            "country": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('country', `The country corresponding to the specified city, to help narrow the search geographically. Examples: 'Australia', 'Germany', 'Japan'.`, 'string') }}",
            "interests": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('interests', `A comma-separated list of user interests or keywords that help further refine the event search, complementing the main 'query'. Examples: 'live music, craft beer, hiking', 'technology, AI, startups', 'family activities, educational, outdoor'.`, 'string') }}",
            "date-range": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('date-range', `The desired timeframe for the events. This can be specific (e.g., 'July 15-20, 2025'), general (e.g., 'July 2025', 'next weekend'), or a season (e.g., 'Summer 2025'). The more specific, the better.`, 'string') }}"
          },
          "schema": [
            {
              "id": "query",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "city",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "country",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date-range",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date-range",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "interests",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "interests",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c1becac0-c6a1-4a2f-be3b-c69b7cb5a69a",
      "name": "even_finder_workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -500,
        1180
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "query"
            },
            {
              "name": "city"
            },
            {
              "name": "country"
            },
            {
              "name": "date-range"
            },
            {
              "name": "interests"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "fbec2433-db9a-43db-b143-551c624ee085",
      "name": "event_finder_agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        240,
        1180
      ],
      "parameters": {
        "text": "=Find relevant events based on the provided user profile and preferences.",
        "options": {
          "systemMessage": "=You are a specialized Local Event Finder assistant. Your mission is to discover relevant events tailored to user preferences and present them in a clear, engaging markdown format.\n\n**User Preferences to Consider:**\n*   **Query:** {{ $('even_finder_workflow').item.json.query }}\n*   **City:** {{ $('even_finder_workflow').item.json.city }}\n*   **Country:** {{ $('even_finder_workflow').item.json.country }}\n*   **Date Range:** {{ $('even_finder_workflow').item.json.date-range }}\n*   **Interests:** {{ $('even_finder_workflow').item.json.interests }}\n\n**Your Operational Protocol:**\n\n1.  **Event Discovery Goal:**\n    *   Identify 1 to 5 events that closely match all provided user criteria.\n    *   Focus on quality and relevance over quantity.\n\n2.  **Location Search Strategy:**\n    *   **Primary Focus:** The specified `City`.\n    *   **Secondary Search:** If results are sparse, expand to nearby cities or statewide within the `Country`.\n    *   **Tertiary Search (Optional):** For exceptionally fitting events based on interests, consider the nearest capital city or other major capital cities in the `Country`.\n\n3.  **Tool Usage Guidelines:**\n    *   **`brave_local_search`**: Use this first for precise, location-based queries (e.g., \"live music in {{ $('even_finder_workflow').item.json.city }} this weekend\").\n    *   **`brave_web_search`**: Employ for broader event searches, finding event listings, or if local search is insufficient (e.g., \"mountain biking events {{ $('even_finder_workflow').item.json.country }} in {{ $('even_finder_workflow').item.json.date-range }}\").\n    *   **`google_gemini_event_search`**: Utilize for more complex queries, combining multiple interests, or as a powerful alternative if other searches are not fruitful. This tool can help synthesize information and understand nuanced requests.\n    *   **`jina_ai_web_page_scraper`**: After identifying promising event URLs from search results, use this tool to extract detailed information directly from the event pages.\n        *   **Critical Usage Note:** Due to a 60-second MCP server timeout (as of June 2025), use `jina_ai_web_page_scraper` very selectively. Scrape a maximum of 1-2 essential URLs per event discovery session to avoid timeouts. Prioritize official event pages.\n\n4.  **Information Extraction per Event:**\n    For each recommended event, strive to find and include:\n    *   Event Name\n    *   Date(s) and Time(s)\n    *   Full Location Address/Venue Name\n    *   A concise and engaging Description\n    *   Official Event Link (highly preferred)\n    *   Booking/Ticket Link (if available and distinct from the event link)\n\n5.  **Response Formatting:**\n    *   Present your findings in well-structured markdown.\n    *   Use headings (e.g., `##`), bullet points (`*`), bolding (`**text**`), and relevant emojis to enhance readability and visual appeal.\n    *   Clearly separate information for each event.\n\n6.  **Handling No Results:**\n    *   If, after a thorough search (including expanded location criteria), no suitable events are found, clearly and politely inform the user.\n\n**Example Structure for a Single Event in Your Response:**\n\n---\n🎉 **[Event Name]** 🎉\n*   **📅 Date & Time:** [Event Date(s)], [Event Time(s)]\n*   **📍 Location:** [Venue Name, Full Address, City]\n*   **📝 Description:** [A brief, enticing summary of what the event offers and how it matches user interests.]\n*   **🔗 Event Link:** [Link to Official Event Page]\n*   **🎟️ Booking Link:** [Link to Booking/Tickets, if available]\n---\n\nPrioritize accuracy, relevance, and the direct usability of the information provided. Ensure any links are functional."
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "2cb94f37-21fc-48d7-8661-3d3270bae356",
      "name": "local_event_finder",
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "position": [
        -220,
        -80
      ],
      "webhookId": "0ca88864-ec0a-4c27-a7ec-e28c5a900697",
      "parameters": {
        "path": "0ca88864-ec0a-4c27-a7ec-e28c5a900697"
      },
      "typeVersion": 1
    },
    {
      "id": "a8afc19d-8394-4e4d-bd6a-047e665b5a68",
      "name": "google_gemini_event_search",
      "type": "n8n-nodes-gemini-search.geminiSearchToolTool",
      "position": [
        2300,
        1300
      ],
      "parameters": {
        "model": "gemini-2.5-flash-preview-05-20",
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', `Formulate a concise and effective search query for finding events. Combine the user's primary query, interests, desired location (city/country), and date range. Focus on keywords that an advanced search engine like Gemini can use to find specific event listings or relevant information. Example: \"family-friendly music festivals Perth Australia July 2025\" or \"tech conferences with AI workshops Berlin next quarter\".`, 'string') }}",
        "options": {
          "extractSourceUrl": true
        },
        "organization": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Organization_Context', `(Optional) Provide any specific organizational context that might help refine the event search. This could relate to the type of organizations hosting the events (e.g., 'community groups', 'official city event organizers', 'universities') or a broader theme. Only use if a specific context is likely to improve results, otherwise leave blank or provide a general statement like 'public events'.`, 'string') }}",
        "restrictUrls": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Restrict_Search_to_URLs', `(Optional) Provide a comma-separated list of specific website URLs if the search should be restricted to known, trusted sources (e.g., official tourism sites, major event listing platforms for the region). Use this sparingly and only when confident that the desired events are likely to be found on those specific sites. Example: 'cityofperth.events.wa.gov.au, eventbrite.com.au'. Leave blank to search the broader web.`, 'string') }}",
        "toolDescription": "Leverages Google's Gemini model for advanced, context-aware event searching. Use this for complex queries, combining multiple interests (e.g., 'family-friendly outdoor art festivals in [Region] during [Month] with accessibility options'), or when other search tools need a more nuanced understanding. Can extract source URLs. Key Parameters: 'query' (string), 'organization' (string, for context), 'restrictUrls' (string, for specific sites)."
      },
      "credentials": {
        "geminiSearchApi": {
          "id": "grHOyabfaEb2A17I",
          "name": "Gemini Credentials account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5f733091-c9b0-4dd8-90f0-9eee8af122dd",
      "name": "jina_ai_web_page_scraper",
      "type": "n8n-nodes-base.jinaAiTool",
      "position": [
        2880,
        1300
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Provide the full, direct URL of a web page that contains detailed information about a specific event. This URL should ideally be an official event page or a highly relevant listing page that was identified by a previous search step (e.g., from brave_web_search or google_gemini_event_search). Ensure the URL is valid and points to the content you want to extract. Example: 'https://example.com/events/specific-event-details'. Remember to use this tool sparingly (max 1-2 URLs per workflow run) due to potential timeouts.`, 'string') }}",
        "options": {
          "outputFormat": "markdown",
          "enableImageCaptioning": true
        },
        "requestOptions": {},
        "descriptionType": "manual",
        "toolDescription": "Extracts and summarizes the main textual content from a given web page URL, returning it in markdown format. Use this to get detailed information (like descriptions, schedules, specific features) from event pages identified by search tools. Parameter: 'url' (required string). Critical: Use sparingly (1-2 URLs max) due to execution time limits."
      },
      "credentials": {
        "jinaAiApi": {
          "id": "Ds8w0d9HhKCi6twc",
          "name": "Jina AI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "48198d3f-6c86-4b95-a0f2-a04eac3d8c36",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -900
      ],
      "parameters": {
        "color": 7,
        "width": 760,
        "height": 320,
        "content": "## 📞 MCP Client Configuration\n\nExternal clients (like other n8n workflows, Roo Code, or Cline) configure this agent as a tool.\n\n**Example Client Tool Configuration (e.g., for Roo Code/Cline):**\n```json\n\"local-event-finder\": {\n      \"url\": \"https://YOUR-MCP-HOST/mcp/YOUR-MCP-SERVER-PATH/sse\",\n      \"alwaysAllow\": [\n        \"find_events\"\n      ],\n      \"timeout\": 3600\n    }"
      },
      "typeVersion": 1
    },
    {
      "id": "50d4814b-eee3-46be-bdc5-2d730872b34d",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 840,
        "height": 320,
        "content": "## 📡 local_event_finder (MCP Server Trigger)\n\n🚪 **Entry Point for External Calls**\n*   **Purpose:** Receives requests from external clients to use the \"Local Event Finder\" agent.\n*   **Function:** Listens for HTTP POST requests formatted for MCP.\n*   **Tool Exposed:** Exposes the `find_events` tool capability.\n*   **Typical Input:** JSON payload containing `tool_name: \"find_events\"` and `tool_input` (with query, city, etc.).\n*   **Typical Output:** Passes the `tool_input` to the `find_events` (Tool Workflow) no"
      },
      "typeVersion": 1
    },
    {
      "id": "71e54414-aa7c-4cab-b537-257ff762108f",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        60
      ],
      "parameters": {
        "color": 4,
        "width": 840,
        "height": 320,
        "content": "## ➡️ find_events (Tool Workflow Node)\n\n📞 **Invokes the Agent Logic**\n*   **Purpose:** This node acts as the bridge, formally calling the agent's core logic which, in this combined workflow, is triggered by the `even_finder_workflow` (Execute Workflow Trigger) node.\n*   **Action:** Calls the \"Local Event Finder\" workflow itself to execute the agent logic.\n*   **Inputs:** Receives `query`, `city`, `country`, `date-range`, `interests` from the MCP Trigger's parsed input.\n*   **Outputs:** Passes these inputs to the `even_finder_workflow` (Execute Workflow Trigger) node within this same workflow. The final output of the agent logic (from `event_finder_agent`) will be the result of this tool call."
      },
      "typeVersion": 1
    },
    {
      "id": "e6b00332-ce68-4fce-8238-52e19c746445",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        -520
      ],
      "parameters": {
        "color": 7,
        "width": 760,
        "height": 320,
        "content": "## 🗺️ Main MCP Server Workflow Overview (Conceptual Area)\n\n**Agent Name:** Local Event Finder\n*   **Gateway Function:** This section of the workflow acts as an MCP (Multi-Capability Peer) Server, making the \"Local Event Finder\" AI agent accessible as a tool to other systems.\n*   **Trigger:** `local_event_finder` (MCP Trigger) receives external requests.\n*   **Tool Workflow Node:** `find_events` node packages the request and invokes the agent's core logic within this same workflow.\n*   **Data Flow:** External Request -> `local_event_finder` -> `find_events` -> `even_finder_workflow` (starts agent logic).\n*   **Pattern:** This setup demonstrates an n8n AI Agent exposed via an MCP Server. In this case, both server and agent logic reside in a single, self-contained workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "b87c9502-1805-435f-a922-e932dcdc11e7",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -1200
      ],
      "parameters": {
        "color": 3,
        "width": 740,
        "height": 240,
        "content": "## 📄 Workflow Information\n\n*   **Workflow Name:** Local Event Finder (acts as both MCP Server & Agent Logic)\n*   **Version:** 1.0.0\n*   **Last Updated:** 2025-06-09\n*   **👤 Author:** Jeremy Dawes, Jezweb ([www.jezweb.com.au](https://www.jezweb.com.au/))\n*   **Description:** This workflow serves as an MCP endpoint for the \"Local Event Finder\" AI agent. It receives requests, passes them to the agent logic, and returns the found events."
      },
      "typeVersion": 1
    },
    {
      "id": "8974efe8-c3d2-43f4-a340-ee346ce08548",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -80
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 420,
        "content": "## ✅ TODO / Future Enhancements (Main Area)\n\n*   [ ] Add more robust input validation.\n*   [ ] Implement more sophisticated error handling for MCP calls.\n*   [ ] Add rate limiting or API key authentication for external access.\n*   [ ] Consider splitting into separate Main (MCP) and Sub (Agent) workflow files for very complex scenarios.\n\n\n\n## ✅ TODO / Future Enhancements (Sub / Agent Logic Area)\n\n*   [ ] Implement more sophisticated tool selection logic (e.g., conditional routing).\n*   [ ] Add a tool to verify event dates or venue existence.\n*   [ ] Allow user to specify preferred search engines or data sources.\n*   [ ] Improve extraction of structured data from scraped pages.\n*   [ ] Offer summarization options for lengthy event descriptions."
      },
      "typeVersion": 1
    },
    {
      "id": "f2b540c4-faff-41cc-be53-d0c885a52946",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        720
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 520,
        "content": "## 🏁 Sub-Workflow Start: Local Event Finder Logic\n(Node: `even_finder_workflow` - Execute Workflow Trigger)\n\n🎬 **Kicks off the Agent's Thinking Process**\n*   **Purpose:** This is the internal entry point for the agent's core logic, triggered by the `find_events` (Tool Workflow) node.\n*   **Receives:** User event search criteria (`query`, `city`, `country`, `date-range`, `interests`).\n*   **Passes Data To:** The `event_finder_agent` (AI Agent) node."
      },
      "typeVersion": 1
    },
    {
      "id": "3b2922cd-8fbb-4f1f-95e9-4a48dc07718a",
      "name": "Note adhésive7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        720
      ],
      "parameters": {
        "color": 4,
        "width": 740,
        "height": 520,
        "content": "## 🧠 event_finder_agent (Core Logic)\n\n🤖 **The Brain of the Operation**\n*   **Purpose:** Processes the user's request to find events using available tools and LLM reasoning.\n*   **Model:** `models/gemini-2.5-flash-preview-05-20` (via `Google Gemini Chat Model` node).\n*   **System Prompt:** Defined in this node. Guides the AI on its persona, how to use tools, desired output format, and search strategy (see its System Message parameter).\n*   **Tools Used:**\n    *   `brave_web_search` (MCP Client)\n    *   `brave_local_search` (MCP Client)\n    *   `google_gemini_event_search` (Gemini Search Tool)\n    *   `jina_ai_web_page_scraper` (Jina AI Tool)\n*   **Memory Setup:** Uses `Simple Memory` (Window Buffer Memory) to retain short-term conversation context.\n*   **Input:** Event search criteria from `even_finder_workflow`.\n*   **Output:** Formatted markdown string containing event details, or a message if no events are found. This output becomes the result of the `find_events` tool call."
      },
      "typeVersion": 1
    },
    {
      "id": "dbf29f77-6557-42aa-831b-3ad5590bb301",
      "name": "Note adhésive8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        1660
      ],
      "parameters": {
        "color": 6,
        "width": 620,
        "height": 300,
        "content": "## 💾 Agent Memory (Simple Memory)\n\n🧠 **Short-Term Recall**\n*   **Purpose:** Provides conversation memory to the `event_finder_agent`.\n*   **Type:** Window Buffer Memory (keeps a limited history of interactions).\n*   **Session Key:** `={{ $execution.id }}` (Ensures memory is unique to each execution run of this agent logic).\n*   **Importance:** Allows the agent to potentially remember previous turns *if this workflow were part of a longer chat*, though for a single tool call, its main role is to fulfill the agent's memory requirement."
      },
      "typeVersion": 1
    },
    {
      "id": "5d5143db-87d2-449c-9460-32f7d465410b",
      "name": "Note adhésive9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 620,
        "content": "## 🛠️ Tool: brave_web_search (MCP Client)\n\n🌐 **Broad Web Searching**\n*   **Connection:** Uses `smithery brave search` credential.\n*   **Purpose of External Tool:** Performs general web searches via Brave Search API (exposed through Smithery MCP).\n*   **AI Interaction:** Agent uses this for broad event queries, finding event listing sites, or general info.\n    *   Example AI-generated params: `{\"query\": \"music festivals Australia July 2025\"}`\n*   **Output:** Search results (list of URLs, snippets)."
      },
      "typeVersion": 1
    },
    {
      "id": "d943edef-7382-4b1b-b848-c923c99cc72b",
      "name": "Note adhésive10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1540,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 620,
        "content": "## 🛠️ Tool: brave_local_search (MCP Client)\n\n📍 **Local Area Searching**\n*   **Connection:** Uses `smithery brave search` credential.\n*   **Purpose of External Tool:** Finds local events/venues using Brave Local Search API (via Smithery MCP).\n*   **AI Interaction:** Agent prioritizes this for city-specific queries.\n    *   Example AI-generated params: `{\"query\": \"artisan markets Perth WA\"}`\n*   **Output:** Local search results."
      },
      "typeVersion": 1
    },
    {
      "id": "bde5341b-3a99-48c9-a43d-9ebcc5172f14",
      "name": "Note adhésive11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2120,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 620,
        "content": "## 🛠️ Tool: google_gemini_event_search (Gemini Search Tool)\n\n✨ **Advanced Event Searching**\n*   **Connection:** Uses `Gemini Credentials account` credential.\n*   **Purpose of External Tool:** Leverages Google Gemini's advanced search capabilities for more nuanced or complex event queries.\n*   **AI Interaction:** Agent uses this for multi-faceted queries or when other searches are insufficient.\n    *   Example AI-generated params: `{\"query\": \"outdoor family events with craft workshops Perth July 2025\"}`\n*   **Output:** Rich search results, potentially with structured data."
      },
      "typeVersion": 1
    },
    {
      "id": "a7c340dd-efac-415c-a922-f3ef457cb072",
      "name": "Note adhésive12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2700,
        720
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 620,
        "content": "## 🛠️ Tool: jina_ai_web_page_scraper (Jina AI Tool)\n\n📄 **Detailed Content Extraction**\n*   **Connection:** Uses `Jina AI account` credential.\n*   **Purpose of External Tool:** Scrapes and summarizes content from specific event URLs found by search tools.\n*   **AI Interaction:** Agent uses this to get detailed descriptions, dates, and locations from event pages.\n    *   Example AI-generated params: `{\"url\": \"https://example-event.com/details\"}`\n*   **Output:** Markdown content of the scraped page. **CRITICAL:** Use sparingly due to timeout limits."
      },
      "typeVersion": 1
    },
    {
      "id": "2f1944ad-f803-4712-94a1-5ec902e7def4",
      "name": "Note adhésive13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -900
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 360,
        "content": "## 💡 n8n AI Agent as an MCP Service (This Workflow's Pattern)\n\n**This workflow demonstrates a self-contained n8n AI Agent exposed as an MCP Service.**\n*   **What this \"Agent Logic\" part does:** Implements the core intelligence for finding local events. It receives a task (event criteria), uses its LLM (`Google Gemini Chat Model`) and a suite of tools (`brave_web_search`, `brave_local_search`, `google_gemini_event_search`, `jina_ai_web_page_scraper`) to gather information, and then formats a response.\n*   **How it works internally:** The `event_finder_agent` node orchestrates tool calls based on its system prompt and the user's request. Memory helps maintain context for the LLM.\n*   **Why this pattern is useful:**\n    1.  **Encapsulation:** Complex logic is bundled into a reusable agent.\n    2.  **Accessibility:** The MCP Server part makes this agent callable by other systems as a simple tool.\n    3.  **Single File Simplicity:** For moderately complex agents, keeping the MCP server and agent logic in one file can simplify deployment and management."
      },
      "typeVersion": 1
    },
    {
      "id": "934c840a-f8b6-416a-a5a8-68b724f27687",
      "name": "Note adhésive14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -500
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 440,
        "content": "## 🔑 External Service Credentials (Agent Logic Area)\n\nList of credentials used by tools within this agent logic:\n\n1.  **Tool Nodes:** `brave_web_search`, `brave_local_search`\n    *   **n8n Credential Name:** `smithery brave search`\n    *   **Target Service (Example):** Smithery MCP for Brave Search\n2.  **Tool Node:** `Google Gemini Chat Model` (LLM)\n    *   **n8n Credential Name:** `Google Gemini Context7`\n    *   **Target Service:** Google AI (Generative Language API)\n3.  **Tool Node:** `google_gemini_event_search`\n    *   **n8n Credential Name:** `Gemini Credentials account`\n    *   **Target Service:** Google AI (Gemini Search API / Vertex AI Search)\n4.  **Tool Node:** `jina_ai_web_page_scraper`\n    *   **n8n Credential Name:** `Jina AI account`\n    *   **Target Service:** Jina AI API"
      },
      "typeVersion": 1
    },
    {
      "id": "96746f76-936e-467b-94f7-7b2fe32728a9",
      "name": "Note adhésive15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        1600
      ],
      "parameters": {
        "color": 6,
        "width": 740,
        "height": 220,
        "content": "## ⚙️ Key LLM & Agent Settings (Agent Logic Area)\n\n*   **LLM Model:** `models/gemini-2.5-flash-preview-05-20` (in `Google Gemini Chat Model` node)\n*   **System Prompt Location:** Within the `event_finder_agent` node, \"System Message\" parameter.\n*   **Memory Type/Key:** Window Buffer Memory (`Simple Memory` node), Session Key: `={{ $execution.id }}`"
      },
      "typeVersion": 1
    },
    {
      "id": "338692d0-096a-42b8-a7bc-4ee897b251a2",
      "name": "Note adhésive16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -900
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 360,
        "content": "## 🎯 Sub-Workflow: Local Event Finder Core Logic (Agent Logic Area)\n\n*   **Purpose:** This section of the workflow is dedicated to understanding the user's event request, utilizing search and scraping tools effectively, and synthesizing the findings into a helpful, formatted response.\n*   **Expected Input Details (from `even_finder_workflow`):**\n    *   `query`: (string) e.g., \"mountain biking and beer events\"\n    *   `city`: (string) e.g., \"Perth\"\n    *   `country`: (string) e.g., \"Australia\"\n    *   `date-range`: (string) e.g., \"July 2025\"\n    *   `interests`: (string) e.g., \"mountain biking, craft beer\""
      },
      "typeVersion": 1
    },
    {
      "id": "7e276d1e-6746-4133-8dcd-cf886c0d3199",
      "name": "Note adhésive17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -500
      ],
      "parameters": {
        "color": 2,
        "width": 740,
        "height": 360,
        "content": "## 🛠️ Troubleshooting Tips (Agent Logic Area)\n\n*   **Check Agent Logs:** Examine the execution logs of the `event_finder_agent` node for tool call details, LLM interactions, and errors.\n*   **Test MCP Client Tools Individually:** If a tool seems to fail (e.g., `brave_web_search`), test its node with fixed inputs to isolate issues.\n*   **Test External Services:** Ensure the underlying services (Brave Search via Smithery, Google AI, Jina AI) are operational.\n*   **Verify Credentials:** Double-check all credential configurations (`smithery brave search`, `Google Gemini Context7`, `Gemini Credentials account`, `Jina AI account`).\n*   **Review System Prompt:** Ensure the system prompt in `event_finder_agent` clearly instructs the AI and aligns with tool capabilities.\n*   **Inspect `jina_ai_web_page_scraper` Usage:** This tool is time-sensitive. Ensure it's not trying to scrape too many pages or very large/slow pages, which could lead to timeouts."
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9598b47f-389a-4d1c-b46e-f87a066b416e",
  "connections": {
    "9be2f212-43d9-4e31-a090-3b3e44195291": {
      "ai_tool": [
        [
          {
            "node": "2cb94f37-21fc-48d7-8661-3d3270bae356",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "83c73d4e-f4ae-4618-9ab4-0bcc05339395": {
      "ai_tool": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "8ba5272c-d95b-48e3-b48d-0f6bedcdad5c": {
      "ai_tool": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "c1becac0-c6a1-4a2f-be3b-c69b7cb5a69a": {
      "main": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "5f733091-c9b0-4dd8-90f0-9eee8af122dd": {
      "ai_tool": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "a8afc19d-8394-4e4d-bd6a-047e665b5a68": {
      "ai_tool": [
        [
          {
            "node": "fbec2433-db9a-43db-b143-551c624ee085",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Intelligence Artificielle, Marketing

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds28
Catégorie2
Types de nœuds10
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Jez

Jez

@jez

I'm passionate about combining traditional web development with AI and automation to create impactful online solutions. As Founder & CEO of Jezweb, an award-winning Newcastle, Australia agency, I lead a 30+ person team delivering high-quality web design, development, and hosting services to over 3000 clients.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34