Social Media Content Engine
AI Art Director + Image Generation Pipeline for Multi-Clinic Social Content
Context
Aesthetic clinics needed consistent social media presence but producing quality content required a copywriter, designer, and community manager per clinic. Multiplied across N clinics, the operational cost was unsustainable.
Solution
An AI pipeline with a Social Media Copy Generator (Gemini), an Art Director agent that writes visual prompts aligned with each clinic's brand identity, fal.ai image generation with async queue polling, and a self-healing retry loop with Gemini Vision validation. Output lands as a ready-to-approve draft in Publer with Slack notification.
Results
- From hours to minutes — copy, design, and publishing in one autonomous flow
- Scales to N clinics with zero marginal cost
- Self-healing: failed images regenerate automatically (configurable max retries)
- Visual Operating System in Airtable — brand updates reflected immediately
- Human approval preserved: drafts in Publer, one click to publish
Architecture
Sub-workflow Trigger → Stage 1: Brand Context
Airtable (Visual Operating System — brand guidelines per clinic)
→ Stage 2: Format Routing (Switch)
Carousel → Copy Generator A → Slide Splitter A
Stories → Copy Generator B → Slide Splitter B
→ Stage 3: Copy Generation (per format)
Gemini (Social Media Copy Generator)
→ Caption + slide structure
→ Stage 4: Art Direction & Image Generation
Gemini (Art Director) → visual prompt per slide
→ fal.ai nano-banana-pro (async queue)
→ Poll status until COMPLETED
→ Download image binary
→ Stage 5: Visual Validation Loop
Gemini Vision (analyze image)
→ Approved? → Publer media upload
→ Rejected? → retryCount < maxRetries? → regenerate
→ No? → skip slide
→ Stage 6: Draft Creation
Publer API (POST /posts/schedule)
→ Poll job status until complete
→ Stage 7: Notification
Slack (chat.postMessage) → Team notified