Muhammad Aleem Logo
Muhammad Aleem
Loading Experience...
TikTok & Instagram Video Automation main screenshotTikTok & Instagram Video Automation secondary screenshot

TikTok & Instagram Video Automation

An automated video creation and scheduling system powered by AI models, Python, and webhook actions.

PythonPythonAI/MLAI/MLn8nn8nWebhookWebhookAPI IntegrationAPI Integration
AI Workflow
Type
n8n + Python
Platform
Automated
Posting
Why I built this
Creating social media short-form video content consistently is extremely time-consuming. I wanted to design an end-to-end automated system that could brainstorm trending video ideas, assemble relevant media clips, generate voiceovers, overlays, and background music, and publish them to TikTok and Instagram automatically, allowing creator channels to run completely on autopilot.
How it works
An n8n workflow serves as the orchestrator. It triggers daily schedules, polls trending topics, and invokes Python scripts that run image/video generation APIs or local media editing suites (like MoviePy). A ChatGPT/Claude microservice drafts engaging scripts and visual descriptions. Once the video file is compiled, it uses the Instagram Graph API and TikTok Content Posting API via webhooks to upload and schedule the post, complete with optimized hashtags.
Key decisions

Design choices

Orchestrating with n8n

Instead of writing complex custom cron jobs and state management, n8n provided a visual, easily debuggable node canvas that handles API authorization, retries, and errors reliably.

Python for video composition

I utilized Python's rich media libraries for programmatic video compilation, combining images, audio tracks, and caption overlays into a cohesive video file with correct social aspect ratios.

Challenges

Problems solved

Social media API upload constraints

TikTok and Instagram have strict video format requirements (resolution, bitrate, duration). I had to fine-tune the Python rendering settings to output exactly compliant MP4 files to prevent uploads from failing.

What I learned
This project deepened my knowledge of media processing and workflow orchestration. I learned how to handle rate-limits and large payload uploads over HTTP, and how to create self-healing automation runs that catch errors (like a failed API request) and notify me without breaking the entire pipeline.
👋 Need a quick tour of Aleem's portfolio?