Create Animated Stories with GPT-4o-mini, Midjourney & Creatomate APIs

This workflow automates storytelling by generating AI-driven image scenes and animated videos from a text prompt using GPT-4o-mini, Midjourney, Kling, and Creatomate APIs. It streamlines creating animated story content, saving hours of manual work for creatives and marketers.
httpRequest
set
wait
+5
Workflow Identifier: 1297
NODES in Use: set, code, httpRequest, wait, if, switch, stickyNote, manualTrigger
Automate stories with GPT-4o-mini and n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow changes simple story text into animated videos automatically.
It fixes the problem of spending too much time making images and videos by hand.
The result is a ready video made fast with little effort from the user.

The workflow uses AI tools to write story parts, create pictures, animate them, and join the videos into one story video.


Tools and Services Used

  • GPT-4o-mini: Creates story prompts for three scenes.
  • Midjourney API: Makes three illustrated images from prompts.
  • Kling API: Turns each image into a short animated video with “Natural swing” motion.
  • Creatomate API: Combines three video clips into one final story video.

How This Workflow Works: Inputs, Processing, and Output

Inputs

You enter a basic story description with three parts: style, character, and situation keywords.
You also provide an API key to let the workflow use the AI services.

Processing Steps

First, GPT-4o-mini creates 3 detailed story prompts from your input.
Then, Midjourney makes 3 pictures, one for each story scene.

Next, Kling takes those pictures and makes 3 videos with gentle swinging animations.
The workflow waits and checks until these videos are ready.

Finally, Creatomate puts these three videos together into one smooth story video with text overlay for the story title.

Output

The workflow gives you links for each video clip and the final combined story video.
You get a shareable video ready for publishing or other uses.


Who Should Use This Workflow

This is good for writers, creators, or teachers who want to make animated stories fast.
Users who find manual image creation and video editing slow or tricky will benefit most.


Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the full workflow file using the Download button here.
  2. Open n8n editor where you want to run this automation.
  3. Use the “Import from File” option to load the workflow JSON file.

Step 2: Configure API Keys and Inputs

  1. Go to the Basic Params node.
  2. Enter your valid x-api-key for the PiAPI services in the key field.
  3. If needed, update story parameters in the JSON: “style”, “character”, and “situational_keywords”.
  4. Check if there are any specific IDs, emails, or template IDs in HTTP request nodes and update them as needed.

Step 3: Test the Workflow

  1. Click the When clicking Test workflow trigger to run once.
  2. Watch the workflow go through generates images, videos, and creates the combined video.
  3. Confirm all nodes run without errors.

Step 4: Activate Workflow for Production

  1. Turn on the workflow by toggling the active switch.
  2. Choose how to trigger it: manually, on schedule, or with a webhook.
  3. Monitor running logs in n8n for any delays or problems during video generation.
  4. Consider self-host n8n for more control and security in production.

Customization Ideas

  • Change the story content by editing the Basic Params JSON fields.
  • Try other animation styles in Kling video nodes by changing the “prompt” like “Smooth zoom”.
  • Adjust Midjourney image aspect ratios in HTTP requests from “2:3” to “16:9” or “1:1”.
  • Use a different Creatomate template by updating the template_id for a new video layout.

Common Problems and Solutions

  • Authentication failed errors happen if the API key is wrong or missing.
    Check and enter the correct x-api-key in the Basic Params node.
  • Sometimes image or video jobs stay pending because of API limits or slow servers.
    Add longer wait times or retry later.
  • Final video errors in Creatomate may happen if video URLs or template IDs are wrong.
    Verify URLs and use an active template ID.

Pre-Production Checklist

  • Test PiAPI keys by calling GPT-4o-mini or Midjourney APIs directly first.
  • Check Creatomate API access and the video template used.
  • Run the full workflow once on default inputs.
  • Confirm generation of all 3 images and videos completes successfully.
  • Save your n8n workflow JSON backup and keep API keys secure.

Summary

✓ Saves time by automating story illustration and video creation.
✓ Needs just simple text inputs to get full animated story videos.
✓ Combines AI writing, image, video, and editing APIs in one flow.
✓ Helps storytellers publish animated content faster and easier.


Important Workflow Code Samples

Below is the JavaScript Code used in the Get Prompt node to parse GPT-4o-mini response:

const content = $input.first().json.choices[0].message.content;
const prompts = JSON.parse(content);
return { prompts };

This code extracts the structured JSON prompts from the AI text reply for image generation.


Example Requests for API Calls

Midjourney image generation request body example:

{
  "model": "midjourney",
  "task_type": "imagine",
  "input": {
    "prompt": "A gentle girl and a fluffy rabbit explore a sunlit forest together, playing by a sparkling stream, [prompt1], a children\u0018s book cover, ages 6-10. --s 500 --sref 4028286908 --niji 6",
    "aspect_ratio": "2:3",
    "process_mode": "turbo",
    "skip_prompt_check": false
  }
}

Kling video generation request example:

{
  "model": "kling",
  "task_type": "video_generation",
  "input": {
    "version": "1.6",
    "mode": "pro",
    "image_url": "[image_url_here]",
    "prompt": "Natural swing"
  }
}

Creatomate final video combination request example:

{
  "template_id": "c10c62b6-d515-4f36-a730-f4646d1b7ee2",
  "modifications": {
    "Video-1.source": "[video1_url]",
    "Video-2.source": "[video2_url]",
    "Video-3.source": "[video3_url]",
    "Text-1.text": "[story_title]"
  }
}

Automate stories with GPT-4o-mini and n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Authentication errors happen when the API key is missing or incorrect in the Basic Params node.
Pending status usually means API rate limits or server delays are causing slow processing.
Verify that video URLs are valid and the template_id used is correct and active.
Download the workflow file, import it into n8n, add API keys and settings, test once, then activate it for production.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.