1. Opening Problem Statement
Meet Alex Kim, a workflow automation architect who regularly produces short-form videos for corporate clients and social media campaigns. Alex’s challenge is the tedious, time-consuming process of converting blog posts into engaging vertical video content with custom-generated images and thumbnails in the trendy 9:16 aspect ratio. Manually creating video scripts, writing image prompts, and commissioning visuals from multiple platforms wastes hours and delays content schedules. Any inconsistency or repetitive work risks lowering the professional quality and engagement.
Before this automation, Alex often spent 4-6 hours per video just on scripting and image creation alone. Mistakes in image dimensions or mismatched brand voice frequently required revisions, costing more time and money.
Sound familiar? You need a way to turn rich text content from blogs into ready-to-use video assets that align with brand guidelines and style — automatically.
2. What This Automation Does ⚙️
This n8n workflow solves Alex’s problem by automating the entire pipeline from blog content to AI-generated short-form video assets with 9:16 vertical imagery. Specifically, it:
- Retrieves brand guidelines and SEO keywords from Airtable to ensure consistent style and relevant topic focus.
- Searches and deduplicates SEO keywords to identify content related to “ai automation” specifically.
- Generates a concise 4-scene script for a short video under 30 seconds using OpenAI’s GPT-4o-mini model.
- Creates tailored image prompts for each video scene plus an engaging thumbnail prompt.
- Improves image prompts using Leonardo.ai’s prompt improvement API for higher quality outputs.
- Calls Leonardo.ai APIs to generate high-resolution 9:16 images for scenes and thumbnails and waits for processing completion.
- Uploads generated image asset info back into Airtable for centralized tracking and future use.
The workflow eliminates 4-6 hours of manual scripting and image prep per video and reduces errors caused by inconsistent prompts and formats. It outputs polished, brand-aligned images ready for social video production.
3. Prerequisites ⚙️
- n8n account to run and customize the workflow.
- Airtable account with a base containing brand guidelines, SEO keywords, and content data.
🔑 Airtable Personal Access Token for n8n integration. - OpenAI API key to access GPT-4o-mini model.
💬 OpenAI integration set up in n8n. - Leonardo.ai API credentials for image generation and prompt improvement.
🔐 Custom HTTP credentials configured in n8n. - Recommended: Basic knowledge of n8n nodes such as Manual Trigger, Set, SplitOut, Filter, Wait, HTTP Request, and integration with Airtable and OpenAI.
4. Step-by-Step Guide to Setting Up and Running the Workflow
Step 1: Manual Trigger to Start
Open your n8n editor. Find the Manual Trigger node labeled “When clicking ‘Test workflow’” and leave it as the starting point for testing your automation.
This trigger allows you to manually start the workflow anytime to test or run it on-demand.
Common mistake: Forgetting to activate the workflow will prevent automatic or manual runs.
Step 2: Retrieve Brand Guidelines from Airtable
Click + → Add Airtable node named “Get Brand Guidelines.” Configure it to search the “Brand Guidelines” table in your Airtable base.
Use your Airtable Personal Access Token credentials to authenticate.
The node fetches brand colors, voice, tone, imagery style, and more for later consistency.
Common mistake: Incorrect Airtable base or table IDs will cause data retrieval to fail.
Step 3: Set Guidelines Node
Add a Set node named “Set Guidelines” to extract the unique brand guideline ID and pass all other fetched fields downstream.
This node formats input data for subsequent steps — especially for getting SEO keywords.
Step 4: Get SEO Keywords
Add another Airtable node named “Get SEO Keywords,” configured to query the “SEO Keywords” table. Use your Airtable credentials again.
This node pulls all keyword entries with their related content links.
Step 5: Filter SEO Keywords
Insert a Filter node named “Keyword Filter.” Set condition to include only keywords containing “ai automation” (case-insensitive).
This ensures the workflow focuses on relevant content only.
Step 6: Remove Duplicate Keywords
Add the Remove Duplicates node on the filtered results to ensure unique content IDs are used downstream.
Step 7: Split Out and Limit Keywords
Use two SplitOut nodes named “Split Out Keywords” and “Split Out Content” to separate and iterate over keyword-related content rows and content IDs.
Add a Limit node to restrict the batch size if desired.
Step 8: Retrieve Content Records
Add Airtable node named “Get Content” configured to retrieve blog post content using the content IDs extracted previously.
Step 9: Prepare Short Form Video Script Using OpenAI
Add OpenAI (GPT-4o-mini) node named “Script Prep.” Configure it with this system prompt and user message:
Prepare a script with 4 scenes for a short form video based on the following blog post:
Title:
{{ $json.Title }}
Content:
{{ $json.Content }}
The video should be less than 30 seconds in length.
Also create image prompts for each scene within the script.
Then output a image prompt for the video thumbnail.
The video will use a 9:16 aspect.
The node outputs scene scripts and prompts for images and thumbnail.
Step 10: Split Out Scenes and Thumbnail Prompt
Add two SplitOut nodes: “Split Out Scenes” to separate each scene script, and “Split Out TN Prompt” to isolate the thumbnail prompt.
Step 11: Improve Thumbnail Prompt with Leonardo.ai
Add a Set node “Prompt Settings” to define the Leonardo.ai model and additional prompt styling (like “Use the rule of thirds, leading lines, & balance.”).
Use an HTTP Request node “Leo – Improve Prompt1” to send the thumbnail prompt to Leonardo.ai’s prompt improvement API.
Wait 30 seconds with a Wait node for the job to process.
Retrieve the enhanced prompt and generate the image with “Leo – Generate Image1.” Finally, use “Leo – Get imageId1” to fetch the result URL.
Step 12: Add Thumbnail Image Asset to Airtable
Add an Airtable Create node named “Add Asset Info” to save the thumbnail image URL and metadata to your “Assets” table for tracking and reuse.
Step 13: Loop Over Each Scene Script
Add a SplitInBatches node named “Loop Over Items” to iterate over each scene script.
Step 14: Improve Scene Image Prompts and Generate Images
In the loop, add another Set node “Prompt Settings1” to set model and style.
Use HTTP Request nodes “Leo – Improve Prompt” and “Leo – Generate Image” to improve and generate each scene’s image via Leonardo.ai API, with a Wait node for processing.
Retrieve image URLs with “Leo – Get imageId.” Save each scene image as an asset in Airtable with “Add Asset Info1.”
Step 15: Review and Activate
Review all nodes for correctness, check credentials and test the workflow with manual trigger. Once confirmed, activate the workflow for automated use.
5. Customizations ✏️
- Change Video Length or Number of Scenes: In the OpenAI “Script Prep” node, modify the prompt to specify more or fewer scenes or adjust video length.
- Adjust Leonardo.ai Image Styles: Change the model ID or add different “additional” prompt strings in the “Prompt Settings” nodes.
- Expand Keyword Filter Criteria: Modify the “Keyword Filter” node to include other relevant keywords or broader search terms.
- Increase Image Quantity: Modify Leonardo.ai “num_images” parameter in generation nodes for multiple image options.
- Add Social Media Posting: Integrate a social media node (e.g., Twitter or LinkedIn) to automatically post generated thumbnails and videos once created.
6. Troubleshooting 🔧
- Problem: “Airtable node returns no data.”
Cause: Incorrect Airtable base or table ID, or lack of permissions.
Solution: Verify base/table IDs in node settings and check Airtable Personal Access Token permissions. - Problem: “OpenAI node times out or returns errors.”
Cause: Invalid or expired API key, or network issues.
Solution: Check OpenAI API key validity and network connectivity, retry after fixing credentials. - Problem: “Leonardo.ai image generation fails or hangs.”
Cause: Incorrect API credentials or API change.
Solution: Confirm credentials under HTTP Request nodes and check Leonardo.ai API docs for updates. - Problem: “Images do not match brand guidelines.”
Cause: Incorrect or incomplete brand guidelines fetched.
Solution: Ensure Airtable brand guidelines are correct and have all needed fields consistently populated.
7. Pre-Production Checklist ✅
- Confirm Airtable base has correct tables: Brand Guidelines, SEO Keywords, Content, and Assets.
- Verify API credentials for Airtable, OpenAI, Leonardo.ai in n8n.
- Test manual trigger and review logs for errors.
- Validate prompt formats in OpenAI and HTTP Request nodes.
- Check image output URLs and Airtable asset entries.
- Backup Airtable data before running bulk operations.
8. Deployment Guide
After testing, activate the workflow in n8n. Run it manually or schedule regular runs for continuous content generation.
Monitor workflow executions in n8n’s dashboard for errors or delays. Adjust wait times on Leonardo.ai calls as needed based on API response times.
9. FAQs
- Can I use other AI image generators?
Yes, you can replace Leonardo.ai HTTP Request nodes with APIs from DALL·E, Stable Diffusion, or RunwayML by adjusting request parameters accordingly. - Does this workflow consume many API credits?
Yes, image generation is credit-intensive; monitor your usage and budget accordingly. - Is my data secure?
All API keys and credentials are stored in n8n securely. Use HTTPS endpoints and keep keys private. - Can I customize the script format?
Yes, tweak prompts in the OpenAI node for different video styles or lengths.
10. Conclusion
You’ve now orchestrated a smart automation that transforms blog posts into polished short-form video assets with tailored scripts and AI-generated 9:16 images and thumbnails. This saves hours of manual scripting and design while keeping brand voice consistent.
Consider extending this workflow by integrating video editing tools, social media schedulers, or adding multilingual support for global content reach. Your content production just became dramatically smarter and faster!