{ "name": "Explorium MCP - Slack Bot", "nodes": [ { "parameters": { "content": "## 1. Create Slack App\n\n### Create App\n1. Go to api.slack.com/apps\n2. Click **Create New App** → **From scratch**\n3. Give it name (e.g., \"Explorium Agent\") and select workspace\n\n### Bot Permissions (OAuth & Permissions)\nAdd these **Bot Token Scopes**:\n```\napp_mentions:read\nchannels:history\nchannels:read\nchat:write\nemoji:read\ngroups:history\ngroups:read\nim:history\nim:read\nmpim:history\nmpim:read\nreactions:read\nusers:read\n```\n\n### Enable Events\n1. **Event Subscriptions** → Enable\n2. Add **Request URL** (from n8n Slack Trigger node)\n3. Subscribe to **bot events**:\n - app_mention\n - message.channels\n - message.groups\n - message.im\n - message.mpim\n - reaction_added\n\n### Install App\n1. **Install App** → **Install to Workspace**\n2. Copy **Bot User OAuth Token** (xoxb-...)\n", "height": 880, "width": 640 }, "id": "2cdc96cf-c1b6-4177-ba58-6feae2c38bb5", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 5472, -256 ], "typeVersion": 1 }, { "parameters": { "content": "## 2. Configure n8n\n\n### Import & Setup\n1. Import this JSON template\n2. **Slack Trigger** node:\n - Add Slack credential with Bot Token\n - Copy webhook URL\n - Paste in Slack Event Subscriptions Request URL\n\n3. **Anthropic Chat Model** node:\n - Add Anthropic API credential\n - Model: claude-haiku-4-5-20251001\n\n(You can replace it with other chat models)\n\n4. **MCP Client** node:\n - Endpoint: https://mcp.explorium.ai/mcp\n - Header Auth: Add Explorium API key\n\n\n## Usage Examples\n```\n@Bot find tech companies in SF with 50-200 employees\n@Bot show Microsoft's technology stack\n@Bot get CMO contacts at healthcare companies\n```", "height": 608, "width": 640 }, "id": "cbb39059-80ea-45b3-8cf3-65b39b7aed52", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 6160, -256 ], "typeVersion": 1 }, { "parameters": { "content": "# Explorium Agent for Slack\n\nAI-powered Slack bot for business intelligence queries using Explorium API through MCP.\n\n## Prerequisites\n- Slack workspace with admin access\n- Anthropic API key (You can replace with other LLM Chat)\n- Explorium API Key\n", "height": 256, "width": 2912 }, "id": "fdf690d4-4175-47a8-8a55-9b9051a5d9af", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 5472, -560 ], "typeVersion": 1 }, { "parameters": { "trigger": [ "app_mention" ], "watchWorkspace": true, "options": { "resolveIds": true } }, "id": "68135d6e-9061-4e6b-a4fc-b0bacadff82c", "name": "Slack Trigger", "type": "n8n-nodes-base.slackTrigger", "position": [ 6848, -160 ], "webhookId": "5d3fa63f-ef0a-48f1-9550-d95e527fba61", "typeVersion": 1, "credentials": {} }, { "parameters": { "conditions": { "options": { "combineOperation": "any" }, "conditions": [ { "id": "condition1", "leftValue": "={{ $json.thread_ts }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty" } } ] }, "options": {} }, "id": "82327159-f01d-433f-bd6a-6a66489eb568", "name": "Check If Thread", "type": "n8n-nodes-base.if", "position": [ 7072, -160 ], "typeVersion": 2 }, { "parameters": { "url": "https://slack.com/api/conversations.replies", "authentication": "predefinedCredentialType", "nodeCredentialType": "slackApi", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "channel", "value": "={{ $json.channel }}" }, { "name": "ts", "value": "={{ $json.thread_ts }}" } ] }, "options": {} }, "id": "fa24f726-de97-46a5-91e9-da0ace8b2ef5", "name": "Fetch Thread Messages", "type": "n8n-nodes-base.httpRequest", "position": [ 7296, -256 ], "typeVersion": 4.2, "credentials": {} }, { "parameters": { "jsCode": "// Get the original trigger data from the first item\nconst triggerData = $('Slack Trigger').first().json;\n\n// Get thread messages from Slack API response\nconst slackResponse = $input.first().json;\nconst messagesList = slackResponse.messages || [];\n\n// Build thread context from all messages\nlet threadContext = '';\nif (messagesList.length > 1) {\n threadContext = messagesList\n .map((msg, idx) => {\n const text = msg.text || '';\n const user = msg.user || 'Unknown';\n const isBot = msg.bot_id ? ' (bot)' : '';\n return `Message ${idx + 1} from ${user}${isBot}: ${text}`;\n })\n .join('\\n');\n}\n\n// Get current message text\nconst currentText = triggerData.text || (triggerData.blocks && triggerData.blocks[0] && triggerData.blocks[0].elements && triggerData.blocks[0].elements[0] && triggerData.blocks[0].elements[0].elements && triggerData.blocks[0].elements[0].elements[1] ? triggerData.blocks[0].elements[0].elements[1].text : '');\n\n// Combine context with current message\nconst finalText = messagesList.length > 1 \n ? `Thread Context:\\n${threadContext}\\n\\nCurrent Message: ${currentText}`\n : currentText;\n\nreturn {\n channel: triggerData.channel || '',\n ts: triggerData.ts || '',\n thread_ts: triggerData.thread_ts || '',\n type: triggerData.type || '',\n text: finalText,\n original_text: currentText,\n is_bot: triggerData.bot_id ? true : false,\n user: triggerData.user || '',\n is_thread_continuation: triggerData.thread_ts ? true : false,\n session_id: triggerData.thread_ts || triggerData.ts,\n reaction: triggerData.reaction || '',\n item_ts: triggerData.item ? triggerData.item.ts : '',\n is_emoji: triggerData.blocks && triggerData.blocks[0] && triggerData.blocks[0].elements && triggerData.blocks[0].elements[0] && triggerData.blocks[0].elements[0].elements && triggerData.blocks[0].elements[0].elements[0] && triggerData.blocks[0].elements[0].elements[0].type === 'emoji' ? true : false,\n has_thread_context: messagesList.length > 1\n};" }, "id": "4ab45f74-0e4d-4686-af3c-3b6865adb3d5", "name": "Format Thread Context", "type": "n8n-nodes-base.code", "position": [ 7520, -256 ], "typeVersion": 2 }, { "parameters": { "assignments": { "assignments": [ { "id": "2c1ec1ad-72f2-4bcd-bfef-dc12f49de48b", "name": "channel", "type": "string", "value": "={{ $json.channel || '' }}" }, { "id": "af7e1d94-946c-4257-824e-a5d91a2b007a", "name": "ts", "type": "string", "value": "={{ $json.ts || '' }}" }, { "id": "28583957-bddd-4bd2-b937-79b7554a7a65", "name": "thread_ts", "type": "string", "value": "={{ $json.thread_ts || '' }}" }, { "id": "53179618-0ca1-43a2-a416-af8a39f792e0", "name": "type", "type": "string", "value": "={{ $json.type || '' }}" }, { "id": "fbe15475-5924-41fa-a7b1-6017ae766a23", "name": "text", "type": "string", "value": "={{ $json.text || ($json.blocks && $json.blocks[0] && $json.blocks[0].elements && $json.blocks[0].elements[0] && $json.blocks[0].elements[0].elements && $json.blocks[0].elements[0].elements[1] ? $json.blocks[0].elements[0].elements[1].text : '') }}" }, { "id": "49376ca5-079b-4993-9f15-6847734d9c5d", "name": "is_bot", "type": "boolean", "value": "={{ $json.bot_id ? true : false }}" }, { "id": "b0ae1eed-7adf-49d2-b19d-0a1efdb5f435", "name": "user", "type": "string", "value": "={{ $json.user || '' }}" }, { "id": "13fab869-b570-444d-903b-11d4b4f0ebe6", "name": "is_thread_continuation", "type": "boolean", "value": "={{ $json.thread_ts ? true : false }}" }, { "id": "a148580e-6fe3-4689-be2f-7996c54f6118", "name": "session_id", "type": "string", "value": "={{ $json.thread_ts || $json.ts }}" }, { "id": "311146c6-e6cf-492e-a4a9-09066e927879", "name": "reaction", "type": "string", "value": "={{ $json.reaction || '' }}" }, { "id": "1b358df2-7062-4c7b-be7d-28bc69611322", "name": "item_ts", "type": "string", "value": "={{ $json.item ? $json.item.ts : '' }}" }, { "id": "1e9d1f5a-4e0a-4ed8-8e23-660fe8b6a950", "name": "is_emoji", "type": "boolean", "value": "={{ $json.blocks && $json.blocks[0] && $json.blocks[0].elements && $json.blocks[0].elements[0] && $json.blocks[0].elements[0].elements && $json.blocks[0].elements[0].elements[0] && $json.blocks[0].elements[0].elements[0].type === 'emoji' ? true : false }}" } ] }, "options": {} }, "id": "32e8b75b-844f-4cb7-9f1d-a1e9621a7b6c", "name": "Format Without Thread", "type": "n8n-nodes-base.set", "position": [ 7520, -64 ], "typeVersion": 3.4 }, { "parameters": { "promptType": "define", "text": "={{ $json.text }}", "options": { "systemMessage": "=You are **Explorium Business Intelligence Agent**, created by Explorium. \n\nAdvanced Explorium API agent with comprehensive business intelligence data through MCP.\n\n## Core Capabilities\n\n### Company Intelligence\n• Discovery: Search by industry, size, revenue, location, technology, growth metrics\n• Firmographics: Profiles, employee counts, revenue, industry classifications \n• Technographics: Technology stacks, software usage, digital infrastructure\n• Financial Data: Revenue trends, funding rounds, investor information, financial metrics for public companies\n• Company Ratings: Employee satisfaction, company culture, work-life balance, management quality\n• Competitive Analysis: Market positioning, competitive landscape, strategic insights\n• Strategic Intelligence: Strategic focus areas, value propositions, target markets from SEC filings\n• Business Challenges: Risk analysis, security breaches, competitive pressures from public disclosures\n• Events: Funding, product launches, partnerships, office changes, business developments\n• Workforce Analytics: Department composition, hiring trends, organizational structure\n• Social Intelligence: LinkedIn posts, website changes, digital presence\n• Website Intelligence: Keyword searches, content analysis, website changes tracking\n• Market Statistics: Aggregated industry insights, geographic distribution, revenue analysis\n\n### Prospect Intelligence \n• Discovery: Find executives, decision-makers by role, company, industry, experience\n• Contact Enrichment: Professional/personal emails, phone numbers, verification\n• Profiles: Work history, education, skills, career progression\n• Role Intelligence: Current positions, job levels, departments, reporting structure\n• Social Activity: LinkedIn posts, engagement metrics, professional content\n• Career Events: Job changes, promotions, role transitions, anniversaries\n\n### Analytics & Communication\n• Market Research: Industry trends, competitive positioning, landscape analysis\n• Investment Intelligence: Funding rounds, investor networks, financial milestones\n• Growth Tracking: Company expansion, headcount changes, business evolution\n• Personalized Outreach: Targeted messaging using real-time business intelligence\n• Trigger-Based Communication: Messages based on events, role changes, milestones\n• Smart Autocomplete: Intelligent suggestions for industries, technologies, job titles, locations\n• Web Search: General web search capabilities for additional context and research\n\n## Response Guidelines\n\n### Workflow\n1. **Discovery**: Search companies/prospects using filters\n2. **Intelligence**: Enrich with detailed data\n3. **Analysis**: Analyze trends, patterns, competitive insights \n4. **Action**: Generate personalized messages, recommendations, strategic insights\n\n### Communication\n• Always mention using **\"Explorium API\"** (never internal function names)\n• **Keep responses concise and focused** - provide essential information without unnecessary elaboration\n• State total matches found and suggest relevant enrichments\n• When responding to thread conversations, consider the full context provided\n• Format your responses for slack, the output will be post in slack so it should looks good and well formated there. use the slack guidelines below and not md format (for example for headline use *Some Header* and not **Some Header**):\n\nSlack Guidelines:\n*bold text* - makes text bold\n_italic text_ - makes text italic\n~strikethrough~ - strikes through text\n`code` - inline code formatting\n```code block``` - multi-line code block\n\n- Use asterisk + space for bullet points\n- Like this\n\n1. Numbered lists\n2. Work like this\n\n - creates a clickable link\n<@U123ABC> - mentions a user (using their user ID)\n<#C123ABC|channel-name> - links to a channel\n\n> Quoted text\n> Continues on next line\n\n--- \n\nCreates a horizontal line\n```\n\n### Error Handling\n• Tool errors/no data: respond **\"An error occurred.\"**\n• Invalid queries: guide toward valid parameters\n• Off-topic requests: redirect to business intelligence use cases\n\n## Off-Topic Handling\nFor non-business intelligence requests:\n\n> I'm the Explorium Business Intelligence Agent, designed to demonstrate our comprehensive company and prospect intelligence platform. \n> \n> **Example capabilities:** \n> • Find SaaS firms in New York with 50‑200 employees \n> • Show Microsoft's technology stack \n> • Get marketing‑director contacts at healthcare companies \n> • Compare funding rounds of fintech startups\n> \n> What business intelligence would you like to explore?\n\n## Technical Notes\n• Use autocomplete for industries, technologies, job titles, company categories before filtering\n• Combine multiple criteria for precise targeting and comprehensive results\n• Prioritize recent data and real-time insights over historical data\n• Maintain conversation context for follow-up enrichments and related queries\n• Use web search for general information, news, and context not available in business intelligence data\n• Leverage aggregated statistics tools for market-level insights and trends\n• Provide alternative search strategies when initial queries fail\n• When using fetch_prospects or fetch_businesses tools limit the results (size and page_size) to 5 results\n• Thread context is automatically provided when responding to messages in a thread", "returnIntermediateSteps": false } }, "id": "cc74fb30-c9ba-4837-8af3-15fc79c91c0b", "name": "Explorium Agent", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 7800, -160 ], "typeVersion": 2.1 }, { "parameters": { "model": { "__rl": true, "value": "claude-haiku-4-5-20251001", "mode": "list", "cachedResultName": "Claude Haiku 4.5" }, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic", "typeVersion": 1.3, "position": [ 7744, 64 ], "id": "533e4626-aeb0-42e1-a55c-452229bdcfcc", "name": "Anthropic Chat Model", "credentials": {} }, { "parameters": { "sessionIdType": "customKey", "sessionKey": "={{ $json.session_id }}", "contextWindowLength": 20 }, "id": "2504c14b-2d58-467d-ac40-d4a1317b8a7a", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 7872, 64 ], "typeVersion": 1.3 }, { "parameters": { "endpointUrl": "https://mcp.explorium.ai/mcp", "authentication": "headerAuth", "options": {} }, "type": "@n8n/n8n-nodes-langchain.mcpClientTool", "typeVersion": 1.2, "position": [ 8000, 64 ], "id": "95bcd5f2-ffd7-4925-95ae-7fc5f9e32937", "name": "Explorium MCP", "credentials": {} }, { "parameters": { "select": "channel", "channelId": { "__rl": true, "mode": "id", "value": "={{ $item(\"0\").$node[\"Slack Trigger\"].json[\"channel\"] }}" }, "text": "={{ $json.output }}", "otherOptions": { "includeLinkToWorkflow": false, "thread_ts": { "replyValues": { "thread_ts": "={{ $item(\"0\").$node[\"Slack Trigger\"].json[\"thread_ts\"] || $item(\"0\").$node[\"Slack Trigger\"].json[\"ts\"] }}" } } } }, "id": "cb0f9fbf-1150-4a70-be4d-2d459376e52c", "name": "Send a message", "type": "n8n-nodes-base.slack", "position": [ 8208, -160 ], "webhookId": "a840217b-6faa-474a-9cc5-21bcbb9c8db8", "typeVersion": 2.3, "credentials": {} } ], "pinData": {}, "connections": { "Slack Trigger": { "main": [ [ { "node": "Check If Thread", "type": "main", "index": 0 } ] ] }, "Check If Thread": { "main": [ [ { "node": "Fetch Thread Messages", "type": "main", "index": 0 } ], [ { "node": "Format Without Thread", "type": "main", "index": 0 } ] ] }, "Fetch Thread Messages": { "main": [ [ { "node": "Format Thread Context", "type": "main", "index": 0 } ] ] }, "Format Thread Context": { "main": [ [ { "node": "Explorium Agent", "type": "main", "index": 0 } ] ] }, "Format Without Thread": { "main": [ [ { "node": "Explorium Agent", "type": "main", "index": 0 } ] ] }, "Explorium Agent": { "main": [ [ { "node": "Send a message", "type": "main", "index": 0 } ] ] }, "Anthropic Chat Model": { "ai_languageModel": [ [ { "node": "Explorium Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Simple Memory": { "ai_memory": [ [ { "node": "Explorium Agent", "type": "ai_memory", "index": 0 } ] ] }, "Explorium MCP": { "ai_tool": [ [ { "node": "Explorium Agent", "type": "ai_tool", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1" }, "versionId": "34a61d7c-9ded-4af2-b24d-b462106cfe11", "meta": { "templateCredsSetupCompleted": true, "instanceId": "0a70652f43c1b29dd16c35b61a38fd31c8004f58bc7e723bf43262a797407c77" }, "id": "nKluKJXe6qIz7tnR", "tags": [] }