A polished AI-powered automation system that discovers fresh tech and AI trends, writes engaging LinkedIn posts, generates matching visuals, publishes them automatically, and tracks the workflow with logs and notifications.
- LinkedIn AI Post Automation
This project combines modern AI APIs, automation workflows, and social media publishing into a single, practical solution for building a daily LinkedIn presence without manual effort. It is designed for developers, creators, and professionals who want to share thought leadership content consistently.
- Finds current AI and technology topics from live web sources
- Writes a concise, high-quality LinkedIn post
- Generates a matching image prompt and visual
- Publishes the content to LinkedIn
- Logs the activity and notifies the owner by email
Creating consistent content on LinkedIn can be time-consuming, especially when balancing research, writing, ideation, and publishing. This project removes that friction by automating the end-to-end workflow so users can focus on strategy while the system handles execution.
It is also a strong portfolio project because it brings together:
- API integrations
- automation and scheduling
- secure environment configuration
- external service orchestration
- practical deployment readiness
- π€ Smart topic discovery using real-time search data
- βοΈ AI-generated LinkedIn post content with quality checks
- πΌοΈ Visual asset generation for more engaging posts
- π Duplicate prevention through Google Sheets tracking
- π§ Email alerts for success or failure cases
- βοΈ Scheduled execution using local automation or GitHub Actions
- π Secure configuration via environment variables
- π Python 3.13+
- π€ Groq Cloud API for post generation and scoring
- π Tavily API for live topic discovery and research
- π¨ Pollinations.AI for image generation
- πΌ LinkedIn API for publishing posts
- π Google Sheets API for logging and duplicate detection
- βοΈ Gmail SMTP for email notifications
- π§° GitHub Actions for automation workflows
- π¦ python-dotenv, requests, schedule, gspread, google-auth
graph TD
subgraph Trigger
Cron[GitHub Actions Cron / Local Daemon]
end
subgraph Config & Environment
Env[".env File (Secrets & Config)"] --> Config[config.py Loader & Validator]
end
subgraph Core Automation Flow [main.py]
Start([Start Daily Workflow])
Discovery[1. Topic Discovery<br/>Tavily News Search]
DupCheck[2. Duplicate Check<br/>Read Column A]
Research[3. Deep Research<br/>Tavily Advanced Search]
GenPost[4. Post Generation<br/>Groq Llama-3.3-70B]
QualityCheck[5. Quality Evaluator<br/>Groq low-temp scoring]
GenPrompt[6. Custom Image Prompt<br/>Groq context generation]
GenImage[7. Image Generation<br/>Pollinations.AI Flux API]
UploadImage[8. Initialize & Upload Image<br/>LinkedIn Images API]
PublishPost[9. Publish Post with Image<br/>LinkedIn Posts API]
LogRun[10. Append Log Row<br/>Google Sheets]
Notify[11. Email Alert<br/>Gmail SMTP SSL]
end
subgraph External APIs & Services
TavilyAPI[(Tavily AI API)]
SheetsAPI[(Google Sheets API)]
GroqAPI[(Groq Cloud API)]
PollinationsAPI[(Pollinations.AI)]
LinkedinAPI[(LinkedIn API)]
GmailSMTP[(Gmail SMTP Server)]
end
Cron --> Start
Config -.-> Start
Start --> Discovery
Discovery <-->|Fetch random trending news| TavilyAPI
Discovery --> DupCheck
DupCheck <-->|Query check dates| SheetsAPI
DupCheck -->|Already Posted| Skip[Skip & Exit]
DupCheck -->|Not Posted| Research
Research <-->|Fetch deep article summary| TavilyAPI
Research --> GenPost
GenPost <-->|Prompt with research| GroqAPI
GenPost --> QualityCheck
QualityCheck <-->|Grade 1-10| GroqAPI
QualityCheck -->|Score < Min Score| GenPost
QualityCheck -->|Score >= Min Score| GenPrompt
GenPrompt <-->|Generate visual prompt| GroqAPI
GenPrompt --> GenImage
GenImage <-->|Fetch Flux image bytes| PollinationsAPI
GenImage --> UploadImage
UploadImage <-->|Upload image bytes| LinkedinAPI
UploadImage --> PublishPost
PublishPost <-->|Post commentary & image asset| LinkedinAPI
PublishPost --> LogRun
LogRun --->|Log Success Status| SheetsAPI
LogRun --> Notify
Notify --->|Send Status Report| GmailSMTP
Notify --> End([End Workflow])
linkedin-automation/
βββ .github/
β βββ workflows/
β βββ linkedin-post.yml
βββ credentials/
βββ logs/
βββ config.py
βββ get_linkedin_token.py
βββ main.py
βββ requirements.txt
βββ .env.example
βββ LICENSE
βββ README.md
git clone https://github.com/your-username/linkedin-automation.git
cd linkedin-automationpython -m venv .venv
source .venv/bin/activatepip install -r requirements.txtcp .env.example .envThen fill in the required values in the .env file.
Place your Google Service Account JSON file inside the credentials/ folder and point GOOGLE_CREDENTIALS_FILE to it.
Example configuration:
GROQ_API_KEY=your_groq_key
TAVILY_API_KEY=your_tavily_key
POLLINATIONS_API_KEY=your_pollinations_key
LINKEDIN_ACCESS_TOKEN=your_linkedin_token
LINKEDIN_PERSON_URN=your_linkedin_person_urn
LINKEDIN_CLIENT_ID=your_client_id
LINKEDIN_CLIENT_SECRET=your_client_secret
GOOGLE_SHEET_ID=your_google_sheet_id
GOOGLE_CREDENTIALS_FILE=credentials/your-service-account.json
SHEET_NAME=Posts
GMAIL_SENDER=you@example.com
GMAIL_RECEIVER=you@example.com
GMAIL_APP_PASSWORD=your_app_password
POST_TIME=10:00
MAX_RETRIES=3
QUALITY_MIN_SCORE=6python main.py --nowpython main.pypython get_linkedin_token.pyThis project does not expose a public REST API. It runs as an automation script locally or via GitHub Actions.
Suggested demo items:
- Workflow execution logs
- Sample generated LinkedIn post
- Example image output
- Google Sheets tracking view
Planned improvements include:
- π§ Better post personalization based on user profile or niche
- π Analytics dashboard for post performance
- ποΈ Support for multiple social platforms
- π§ͺ Automated tests and CI validation
- βοΈ Dockerized deployment for easier hosting
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
Please keep the code clean, document new features clearly, and follow the existing project style.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the teams and services behind:
- Groq
- Tavily
- Pollinations.AI
- Google Sheets API
- LinkedIn API
- GitHub Actions
Built with the goal of making AI-driven content automation practical, professional, and accessible.