LinkedIn lead generation: Auto DM system with comment triggers using Unipile & NocoDB
Short Description
This LinkedIn automation workflow monitors post comments for specific trigger words and automatically sends direct messages with lead magnets to engaged users. The system checks connection status, handles non-connected users with connection requests, and prevents duplicate outreach by tracking all interactions in a database.
Key Features
- Comment Monitoring: Scans LinkedIn post comments for customizable trigger words
- Connection Status Check: Determines if users are 1st-degree connections
- Automated DMs: Sends personalized messages with lead magnet links to connected users
- Connection Requests: Asks non-connected users to connect via comment replies
- Duplicate Prevention: Tracks interactions in NocoDB to avoid repeat messages
- Message Rotation: Uses different comment reply variations for authenticity
- Batch Processing: Handles multiple comments with built-in delays
Who This Workflow Is For
- Content creators looking to convert post engagement into leads
- Coaches and consultants sharing valuable LinkedIn content
- Anyone wanting to automate lead capture from LinkedIn posts
How It Works
- Setup: Configure post ID, trigger word, and lead magnet link via form
- Comment Extraction: Retrieves all comments from the specified post using Unipile
- Trigger Detection: Filters comments containing the specified trigger word
- Connection Check: Determines if commenters are 1st-degree connections
- Smart Routing: Connected users receive DMs, others get connection requests
- Database Logging: Records all interactions to prevent duplicates
Setup Requirements
Required Credentials
- Unipile API Key: For LinkedIn API access
- NocoDB API Token: For database tracking
Database Structure
**Table: leads
linkedin_id: LinkedIn user IDname: User's full nameheadline: LinkedIn headlineurl: Profile URLdate: Interaction dateposts_id: Post referenceconnection_status: Network distancedm_status: Interaction type (sent/connection request)
Customization Options
- Message Templates: Modify DM and connection request messages
- Trigger Words: Change the words that activate the workflow
- Timing: Adjust delays between messages (8-12 seconds default)
- Reply Variations: Add more comment reply options for authenticity
Installation Instructions
- Import the workflow into your n8n instance
- Set up NocoDB database with required table structure
- Configure Unipile and NocoDB credentials
- Set environment variables for Unipile root URL and LinkedIn account ID
- Test with a sample post before full use
n8n Form Trigger to NocoDB Record Creation
This n8n workflow automates the process of capturing data submitted via an n8n form and storing it in a NocoDB database. It includes logic to handle potential duplicate entries and ensures that each submission is processed individually with a short delay.
What it does
- Listens for Form Submissions: The workflow starts when an n8n form is submitted.
- Checks for Existing Records: It queries NocoDB to see if a record with the same "Email" (or a similar unique identifier) already exists.
- Filters New vs. Existing: Based on the NocoDB query, it filters the incoming form submissions into two branches:
- New Records: Submissions that do not have a matching "Email" in NocoDB.
- Existing Records: Submissions that already have a matching "Email" in NocoDB.
- Creates New NocoDB Records: For new submissions, it creates a new record in the specified NocoDB table.
- Processes in Batches with Delay: To prevent overwhelming the NocoDB API and ensure reliable processing, it processes new records in batches, introducing a short wait period between each batch.
Prerequisites/Requirements
- n8n Instance: A running n8n instance to host the workflow.
- NocoDB Account/Instance: Access to a NocoDB instance with a configured base and table where the form data will be stored.
- NocoDB Credentials: An API token or other authentication details for NocoDB configured as a credential in n8n.
- n8n Form: An n8n Form Trigger node configured to capture the necessary data (e.g., Email, Name).
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure NocoDB Credentials:
- Locate the "NocoDB" node (ID: 510).
- Update its credentials to connect to your NocoDB instance.
- Specify the Base ID and Table ID where you want to store the form data.
- Configure n8n Form Trigger:
- Locate the "On form submission" node (ID: 1225).
- Ensure the form is configured to capture the fields you intend to save to NocoDB (e.g.,
email,name). - Activate the workflow to generate the webhook URL for your form.
- Adjust Logic (Optional):
- "Check if Email exists" (HTTP Request node ID: 19): Modify the URL and query parameters to match your NocoDB table's API endpoint and the field you use for checking uniqueness (e.g.,
Email). - "If" node (ID: 20): Adjust the condition to accurately determine if a record already exists based on the response from the "Check if Email exists" node.
- "Loop Over Items" (ID: 39) and "Wait" (ID: 514): Adjust batch size and wait time as needed for your specific NocoDB rate limits or performance requirements.
- "Create NocoDB Record" (NocoDB node ID: 510): Map the incoming form data to the correct columns in your NocoDB table.
- "Check if Email exists" (HTTP Request node ID: 19): Modify the URL and query parameters to match your NocoDB table's API endpoint and the field you use for checking uniqueness (e.g.,
- Activate the Workflow: Once configured, activate the workflow. It will now automatically process form submissions and create/update records in NocoDB.
Related Templates
Automate invoice processing with OCR, GPT-4 & Salesforce opportunity creation
PDF Invoice Extractor (AI) End-to-end pipeline: Watch Drive ➜ Download PDF ➜ OCR text ➜ AI normalize to JSON ➜ Upsert Buyer (Account) ➜ Create Opportunity ➜ Map Products ➜ Create OLI via Composite API ➜ Archive to OneDrive. --- Node by node (what it does & key setup) 1) Google Drive Trigger Purpose: Fire when a new file appears in a specific Google Drive folder. Key settings: Event: fileCreated Folder ID: google drive folder id Polling: everyMinute Creds: googleDriveOAuth2Api Output: Metadata { id, name, ... } for the new file. --- 2) Download File From Google Purpose: Get the file binary for processing and archiving. Key settings: Operation: download File ID: ={{ $json.id }} Creds: googleDriveOAuth2Api Output: Binary (default key: data) and original metadata. --- 3) Extract from File Purpose: Extract text from PDF (OCR as needed) for AI parsing. Key settings: Operation: pdf OCR: enable for scanned PDFs (in options) Output: JSON with OCR text at {{ $json.text }}. --- 4) Message a model (AI JSON Extractor) Purpose: Convert OCR text into strict normalized JSON array (invoice schema). Key settings: Node: @n8n/n8n-nodes-langchain.openAi Model: gpt-4.1 (or gpt-4.1-mini) Message role: system (the strict prompt; references {{ $json.text }}) jsonOutput: true Creds: openAiApi Output (per item): $.message.content → the parsed JSON (ensure it’s an array). --- 5) Create or update an account (Salesforce) Purpose: Upsert Buyer as Account using an external ID. Key settings: Resource: account Operation: upsert External Id Field: taxid_c External Id Value: ={{ $json.message.content.buyer.tax_id }} Name: ={{ $json.message.content.buyer.name }} Creds: salesforceOAuth2Api Output: Account record (captures Id) for downstream Opportunity. --- 6) Create an opportunity (Salesforce) Purpose: Create Opportunity linked to the Buyer (Account). Key settings: Resource: opportunity Name: ={{ $('Message a model').item.json.message.content.invoice.code }} Close Date: ={{ $('Message a model').item.json.message.content.invoice.issue_date }} Stage: Closed Won Amount: ={{ $('Message a model').item.json.message.content.summary.grand_total }} AccountId: ={{ $json.id }} (from Upsert Account output) Creds: salesforceOAuth2Api Output: Opportunity Id for OLI creation. --- 7) Build SOQL (Code / JS) Purpose: Collect unique product codes from AI JSON and build a SOQL query for PricebookEntry by Pricebook2Id. Key settings: pricebook2Id (hardcoded in script): e.g., 01sxxxxxxxxxxxxxxx Source lines: $('Message a model').first().json.message.content.products Output: { soql, codes } --- 8) Query PricebookEntries (Salesforce) Purpose: Fetch PricebookEntry.Id for each Product2.ProductCode. Key settings: Resource: search Query: ={{ $json.soql }} Creds: salesforceOAuth2Api Output: Items with Id, Product2.ProductCode (used for mapping). --- 9) Code in JavaScript (Build OLI payloads) Purpose: Join lines with PBE results and Opportunity Id ➜ build OpportunityLineItem payloads. Inputs: OpportunityId: ={{ $('Create an opportunity').first().json.id }} Lines: ={{ $('Message a model').first().json.message.content.products }} PBE rows: from previous node items Output: { body: { allOrNone:false, records:[{ OpportunityLineItem... }] } } Notes: Converts discount_total ➜ per-unit if needed (currently commented for standard pricing). Throws on missing PBE mapping or empty lines. --- 10) Create Opportunity Line Items (HTTP Request) Purpose: Bulk create OLIs via Salesforce Composite API. Key settings: Method: POST URL: https://<your-instance>.my.salesforce.com/services/data/v65.0/composite/sobjects Auth: salesforceOAuth2Api (predefined credential) Body (JSON): ={{ $json.body }} Output: Composite API results (per-record statuses). --- 11) Update File to One Drive Purpose: Archive the original PDF in OneDrive. Key settings: Operation: upload File Name: ={{ $json.name }} Parent Folder ID: onedrive folder id Binary Data: true (from the Download node) Creds: microsoftOneDriveOAuth2Api Output: Uploaded file metadata. --- Data flow (wiring) Google Drive Trigger → Download File From Google Download File From Google → Extract from File → Update File to One Drive Extract from File → Message a model Message a model → Create or update an account Create or update an account → Create an opportunity Create an opportunity → Build SOQL Build SOQL → Query PricebookEntries Query PricebookEntries → Code in JavaScript Code in JavaScript → Create Opportunity Line Items --- Quick setup checklist 🔐 Credentials: Connect Google Drive, OneDrive, Salesforce, OpenAI. 📂 IDs: Drive Folder ID (watch) OneDrive Parent Folder ID (archive) Salesforce Pricebook2Id (in the JS SOQL builder) 🧠 AI Prompt: Use the strict system prompt; jsonOutput = true. 🧾 Field mappings: Buyer tax id/name → Account upsert fields Invoice code/date/amount → Opportunity fields Product name must equal your Product2.ProductCode in SF. ✅ Test: Drop a sample PDF → verify: AI returns array JSON only Account/Opportunity created OLI records created PDF archived to OneDrive --- Notes & best practices If PDFs are scans, enable OCR in Extract from File. If AI returns non-JSON, keep “Return only a JSON array” as the last line of the prompt and keep jsonOutput enabled. Consider adding validation on parsing.warnings to gate Salesforce writes. For discounts/taxes in OLI: Standard OLI fields don’t support per-line discount amounts directly; model them in UnitPrice or custom fields. Replace the Composite API URL with your org’s domain or use the Salesforce node’s Bulk Upsert for simplicity.
Automated weekly security audit reports with Gmail delivery
🔒 N8N Security Audit Report - Automated Weekly Email 🎯 What does this workflow do? This workflow automatically generates and emails a comprehensive security audit report for your N8N instance every week. It identifies potential security risks related to: Credentials 🔑 : Exposed or insecure credentials Nodes 🧩 : Sensitive nodes (Code, HTTP Request, SSH, FTP, etc.) Instance settings 🏢 : Global security configuration Community nodes 📦 : Third-party nodes that may pose risks The report includes direct links to affected workflows, execution statuses, and actionable recommendations. --- ✨ Key Features 📊 Smart Risk Assessment Calculates overall risk level: 🟩 Low / 🟧 Moderate / 🟥 High Tracks unique credentials (not just total occurrences) Provides detailed breakdown by node type 🔗 Direct Workflow Links Clickable links to each workflow mentioned Shows last execution status (🟢 success / 🔴 failed) Displays execution timestamps 🌍 Bilingual Support Full support for French and English Switch language with a single variable 📧 Beautiful HTML Email Clean, professional formatting Color-coded risk levels Emoji icons for easy scanning --- 🚀 Quick Setup (5 minutes) 1️⃣ Configure Credentials N8N API: Generate an API key in your N8N settings Gmail OAuth2: Set up OAuth2 for Gmail sending 2️⃣ Set Your Variables Edit the "Set Config Variables" node: javascript { "email_to": "your.email@domain.com", "project_name": "My-N8N-Project", "server_url": "https://n8n.yourdomain.com", // NO trailing slash! "Language": "EN" // or "FR" } 3️⃣ Test & Activate Click "Execute Workflow" to test Check your email inbox Activate for weekly automation --- 📧 Example Report Output Subject: 🔒 Audit Report My-Project – Risk 🟧 Moderate Content: 📊 Summary • Credentials involved: 8 (5 unique) • Nodes involved: 12 💻 code: 4 🌐 httpRequest: 3 🔐 ssh: 2 • Community nodes: 1 • Overall risk level: 🟧 Moderate 🔐 Credentials Risk Report 🔹 Credentials with full access 🔑 My AWS Credentials 🔑 Database Admin 📋 Workflow: Data Processing Pipeline 🟢 (25-10-2024 06:15 → 06:16) 💻 Process Data 🌐 API Call 🧩 Nodes Risk Report [...detailed node analysis...] --- 🎨 Customization Options Change Schedule Modify the "Schedule Trigger" node to run: Daily at 8 AM Monthly on the 1st Custom cron expression Add Recipients Add multiple emails in the Gmail node's toList parameter Adjust Risk Thresholds Edit the JavaScript in "Format Audit Report" nodes to customize when risk levels change Use Different Email Service Replace Gmail node with: SMTP Microsoft Outlook SendGrid Any email service N8N supports --- 💡 Use Cases ✅ Compliance Monitoring: Track security posture for audits ✅ Team Awareness: Keep your team informed of security status ✅ Change Detection: Notice when new risky nodes are added ✅ Best Practices: Get recommendations to improve security ✅ Multi-Environment: Run separate instances for dev/staging/prod --- 🔧 Technical Details Nodes Used: 8 Credentials Required: 2 (N8N API + Gmail OAuth2) External Dependencies: None N8N Version: Compatible with latest N8N versions Execution Time: ~10-20 seconds --- 📋 Requirements N8N instance with API access Gmail account (or other email service) N8N API key with audit permissions Valid SSL certificate for workflow links (recommended) --- 🐛 Troubleshooting Empty report? → Check your N8N API key has audit permissions Workflow links don't work? → Verify server_url is correct and has no trailing slash No execution status shown? → Workflows must have been executed at least once Wrong language displayed? → Set Language to exactly "FR" or "EN" (uppercase) --- 🌟 Why This Template? Unlike basic monitoring tools, this workflow: ✅ Provides context-aware security analysis ✅ Links directly to affected workflows ✅ Shows real execution data (not just theoretical risks) ✅ Calculates unique credential exposure (not just counts) ✅ Supports bilingual reports ✅ Delivers actionable recommendations --- 🤝 Feedback & Support Found this helpful? Please rate the template! Have suggestions? Drop a comment below. Pro tip: Combine this with N8N's native alerting for real-time incident response! --- Tags: security audit monitoring compliance automation email reporting credentials governance --- 📜 License MIT - Feel free to modify and share!
Automate YouTube thumbnail creation & social publishing with Templated.io & Blotato
💥 Automate YouTube thumbnail creation from video links (with templated.io) Who is this for? This workflow is designed for content creators, YouTubers, and automation enthusiasts who want to automatically generate stunning YouTube thumbnails and streamline their publishing workflow — all within n8n. If you regularly post videos and spend hours designing thumbnails manually, this automation is built for you. --- What problem is this workflow solving? Creating thumbnails is time-consuming — yet crucial for video performance. This workflow completely automates that process: No more manual design. No more downloading screenshots. No more repetitive uploads. In less than 2 minutes, you can refresh your entire YouTube thumbnail library and make your channel look brand new. --- What this workflow does Once activated, this workflow can: ✅ Receive YouTube video links via Telegram ✅ Extract metadata (title, description, channel info) via YouTube API ✅ Generate a custom thumbnail automatically using Templated.io ✅ Upload the new thumbnail to Google Drive ✅ Log data in Google Sheets ✅ Send email and Telegram notifications when ready ✅ Create and publish AI-generated social posts on LinkedIn, Facebook, and Twitter via Blotato Bonus: You can re-create dozens of YouTube covers in minutes — saving up to 5 hours per week and around $500/month in manual design effort. --- Setup 1️⃣ Get a YouTube Data API v3 key from Google Cloud Console 2️⃣ Create a Templated.io account and get your API key + template ID 3️⃣ Set up a Telegram bot using @BotFather 4️⃣ Create a Google Drive folder and copy the folder ID 5️⃣ Create a Google Sheet with columns: Date, Video ID, Video URL, Title, Thumbnail Link, Status 6️⃣ Get your Blotato API key from the dashboard 7️⃣ Connect your social media accounts to Blotato 8️⃣ Fill all credentials in the Workflow Configuration node 9️⃣ Test by sending a YouTube URL to your Telegram bot --- How to customize this workflow Replace the Templated.io template ID with your own custom thumbnail layout Modify the OpenAI node prompts to change text tone or style Add or remove social platforms in the Blotato section Adjust the wait time (default: 5 minutes) based on template complexity Localize or translate the generated captions as needed --- Expected Outcome With one Telegram message, you’ll receive: A professional custom thumbnail An instant email + Telegram notification A Google Drive link with your ready-to-use design And your social networks will be automatically updated — no manual uploads. --- Credits Thumbnail generation powered by Templated.io Social publishing powered by Blotato Automation orchestrated via n8n --- 👋 Need help or want to customize this? 📩 Contact: LinkedIn 📺 YouTube: @DRFIRASS 🚀 Workshops: Mes Ateliers n8n 🎥 Watch This Tutorial --- 📄 Documentation: Notion Guide Need help customizing? Contact me for consulting and support : Linkedin / Youtube / 🚀 Mes Ateliers n8n