Cmg Linkedin Outreach Service
Deprecated
Pricing
Pay per usage
Cmg Linkedin Outreach Service
Deprecated
Automates doing outreach on LinkedIn
0.0 (0)
Pricing
Pay per usage
0
Monthly users
1
Last modified
7 days ago
ConnectMeGroep LinkedIn Outreach Service
g
Overview
The ConnectMeGroep LinkedIn Outreach Service is an automated solution designed to streamline LinkedIn outreach activities for sales and marketing teams. This Python-based service uses browser automation, AI-powered messaging, and data tracking to create personalized LinkedIn interactions at scale while maintaining compliance with LinkedIn's usage policies.
Table of Contents
- Features
- System Requirements
- Installation
- Configuration
- Usage
- Architecture
- Troubleshooting
- Development
Features
Core Functionality
- Automated Connection Requests: Send personalized connection requests to targeted LinkedIn profiles based on configurable strategies.
- AI-Powered Messaging: Generate and send personalized messages using advanced AI models (OpenAI, Anthropic, or Google).
- Multi-Strategy Automation: Choose from multiple connection and messaging strategies:
- Connection strategies: Search results, LinkedIn suggestions, or custom profile list
- Messaging strategies: All connections, new connections, search-based, or custom list
- Profile Targeting: Target prospects based on keywords, locations, and industries.
- Notification Management: Automatically process LinkedIn notifications and pending invitations.
- Connection Analytics: Track outreach performance and store results in Firebase.
Technical Features
- Detection Avoidance: Uses undetected-chromedriver to minimize the risk of automation detection.
- Multi-Provider AI: Supports OpenAI (GPT-4), Anthropic (Claude), and Google (Gemini) AI models.
- Rate Limiting: Built-in safeguards to ensure compliance with LinkedIn's usage limits.
- Cloud Deployment: Runs as an Apify Actor for easy cloud deployment and scheduling.
- Persistent Storage: Firebase integration for storing outreach data and analytics.
System Requirements
Basic Requirements
- Python 3.11 or higher
- Chrome browser
- Internet connection with access to LinkedIn
Python Dependencies
The service relies on several Python packages including:
- Selenium and undetected-chromedriver for browser automation
- OpenAI, Anthropic, and Google Generative AI libraries for AI capabilities
- Firebase Admin SDK for data storage
- Apify SDK for Actor integration
- Additional utilities for logging, data validation, etc.
Installation
Setup Environment
-
Clone the repository
1git clone https://github.com/connectmegroep/linkedin-outreach-service.git 2cd linkedin-outreach-service
-
Install dependencies
pip install -r requirements.txt
Firebase Setup (Optional)
If you want to use Firebase for data storage:
- Create a Firebase project in the Firebase Console
- Generate a service account key from Project Settings > Service Accounts
- Download the JSON file and base64 encode it for use in the configuration
Configuration
The service is configured through the Apify Actor input, which includes the following parameters:
Required Parameters
linkedin_username
: Your LinkedIn account email/usernamelinkedin_password
: Your LinkedIn account password
AI Integration (Optional)
openai_api_key
: OpenAI API key for message generationanthropic_api_key
: Anthropic API key for message generationgoogle_api_key
: Google AI API key for message generation
Firebase Integration (Optional)
firebase_service_account
: Base64-encoded Firebase service account JSONfirebase_project_id
: Firebase project IDfirebase_outreach_collection
: Firebase collection for outreach data (default: "linkedin_outreach")user_id
: User ID for Firebase data association
Operational Limits
max_messages
: Maximum number of messages to send (default: 20)max_connections
: Maximum number of connection requests to send (default: 20)max_runtime_hours
: Maximum runtime in hours (default: 2.0)
Outreach Strategies
messaging_strategy
: Strategy for sending messagesall_connections
: Message all connectionsnew_connections
: Message only new connections (default)specific_search
: Message connections matching search criteriafrom_list
: Message specific profiles from a list
connection_strategy
: Strategy for sending connection requestssearch_results
: Connect with people from search results (default)suggestions
: Connect with LinkedIn's suggested connectionsfrom_list
: Connect with specific profiles from a list
Search Parameters
search_keywords
: Keywords to use in LinkedIn search (required for "search_results" strategy)search_locations
: Locations to filter LinkedIn searchsearch_industries
: Industries to filter LinkedIn search
Profile Lists
profile_urls
: List of LinkedIn profile URLs for "from_list" strategies
Message Templates
connection_message
: Template message to send with connection requestsmessage_templates
: List of template messages for outreach
Processing Options
process_notifications
: Whether to process LinkedIn notifications (default: true)process_pending_invitations
: Whether to process pending invitations (default: true)
Browser Options
headless
: Whether to run the browser in headless mode (default: true)
Usage
Running Locally
- Create a configuration file with your LinkedIn credentials and desired settings
- Run the main script:
python -m src.main
Running on Apify
- Deploy the code to Apify
- Configure the Actor input with your LinkedIn credentials and settings
- Start the Actor run
Sample Configuration
1{ 2 "linkedin_username": "your.email@example.com", 3 "linkedin_password": "your-password", 4 "max_messages": 10, 5 "max_connections": 15, 6 "connection_strategy": "search_results", 7 "messaging_strategy": "new_connections", 8 "search_keywords": ["CTO", "VP Engineering", "Head of Technology"], 9 "search_locations": ["United States", "United Kingdom"], 10 "message_templates": [ 11 "Hi {{first_name}}, I noticed you're working in {{industry}}. I'd love to connect and share insights about {{common_interest}}.", 12 "Hello {{first_name}}, I saw your profile and was impressed by your experience in {{job_role}}. I'd like to connect to discuss potential collaboration opportunities." 13 ], 14 "headless": true 15}
Architecture
Component Overview
The service is built with a modular architecture:
-
Main Entry Point (
src/main.py
): Initializes the Apify Actor and orchestrates the overall flow. -
LinkedIn Scraper (
src/services/linkedin_scraper.py
): Core module that handles all LinkedIn interactions:- Logging in to LinkedIn
- Sending connection requests
- Sending messages to connections
- Processing notifications and invitations
-
AI Integration (
src/services/pchain/
):chainable.py
: Manages interactions with AI providerschain_prompt_manager.py
: Loads and processes prompt templates- Prompt templates: JSON files with structured prompts for different scenarios
-
Firebase Service (
src/services/firebase_service.py
): Handles data storage in Firebase. -
Models (
src/models/
):actor_models.py
: Defines the configuration schema and validationlinkedin_scraper.py
: Models for LinkedIn scraping operations
-
Utilities (
src/lib/
):logger.py
: Logging configurationsettings.py
: Global settingsutils/
: Utility functions
Data Flow
- User configures the service with LinkedIn credentials and settings
- Service logs into LinkedIn using undetected-chromedriver
- Based on the selected strategies, the service:
- Searches for profiles or uses provided profile lists
- Makes decisions on who to connect with (optionally using AI)
- Sends connection requests with personalized messages
- Sends follow-up messages to connections
- Processes notifications and pending invitations
- Results are stored in Firebase (if configured)
- Statistics are reported back to the user
Troubleshooting
Common Issues
Authentication Failures
- Verify your LinkedIn credentials are correct
- Check if LinkedIn is requiring additional verification
- Try logging in manually first, then run the service
Rate Limiting
- If LinkedIn is blocking actions, reduce the number of daily connection requests and messages
- Add more random delays between actions
- Use a LinkedIn account with a good reputation (older accounts with activity)
Browser Automation Issues
- Update Chrome to the latest version
- Ensure Chrome is properly installed on your system
- Try running in non-headless mode for debugging
Logs
The service uses detailed logging to help troubleshoot issues:
- Check the console output for error messages
- Apify runs will contain detailed logs in the Apify console
Development
Project Structure
1src/ 2├── __init__.py 3├── __main__.py 4├── main.py # Main entry point 5├── lib/ # Utility libraries 6│ ├── __init__.py 7│ ├── logger.py # Logging configuration 8│ ├── settings.py # Global settings 9│ └── utils/ # Utility functions 10│ ├── __init__.py 11│ └── encryption.py # Encryption utilities 12├── models/ # Data models 13│ ├── __init__.py 14│ ├── actor_models.py # Input models and validation 15│ └── linkedin_scraper.py # Scraper-specific models 16├── services/ # Service implementations 17│ ├── __init__.py 18│ ├── firebase_service.py # Firebase integration 19│ ├── linkedin_scraper.py # LinkedIn automation 20│ └── pchain/ # AI prompt chaining 21│ ├── __init__.py 22│ ├── chainable.py # AI model integration 23│ ├── chain_prompt_manager.py # Prompt management 24│ ├── responses.py # Response models 25│ └── prompt_chains/ # Prompt templates 26│ ├── prompt_follow_user.json 27│ ├── prompt_is_invite_connection.json 28│ ├── prompt_is_pending_message.json 29│ └── prompt_received_connection.json 30└── temp/ # Temporary files 31 └── __init__.py
Extending the Service
To add new features:
- New AI Prompt Templates: Add new JSON files to
prompt_chains/
directory - Additional Connection Strategies: Extend the
ConnectionStrategy
enum and implement inlinkedin_scraper.py
- Custom Message Templates: Add to the
message_templates
input parameter
Best Practices
- Respect LinkedIn's terms of service and usage limits
- Test changes in non-headless mode to observe behavior
- Use thoughtful personalization in message templates
- Implement gradual ramp-up for new LinkedIn accounts
Pricing
Pricing model
Pay per usageThis Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.