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
- Download the full workflow file using the Download button here.
- Open n8n editor where you want to run this automation.
- Use the “Import from File” option to load the workflow JSON file.
Step 2: Configure API Keys and Inputs
- Go to the Basic Params node.
- Enter your valid x-api-key for the PiAPI services in the key field.
- If needed, update story parameters in the JSON: “style”, “character”, and “situational_keywords”.
- 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
- Click the When clicking Test workflow trigger to run once.
- Watch the workflow go through generates images, videos, and creates the combined video.
- Confirm all nodes run without errors.
Step 4: Activate Workflow for Production
- Turn on the workflow by toggling the active switch.
- Choose how to trigger it: manually, on schedule, or with a webhook.
- Monitor running logs in n8n for any delays or problems during video generation.
- 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]"
}
}
