Animated data flow diagram

AI LinkedIn DM Router & Responder Agent

Version: 1.0.0 | Last Updated: 2025-06-16

Integrates with:

UniPile LinkedIn Notion Slack OpenAI n8n
Core AI Power
5/10
Automation Level
8/10
Integration Reach
6 systems
Setup Simplicity
5/10
Adaptability
8/10

Overview

Unlock Freedom from LinkedIn DM Overload with this AI Agent

Are you spending too much time manually sifting through LinkedIn messages, forwarding requests, and typing out similar replies? This AI-driven n8n workflow acts as your intelligent LinkedIn message assistant. It connects to your LinkedIn DMs via UniPile, analyzes incoming messages, matches them against your custom routing rules in Notion (or another database), and uses an AI model (like OpenAI, Gemini, or a local Ollama instance) to draft contextually appropriate responses. These drafts are then sent to Slack for your quick review and approval before the agent replies on your behalf. Stop being your company's unofficial customer service rep and focus on what truly matters.

Key AI Agent Abilities & Benefits

  • Automated Message Ingestion & Sender Context: Receives LinkedIn messages in real-time via UniPile and can be configured to look up sender details for better context.
  • Intelligent Intent Recognition & Routing: Compares message content against your customizable routing table (e.g., in Notion) to determine the nature of the inquiry (support, sales, partnership, etc.) and the appropriate action.
  • AI-Powered Response Generation: Leverages Large Language Models (LLMs) to generate personalized, helpful response drafts based on the matched routing rule and message content. You choose the AI provider!
  • Human-in-the-Loop Approval: Sends drafted responses to a designated Slack channel with simple approve/reject buttons, ensuring you maintain full control over outgoing communications. Drafts can be edited directly within Slack.
  • Automated LinkedIn Replies: Once approved, the agent automatically sends the response back to the sender on LinkedIn.
  • Standardize Common Replies: Easily create routes for questions you frequently answer to ensure consistent and timely information sharing.
  • Highly Customizable: Tailor the workflow to your exact needs. Swap Notion for Google Sheets or Airtable, choose different AI models, integrate other approval platforms (like email or Discord), and add custom logic for filtering or enrichment.

Use Cases

  • Automate triaging of LinkedIn DMs for founders, routing sales leads to CRM and support questions to helpdesks.
  • For B2C e-commerce: Instantly respond to common order status or product inquiries on LinkedIn, improving customer satisfaction.
  • For B2B SaaS: Qualify leads from LinkedIn messages, drafting initial engagement responses for the sales team.
  • Help developer advocates and marketers by filtering out irrelevant messages and auto-responding to FAQs about community programs or content.
  • Streamline handling of partnership or collaboration proposals received via LinkedIn, routing them to the correct internal team.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • UniPile account and API key with required messaging scopes.
  • Notion account (or alternative like Google Sheets, Airtable) for the message routing table. The table should include columns like 'Question_Pattern', 'Description', and 'Action_Instructions'.
  • Slack app with interactive components and incoming webhooks enabled. You'll need the app's webhook URL.
  • API Key for your chosen LLM provider (e.g., OpenAI, Gemini, Anthropic Claude) or a running instance of a local LLM like Ollama.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure UniPile: a. Sign up for a UniPile account. b. Create a webhook under the 'Messaging' section. c. Set the callback URL for the webhook to this workflow's production URL (copy from n8n Webhook node after deploying). d. Generate a UniPile API key with necessary scopes and add it to your n8n credentials for UniPile.
  4. Configure Slack: a. Create a new Slack App if you don't have one. b. Enable 'Incoming Webhooks' and add a new webhook for your desired channel. Copy this URL into the Slack node in n8n. c. Enable 'Interactivity & Shortcuts'. For the 'Request URL', use the webhook URL of the n8n 'Respond to Slack Interaction' node (or a dedicated webhook node that triggers that part of the flow). d. Use this Slack App Manifest template for easier setup (replace Your webhook url here with the n8n webhook URL for interactivity):
    "display_information": {
        "name": "Request Router",
        "description": "A bot that alerts when a new linkedin question comes in.",
        "background_color": "#12575e"
    },
    "features": {
        "bot_user": {
            "display_name": "Request Router",
            "always_online": false
        }
    },
    "oauth_config": {
        "scopes": {
            "bot": [
                "chat:write",
                "chat:write.customize",
                "chat:write.public",
                "links:write",
                "im:history",
                "im:read",
                "im:write"
            ]
        }
    },
    "settings": {
        "interactivity": {
            "is_enabled": true,
            "request_url": "Your webhook url here"
        },
        "org_deploy_enabled": false,
        "socket_mode_enabled": false,
        "token_rotation_enabled": false
    }
}```
5. **Configure Notion (or your database)**:
    a. Set up your database with at least three columns (e.g., `Question_Pattern`, `Description`, `Action_Instructions`).
    b. Connect the Notion node in n8n to this database and configure it to fetch routes.
6. **Configure the AI Node**:
    a. Choose your preferred AI model node (e.g., OpenAI Chat Model, Gemini, Anthropic Claude, or the generic LangChain Agent node with an Ollama model).
    b. Enter your API credentials for the chosen AI service.
    c. Customize the system prompt in the AI node to guide response generation style and tone.
7. **Update Placeholders**: Review nodes like 'HTTP Request' if they are used for specific LinkedIn profile lookups and ensure any placeholder IDs (e.g., for your own company page) are correctly set.
8. **Test**: Send some test DMs to your LinkedIn account that UniPile is monitoring. Check if they trigger the workflow, get routed correctly, generate a draft in Slack, and if the approved response is sent.
9. Activate the workflow.

Tags:

AI AgentLinkedIn AutomationLead Routingn8nNotionSlack

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Request a Consultation