LinkedIn AI Content Automation System
An end-to-end JavaScript automation that researches, creates, publishes and tracks LinkedIn content — from topic selection and AI content generation to scheduled publishing and performance tracking.
Posting on LinkedIn consistently means researching topics, writing posts, designing visuals, choosing hashtags, publishing at the right time and then tracking how each post performs. Done manually, it is repetitive, slow and easy to drop.
I built a JavaScript-based LinkedIn automation system that manages the complete content lifecycle. It selects relevant digital-marketing topics, generates post copy and images, adds hashtags, publishes through browser automation, and stores publishing and analytics data to improve future content.
One execution, nine coordinated steps.
Each agent owns one responsibility.
Content Generation Agent
- Selects relevant digital-marketing topics
- Generates professional LinkedIn posts
- Creates hooks and calls to action
- Adds relevant hashtags
Image Agent
- Generates or selects post visuals
- Matches imagery to the post topic
- Prepares LinkedIn-friendly formats
Publishing Agent
- Playwright browser automation
- Opens LinkedIn and composes the post
- Supports scheduled publishing
- Stores published post URL and ID
Analytics Agent
- Records publish date and post URL
- Tracks engagement information
- Stores analytics in JSON
- Feeds results back into future content
Automation Orchestrator
- Connects every agent in order
- Handles errors and workflow status
- Blocks incomplete posts from publishing
Modular Node.js architecture.
Built using a modular Node.js architecture with Playwright browser automation, AI-powered content agents, scheduled workflows, JSON-based analytics storage and automated post-publishing processes.
The orchestrator in nine lines.
async function runContentWorkflow() {
const topic = await selectTopic();
const content = await generatePost(topic);
const image = await generatePostImage(topic);
const result = await publishToLinkedIn({
content,
image
});
await savePublishingAnalytics(result);
}This workflow coordinates topic selection, AI content creation, image generation, publishing and analytics storage.
linkedin-ai-agent/
├── agents/
│ ├── topic-agent.js
│ ├── content-agent.js
│ ├── image-agent.js
│ ├── publisher-agent.js
│ └── analytics-agent.js
├── dashboard/
├── data/
│ ├── content-database.json
│ └── post-analytics.json
├── automation/
├── orchestrator.js
├── run.js
└── package.jsonEvery agent has a specific responsibility, and the orchestrator manages the complete process from topic to analytics.
The hard parts.
Credentials, session files and cookies stay outside the repository via environment variables and .gitignore.
What the system actually delivers.
Want a walkthrough?
Happy to share a live demo of the workflow, the repository and a published post.