Quick overview
This workflow takes an article URL and market selection from an n8n form, uses Anthropic Claude to draft carousel copy and OpenAI to generate images, builds branded assets in Cloudinary, then requests Slack approval before publishing an Instagram carousel and story + Facebook Page post via the Meta Graph API.
How it works
- An editor submits an n8n form with a published article URL and a target market.
- The workflow loads market-specific brand settings, checks the
carousel_posts data table for prior posts of the same article, and shows a “generation started” confirmation.
- It fetches the article HTML, extracts the title, body text, and a hero image URL, then asks Anthropic Claude to generate three slide texts, three image prompts, and a caption.
- It validates the generated text and prompts (for example, blocking Title Case headlines and unsafe colour cues in warning-related image prompts) before generating any paid images.
- It downloads the hero image, generates slide and story images with OpenAI Images, uploads assets to Cloudinary, and composes four carousel slides plus a story using Cloudinary transformations.
- It bakes the transformed images into flat Cloudinary assets, posts a preview to Slack, and waits up to three hours for an approval or a “More options” review decision.
- If approved and accounts are configured, it publishes the carousel to Instagram and Facebook and publishes an Instagram story, then logs post IDs and metadata back to the
carousel_posts data table.
- If “More options” is selected, it lets the reviewer rewrite the cover headline with Claude or regenerate one image with OpenAI and re-posts updated previews to Slack, or declines without publishing.
Setup
- Add credentials for Anthropic (Claude), OpenAI, Slack, Cloudinary (HTTP Basic Auth), and Facebook Graph API with permissions to publish to your Facebook Page and Instagram Business account.
- In the Market Config code, set your Cloudinary cloud name, Slack channel ID, brand colours, logo public IDs, and the Meta
pageId and (optionally) igUserId for each market you want to publish.
- Upload your market logos (and optionally an “AI generated” badge) to Cloudinary and update the corresponding public IDs in Market Config.
- Create an n8n data table named
carousel_posts with columns for market, articleUrl, articleTitle, instagramMediaId, instagramStoryId, facebookPostId, and publishedAt.
- Activate the workflow and use the form trigger URL to run it, ensuring your Slack channel is accessible for previews and approvals.