ChatGPTCreativeVideoAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-generate story short videos with n8n, GPT-4o-mini, Midjourney, Kling, and Creatomate

Input character and scene params → GPT-4o-mini generates a 3-part story prompt → Midjourney images → Kling image-to-video → Creatomate final composition with subtitles

ExperiencedStepsWorkflowPromptTip
Who
Content creators, social media bloggers, short-form video makers, educational creators
You get
One-click generation of a 3-part story short video with subtitles for rapid creative validation
You need
n8n · PiAPI · Midjourney · Kling · Creatomate

Constraints

Requires: an n8n instance (self-hosted or cloud), a PiAPI account with x-api-key, a Creatomate account with API key (Bearer token), and a pre-configured Creatomate video template (example template ID: c10c62b6-d515-4f36-a730-f4646d1b7ee2). Single generation takes about 10–20 minutes. Pricing depends on PiAPI and Creatomate rates; not specified in source.

What they did

piapi published a 51-node workflow template on the n8n official template gallery. The workflow takes user inputs for style, character, and situational_keywords, uses GPT-4o-mini to generate a 3-part story prompt, sequentially calls Midjourney on PiAPI (imagine, 2:3 portrait) for three images, then calls Kling (video_generation, v1.6 pro) to turn each image into a video clip, and finally composes the three clips with a title subtitle via the Creatomate API into a complete short video. The workflow includes full polling (Wait + Get Task + If/Switch for completed/failed) and error branches.

How it went

Author report (author_report): under example parameters (children's book style, girl and rabbit in forest), a sample video was generated (see video src in description.md). Single generation is estimated at 10–20 minutes. Source does not provide success rate, cost breakdown, or large-scale batch run data.

Worth knowing

1. All APIs are labeled 'unofficial' (aggregated via PiAPI), not official direct connections to Midjourney/Kling; monitor PiAPI service stability and terms. 2. The Creatomate template_id must be created by the user on the Creatomate platform and replaced; the source only gives an example ID without template internals. 3. The Kling video prompt is fixed to 'Natural swing'; modify the node parameter manually if a different motion effect is needed. 4. No music node is built in; the author suggests extending with PiAPI audio models or another music solution. 5. This site has not tested the workflow (reproduction=not_tested); actual cost, latency, and output quality need self-verification. 6. The x-api-key and Bearer token in nodes are empty-string placeholders; they must be filled in secure credential configuration, never written into chat or prompts.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Replace __UKH_BEARER_27__ with your real secret/token (path /nodes/27/parameters/headerParameters/parameters/0/value; literal auth header).

Configuration to replace

  • Source template is n8n public workflow #3655 (~51 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use. 1 literal secret value(s) replaced with __UKH_…__ placeholders.

Template retrieved: 2026-10-24

Steps

  1. Configure basic parameters and API credentials

    Open the Basic Params node in the n8n workflow and enter your PiAPI x-api-key. This node contains three input fields: style (visual style, e.g. --s 500 --niji 6), character (character description), and situational_keywords (scene atmosphere keywords). These parameters feed into the GPT-4o-mini prompt generation.

    Setup guidance · Source text。n8n Sticky Note / Basic Params node configuration note

    ## Basic Setting Instruction
    Fill in **Basic Params** based on user's need. 
    The node concludes three section: style, character and situation_keyword.
    GPT-4o-mini will generate image description based on basic params mentioned above.
  2. Generate a 3-part story prompt

    Run the GPT-4o-mini Generate Image Scenario Prompt node. It sends a request to PiAPI's chat completions endpoint with system prompt 'You are a helpful assistant.' and a user prompt that asks for a short story based on character, style, and situational_keywords, divided into three sections, returning strict JSON: {'title':'','prompt1':'','prompt2':'','prompt3':''}.

    Execution prompt · Source text。GPT-4o-mini Generate Image Scenario Prompt node system message

    You are a helpful assistant.

    Execution prompt · Source text。GPT-4o-mini Generate Image Scenario Prompt node user message

    Character is {{ $json.character }}, style is {{ $json.style }}, context keywords are {{ $json.situational_keywords }}, please generate a short story containing relevant elements and styles based on Character and context keywords. It should be concise and clear and divided into three sections. The return format is {'title':'','prompt1':'','prompt2':'','prompt3':''}, directly return json data format, not markdo2t include unusual characters such as hyphens,The key and value are enclosed in double quotes, but if you need to use quotes in the value string, please use single quotes.
  3. Generate three Midjourney images and poll for completion

    Run the three Midjourney Generator nodes (First/Second/Third Image) in sequence. Each sends a POST to https://api.piapi.ai/api/v1/task with model=midjourney, task_type=imagine, aspect_ratio=2:3, process_mode=turbo. The prompt combines character + the corresponding prompt (prompt1/2/3) + style. Then poll via Wait → Get Task → Verify Status → Switch until status=completed, then retrieve temporary_image_urls.

    Execution prompt · Source text。Midjourney Generator of the First Image node jsonBody (prompt1; prompt2/3 share same structure with different variable names)

    ={
      "model": "midjourney",
      "task_type": "imagine",
      "input": {
        "prompt": "{{ $('Basic Params').item.json.character }},{{ $json.prompts.prompt1 }},{{ $('Basic Params').item.json.style }}",
        "aspect_ratio": "2:3",
        "process_mode": "turbo",
        "skip_prompt_check": false
      }
    }
  4. Generate three Kling videos and poll for completion

    Use the three images to call the Kling video_generation endpoint (https://api.piapi.ai/api/v1/task) with model=kling, version=1.6, mode=pro, image_url set to the corresponding image URL, and prompt fixed as 'Natural swing'. Then poll via Wait → Get Task → Verify → Switch until each video's video_url is retrieved.

    Execution prompt · Source text。Generate the First Video node jsonBody (image_output1; 2/3 share same structure)

    ={
        "model": "kling",
        "task_type": "video_generation",
        "input": {
            "version": "1.6",
            "mode": "pro",
            "image_url": "{{ $json.image_output1 }}",
            "prompt": "Natural swing"
        }
    }
  5. Compose final video in Creatomate

    Pre-create a video template in Creatomate and note its template_id. In the Final Video Combination node, send a POST to https://api.creatomate.com/v1/renders with template_id and modifications: map the three Kling videos to Video-1/2/3.source and the title to Text-1.text. Headers must include Authorization: Bearer <Creatomate_API_Key> and Content-Type: application/json.

    Execution prompt · Source text。Final Video Combination node jsonBody

    ={
      "template_id": "c10c62b6-d515-4f36-a730-f4646d1b7ee2",
    "modifications": {
        "Video-1.source": "{{ $('output1').item.json.video1 }}",
        "Video-2.source": "{{ $('output2').item.json.video2 }}",
        "Video-3.source": "{{ $('Get the Third Video URL').item.json.video3 }}",
        "Text-1.text": "{{ $('Get Prompt').item.json.prompts.title }}"
      }
    }

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

This template is a setup starting reference. Import workflow.json into n8n first, confirm PiAPI and Creatomate API credentials are filled in the corresponding node Headers/Body. Then configure Basic Params step by step, verify GPT-4o-mini prompt output, check that Midjourney and Kling polling nodes trigger correctly, and finally create a template in Creatomate and replace the template_id. It is recommended to prototype with Creatomate basic assets before connecting the full workflow.

After importing the template, replace all API key placeholders first; confirm the Creatomate template_id is replaced with your own; for the first run, step-debug the Midjourney node to confirm image generation works before executing the full workflow.

Source

Create animated stories using GPT-4o-mini, Midjourney, Kling and Creatomate API · piapi · n8n.io · 2025-04-22

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related