{ "meta": { "instanceId": "0a70652f43c1b29dd16c35b61a38fd31c8004f58bc7e723bf43262a797407c77" }, "name": "Automated Sales Outreach with Slack", "tags": [], "nodes": [ { "id": "1b7537b1-0b43-43ac-b50a-5df61641043d", "name": "Anthropic Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic", "position": [ -1220, 560 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "claude-3-7-sonnet-20250219", "cachedResultName": "Claude 3.7 Sonnet" }, "options": {} }, "credentials": { "anthropicApi": { "id": "FQdE6twB8nCJNoxV", "name": "Anthropic account" } }, "typeVersion": 1.3 }, { "id": "1eb46a9e-5b03-42a2-8132-ccda3f42b453", "name": "Loop Over Items", "type": "n8n-nodes-base.splitInBatches", "position": [ 632, 540 ], "parameters": { "options": { "reset": false }, "batchSize": "={{ 1 }}" }, "typeVersion": 3 }, { "id": "4965a3e2-fa71-4680-b0bd-6db416edbc25", "name": "Company Researcher", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ -1220, 390 ], "parameters": { "text": "={{ $json.body.data }}", "options": { "maxIterations": 12, "systemMessage": "=You are a research analyst helping a sales agent write a highly personalized outbound email. Your job is to generate a detailed research brief that explains:\n\n1. **What the company does**\n2. **What the recent business event is**, and why it's significant\n3. **How the event might reflect on the company’s priorities, pain points, or growth goals**\n4. Any additional company context that might be useful for crafting a relevant sales message\n\n## Guidelines:\n- Your response should be **detailed, structured, and accurate**\n- You are writing **for another AI**, so don't hold back on context — more is better\n- You can assume the user already passed in the full event details (like a trigger type, a short summary, etc.)\n- Focus more on **interpreting** the event and **linking it to the company**\n- Write in **natural language**, using clear, concise, informative sentences — not marketing fluff or speculation\n- Keep your tone objective and analytical\n- Avoid repeating generic phrases like “the company is innovative” unless supported by facts\n\n## Inputs:\n- Business ID: {{ $json.body.business_id }}\n- Event: {{ $json.body.data }}\n\n## Output Structure:\nReturn your findings in 2-3 clear paragraphs. The first paragraph should describe the **event in detail** and explain why it may be relevant. The second should summarize what the **company does** and any other useful GTM signals (size, growth stage, recent changes, priorities, etc.).\n\nNow generate the research summary.\n" }, "promptType": "define" }, "typeVersion": 1.9 }, { "id": "d0af2b0e-80c5-43b8-af7d-8f8039c90883", "name": "Email Writer ( YES prospect data)", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 852, 415 ], "parameters": { "text": "=prospect_data: contact info:{{ $json.email }}, expereince:{{ $json.experience }},skills:{{ $json.skills }}.\ncompany data:{{ $('Company Researcher').first().json.output }}\nevent data: {{ $('Webhook - Product Launch').first().json.body }}\n\n", "options": { "systemMessage": "=You are a B2B outbound sales email generator.\n\nYour task is to write a short and effective cold outbound email (under 150 words) to a specific prospect at a company. The goal is to be relevant, concise, and persuasive, while introducing Explorium in a way that aligns with the prospect’s role and current company context.\n\n## Prospect Data\n{prospect_data}\n\n## Company \n{company_data}\n\n## Event Data\n{event_data}\n\n## About Explorium (Use this to inform the email — do not paste directly):\nExplorium is a data-powered intelligence platform on a mission to unlock the full potential of external data for the agent era. We serve as the infrastructure backbone for intelligent systems — helping go-to-market teams enrich company and prospect data, tap into real-time signals, and dynamically prioritize their best-fit accounts. Our platform fuels the agents and AI products that are redefining the future of sales and marketing.\n\n## MCP Playground (Link to include):\nInvite the prospect to explore Explorium’s capabilities hands-on via our [MCP Playground](https://www.explorium.ai/mcp-playground/), a public environment to experience the power of enriched external data.\n\n## Output Instructions:\n- Personalize the email using the provided prospect, company, and event information\n- Tailor the message to the prospect’s title, department, or function\n- Weave in how Explorium could support their work or goals based on what the company is focused on\n- The email should feel like it’s written by a real SDR — confident, relevant, and human\n- End the email with a soft CTA inviting them to check out the MCP Playground link but dont forget to also ask to set up a meeting / call\n- At the top of the email, output the selected email address to use. Choose the prospect’s **professional email** if available, or fallback to the next best alternative (personal, current, etc.)\n\nNow write the email.\n" }, "promptType": "define" }, "typeVersion": 1.9 }, { "id": "f7e3faae-1353-4570-bdca-f1055c4b5c5b", "name": "Email Writer (NO prospect data)", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ -404, 140 ], "parameters": { "text": "=company data:{{ $('Company Researcher').first().json.output }}\nevent data: {{ $('Webhook - Product Launch').first().json.body }}\n", "options": { "systemMessage": "=You are a B2B outbound email assistant.\n\nYour task is to write a short, personalized outbound email (under 120 words) that connects Explorium to a recent business event or trigger at a target company. This email will be sent to a general marketing, growth, or data contact — no specific prospect information is available.\n\n## Context Provided:\n- Company Information: {company_data}\n- Event Information: {event_data}\n\n## About Explorium (Use as context — DO NOT paste directly):\nExplorium is on a mission to unlock the full potential of data for the agent era. From day one, we’ve been driven to be the data and infrastructure backbone that powers intelligent systems and delivers real business growth.\n\nWe partner with smart, driven teams to turn raw external data into actionable insight—fueling agents, AI products, and GTM strategies for the future of sales and marketing.\n\nIf relevant, you may mention that they can explore Explorium’s capabilities themselves via our [MCP Playground](https://www.explorium.ai/mcp-playground/), a public demo environment showcasing the power of enriched data. \n\ndont forget to always end with a call to action in setting up some sort of call or meeting to talk further\n\n## Instructions:\n- Reference the event to establish relevance and timing\n- Briefly describe what the company does (from the input)\n- Weave in Explorium’s value if it's applicable to their business priorities\n- If appropriate, suggest checking out the MCP Playground link\n- End with a warm, soft CTA\n\nNow write the email.\n" }, "promptType": "define" }, "typeVersion": 1.9 }, { "id": "5012126e-241d-4c5b-8c53-42452933e0a7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -1220, 220 ], "parameters": { "width": 260, "content": "## Reaserch\nThis agent uses the Explorium MCP to research the company that just had an event" }, "typeVersion": 1 }, { "id": "11fafba4-861d-4766-b334-51f745bcd8bb", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ -760, 220 ], "parameters": { "height": 140, "content": "## Crossroads \n\nif we cant find data about the company's employees, we fork up, to write a general email " }, "typeVersion": 1 }, { "id": "e7a4cf37-325b-485a-aef7-e23c1ec4fac8", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ -400, 20 ], "parameters": { "height": 100, "content": "## email writer #1\nGiven the research, this agents writes an email" }, "typeVersion": 1 }, { "id": "6b29ded5-fb0a-4c29-8b35-a1a3726dacc3", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 140, 400 ], "parameters": { "height": 120, "content": "## Employee Data \nGather data about the 5 employees we will write emails to." }, "typeVersion": 1 }, { "id": "5ba21e97-46f0-4786-8de0-2b06cd2aeed3", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 860, 260 ], "parameters": { "height": 140, "content": "## Email Writer #2\nGiven both data about the email and the employee, the agent will write a highly personalized email to each employee\n" }, "typeVersion": 1 }, { "id": "5363bc7a-b066-4fad-a5be-3fc9924aff55", "name": "Explorium MCP", "type": "@n8n/n8n-nodes-langchain.mcpClientTool", "position": [ -1020, 560 ], "parameters": { "sseEndpoint": "mcp.explorium.ai/sse", "authentication": "bearerAuth" }, "credentials": { "httpBearerAuth": { "id": "aPjJXei6qDSctHNW", "name": "Bearer Auth account" } }, "typeVersion": 1 }, { "id": "c88fe320-1a7b-4c37-a799-52a06445245a", "name": "Webhook - Product Launch", "type": "n8n-nodes-base.webhook", "position": [ -1440, 390 ], "webhookId": "09d12e26-7fb0-492f-913f-119f627de19b", "parameters": { "path": "https://lievi.app.n8n.cloud/webhook-test/product-launch", "options": {}, "httpMethod": "POST" }, "typeVersion": 2 }, { "id": "3f116b08-0ba1-45da-89c8-5ebf494fc48d", "name": "Explorium Prospects API Call", "type": "n8n-nodes-base.httpRequest", "position": [ -844, 390 ], "parameters": { "url": "https://api.explorium.ai/v1/prospects", "method": "POST", "options": {}, "jsonBody": "={\n \"mode\": \"full\",\n \"page\": 1,\n \"size\": 5,\n \"page_size\": 5,\n \"filters\": {\n \"has_email\": { \"value\": true },\n \"job_level\": {\n \"values\": [\"owner\", \"cxo\", \"vp\", \"director\", \"manager\", \"senior\"]\n },\n \"job_department\": {\n \"values\": [\"Marketing\"]\n },\n \"business_id\": {\n \"values\": [\"{{ $('Webhook - Product Launch').item.json.body.business_id }}\"]\n }\n }\n}\n", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "headerParameters": { "parameters": [ { "name": "accept", "value": "application/json" }, { "name": "content-type", "value": "application/json" }, { "name": "api_key", "value": "" } ] } }, "typeVersion": 4.2 }, { "id": "3414b8fd-6410-4faa-a81b-f8352abb2f73", "name": "Is there data on the company?", "type": "n8n-nodes-base.if", "position": [ -624, 390 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "loose" }, "combinator": "and", "conditions": [ { "id": "8627133a-68d0-4907-b8ca-d8deba93089d", "operator": { "type": "number", "operation": "equals" }, "leftValue": "={{ $json.data.length }}\n", "rightValue": "=0" } ] }, "looseTypeValidation": true }, "typeVersion": 2.2 }, { "id": "93f5ca4d-b537-4e58-90c3-8fa85a9edf9e", "name": "Claude", "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic", "position": [ -316, 360 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "claude-sonnet-4-20250514", "cachedResultName": "Claude Sonnet 4" }, "options": {} }, "credentials": { "anthropicApi": { "id": "FQdE6twB8nCJNoxV", "name": "Anthropic account" } }, "typeVersion": 1.3 }, { "id": "f0bcac46-cdd7-481b-8d51-b76f2382f0d5", "name": "Code - Format Object", "type": "n8n-nodes-base.code", "position": [ -326, 540 ], "parameters": { "jsCode": "const candidates = $input.first().json.data;\n\nif (!Array.isArray(candidates) || candidates.length === 0) {\n throw new Error(\"No candidates found in data.\");\n}\n\nconst result = candidates.map(candidate => {\n return {\n json: {\n prospect_id: candidate.prospect_id, \n full_name: candidate.full_name,\n first_name: candidate.first_name,\n last_name: candidate.last_name,\n title: candidate.job_title,\n department: candidate.job_department,\n seniority: candidate.job_seniority_level?.join(', ') || '',\n company: candidate.company_name,\n location: `${candidate.city}, ${candidate.region_name}, ${candidate.country_name}`,\n linkedin: candidate.linkedin,\n email: candidate.professional_email_hashed || '',\n experience: candidate.experience?.join(' | ') || '',\n skills: candidate.skills?.join(', ') || '',\n interests: candidate.interests?.join(', ') || '',\n business_id: candidate.business_id\n }\n };\n});\n\nreturn result;\n" }, "typeVersion": 2 }, { "id": "5122152e-4667-481e-899e-804feae479a2", "name": "Code - Get prospect_ids", "type": "n8n-nodes-base.code", "position": [ -28, 540 ], "parameters": { "jsCode": "const prospectIds = $input.all()\n .map(item => String(item.json.prospect_id).trim()) // Force string and trim whitespace\n .filter(Boolean); // remove empty/null\n\nreturn [{\n json: {\n prospect_ids: prospectIds\n }\n}];\n" }, "typeVersion": 2 }, { "id": "57258b5d-9040-40d0-89d5-4fa9723fe2aa", "name": "Send Slack Message", "type": "n8n-nodes-base.slack", "position": [ -28, 240 ], "webhookId": "3bd7b28e-1c59-49a8-bdd0-cb2e314daee6", "parameters": { "text": "={{ $json.output }}", "user": { "__rl": true, "mode": "list", "value": "U08KUURMK2S", "cachedResultName": "itamar.levi" }, "select": "user", "otherOptions": {}, "authentication": "oAuth2" }, "credentials": { "slackOAuth2Api": { "id": "eOfca8yNWglvt3Ib", "name": "Slack account" } }, "typeVersion": 2.3 }, { "id": "c47f81d1-fa89-4a69-adb0-b239c5faa526", "name": "Explorium Contacts Information API Call", "type": "n8n-nodes-base.httpRequest", "position": [ 192, 540 ], "parameters": { "url": "https://api.explorium.ai/v1/prospects/contacts_information/bulk_enrich", "method": "POST", "options": {}, "jsonBody": "={{ JSON.stringify({ prospect_ids: $json.prospect_ids }) }}\n\n", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "headerParameters": { "parameters": [ { "name": "accept", "value": "application/json" }, { "name": "content-type", "value": "application/json" }, { "name": "api_key", "value": "" } ] } }, "typeVersion": 4.2 }, { "id": "58f5da0c-9205-48cc-8965-ccb3c52973f0", "name": "Code - Merge profile with email info", "type": "n8n-nodes-base.code", "position": [ 412, 540 ], "parameters": { "jsCode": "// Get full profile data from the HTTP Request node\nconst profiles = $('Explorium Prospects API Call').first().json.data;\n\n// Get contact enrichment data from the current input\nconst contactEnrichments = $input.first().json.data;\n\n// Step 1: Create a lookup table for enriched contact info\nconst contactMap = {};\nfor (const contact of contactEnrichments) {\n contactMap[contact.prospect_id] = contact.data;\n}\n\n// Step 2: Merge profile with email info\nconst result = profiles.map(profile => {\n const contact = contactMap[profile.prospect_id];\n\n // Determine the best email\n let email = profile.email || \"\";\n if (contact) {\n email = contact.professions_email ||\n (contact.emails?.find(e => e.type === \"professional\")?.address) ||\n (contact.emails?.[0]?.address) ||\n \"\";\n }\n\n return {\n json: {\n ...profile,\n email // now includes enriched email if found\n }\n };\n});\n\nreturn result;\n" }, "typeVersion": 2 }, { "id": "a3c17adf-18fc-4f93-8324-784c8e18590b", "name": "Anthropic - Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic", "position": [ 860, 580 ], "parameters": { "model": { "__rl": true, "mode": "list", "value": "claude-3-7-sonnet-20250219", "cachedResultName": "Claude 3.7 Sonnet" }, "options": {} }, "credentials": { "anthropicApi": { "id": "FQdE6twB8nCJNoxV", "name": "Anthropic account" } }, "typeVersion": 1.3 }, { "id": "ede07723-80d0-4de2-90c5-12c45bfbed56", "name": "Send Slack", "type": "n8n-nodes-base.slack", "position": [ 1228, 540 ], "webhookId": "5d5bb3f1-0bc6-494b-8705-f108ee11b313", "parameters": { "text": "={{ $json.output }}", "select": "channel", "channelId": { "__rl": true, "mode": "list", "value": "C08U1DDTQ7Q", "cachedResultName": "evergreen-outbound-campaign" }, "otherOptions": {}, "authentication": "oAuth2" }, "credentials": { "slackOAuth2Api": { "id": "eOfca8yNWglvt3Ib", "name": "Slack account" } }, "typeVersion": 2.3 } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1" }, "versionId": "", "connections": { "Claude": { "ai_languageModel": [ [ { "node": "Email Writer (NO prospect data)", "type": "ai_languageModel", "index": 0 } ] ] }, "Send Slack": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Explorium MCP": { "ai_tool": [ [ { "node": "Company Researcher", "type": "ai_tool", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [], [ { "node": "Email Writer ( YES prospect data)", "type": "main", "index": 0 } ] ] }, "Company Researcher": { "main": [ [ { "node": "Explorium Prospects API Call", "type": "main", "index": 0 } ] ] }, "Anthropic Chat Model": { "ai_languageModel": [ [ { "node": "Company Researcher", "type": "ai_languageModel", "index": 0 } ] ] }, "Code - Format Object": { "main": [ [ { "node": "Code - Get prospect_ids", "type": "main", "index": 0 } ] ] }, "Anthropic - Chat Model": { "ai_languageModel": [ [ { "node": "Email Writer ( YES prospect data)", "type": "ai_languageModel", "index": 0 } ] ] }, "Code - Get prospect_ids": { "main": [ [ { "node": "Explorium Contacts Information API Call", "type": "main", "index": 0 } ] ] }, "Webhook - Product Launch": { "main": [ [ { "node": "Company Researcher", "type": "main", "index": 0 } ] ] }, "Explorium Prospects API Call": { "main": [ [ { "node": "Is there data on the company?", "type": "main", "index": 0 } ] ] }, "Is there data on the company?": { "main": [ [ { "node": "Email Writer (NO prospect data)", "type": "main", "index": 0 } ], [ { "node": "Code - Format Object", "type": "main", "index": 0 } ] ] }, "Email Writer (NO prospect data)": { "main": [ [ { "node": "Send Slack Message", "type": "main", "index": 0 } ] ] }, "Email Writer ( YES prospect data)": { "main": [ [ { "node": "Send Slack", "type": "main", "index": 0 } ] ] }, "Code - Merge profile with email info": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Explorium Contacts Information API Call": { "main": [ [ { "node": "Code - Merge profile with email info", "type": "main", "index": 0 } ] ] } } }