Back to Catalog

Narrative chaining: AI-generated video scene extensions with Veo3

DenizDeniz
701 views
2/3/2026
Official Page

Structured Setup Guide: Narrative Chaining with N8N + AI

1. Input Setup

Use a Google Sheet as the control panel. Fields required: Video URL (starting clip, ends with .mp4) Number of clips to extend (e.g., 2 extra scenes) Aspect ratio (horizontal, vertical, etc.) Model (V3 or V3 Fast) Narrative theme (guidance for story flow) Special requests (scene-by-scene instructions) Status column (e.g., "For Production", "Done") πŸ‘‰ Example scene inputs: Scene 1: Naruto walks out with ramen is his hands Scene 2: Joker joins with chips

2. Workflow in N8N

Step 1: Fetch Input Get rows in sheet β†’ fetch the next row where status = For Production. Clear sheet 2 β†’ reset the sheet that stores generated scenes. Edit fields (Initial Values): Video URL = starting clip Step = 1 Complete = total number of scenes requested Step 2: Looping Logic Looper Node: Runs until step = complete. Carries over current video URL β†’ feeds into next generation. Step 3: Analyze Current Clip Send video URL to File.AI Video Understanding API. Request: Describe last frame + audio + scene details. Output: Detailed video analysis text. Step 4: Generate Prompt AI Agent creates the next scene prompt using: Context from video analysis Narrative theme (from sheet) Scene instructions (from sheet) Aspect ratio, model preference, etc. πŸ‘‰ Output = video prompt for next scene Step 5: Extract Last Frame Call File.AI Extract Frame API. Parameters: Input video URL Frame = last Output = JPG image (last frame of current clip). Step 6: Generate New Scene Use Key.AI (V3 Fast) for economical video generation. POST request includes: Prompt (from AI Agent) Aspect ratio + model Image URL (last frame) β†’ ensures seamless chaining Wait for generation to complete. πŸ‘‰ Output = New clip URL (MP4) Step 7: Store & Increment Log new clip URL into Sheet 2. Increment Step by +1. Replace Video URL with the new clip. Loop back if Step < Complete.

3. Output Section

Once all clips are generated: Gather all scene URLs from Sheet 2. Use File.AI Merge Videos API to stitch clips together: Original clip + all generated scenes. Save final MP4 output. Update Sheet 1 row with: Final video URL Status = Done

4. Costs

Video analysis: ~$0.015 per 8s clip Frame extraction: ~0.002Β’ (almost free) Clip merging: negligible (via ffmpeg backend) V3 Fast video generation (Key.AI): ~$0.30 per 8s clip

n8n Workflow: AI-Generated Video Scene Extensions with VEO3

This n8n workflow demonstrates a sophisticated chaining of AI agents to generate narrative scene extensions for video, leveraging a VEO3 API. It orchestrates a process where an AI agent "thinks" about a video scene, generates a narrative extension, and then potentially triggers further actions based on the generated content.

What it does

This workflow automates the following steps:

  1. Manual Trigger: The workflow is initiated manually, allowing for on-demand execution.
  2. AI Agent (Think): An AI Agent, specifically configured with a "Think" tool, processes initial input (likely a video scene description or context). This step is designed to simulate an AI "thinking" or planning its response.
  3. OpenAI Chat Model: The output from the "Think" agent is then fed into an OpenAI Chat Model. This model is responsible for generating the actual narrative extension for the video scene.
  4. Structured Output Parser: The raw text output from the OpenAI Chat Model is parsed into a structured format, ensuring consistency and usability for subsequent steps.
  5. Edit Fields (Set): The parsed data is then transformed or refined, likely mapping the AI-generated narrative elements to specific fields required for video scene extensions.
  6. If Node: A conditional check is performed on the processed data. This could be to verify the quality, length, or specific content of the generated narrative.
  7. Wait: If the condition in the "If" node is met (e.g., the narrative is valid), the workflow pauses for a specified duration. This might be to simulate processing time or to wait for an external system.
  8. HTTP Request (VEO3 API): After the wait period, an HTTP Request is made. Based on the directory name "veo3", this likely interacts with a VEO3 API to submit the AI-generated scene extension for video generation or integration.
  9. Google Sheets: The workflow concludes by writing data to Google Sheets. This could be for logging the generated scene extensions, tracking the status of video generation requests, or storing the AI's output for review.
  10. Sticky Note: A sticky note is included in the workflow, likely for documentation or internal notes about a specific part of the process.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • OpenAI API Key: For the OpenAI Chat Model.
  • Google Sheets Account: With appropriate permissions to write data to a spreadsheet.
  • VEO3 API Access: Credentials and an endpoint for the VEO3 API (implied by the directory name and HTTP Request node, though not explicitly configured in the provided JSON).
  • n8n LangChain Nodes: The @n8n/n8n-nodes-langchain package installed in your n8n instance for the AI Agent, OpenAI Chat Model, and Structured Output Parser nodes.

Setup/Usage

  1. Import the Workflow: Download the JSON content and import it into your n8n instance.
  2. Configure Credentials:
    • Set up your OpenAI API Key credential for the "OpenAI Chat Model" node.
    • Configure your Google Sheets credential for the "Google Sheets" node.
    • Configure any necessary HTTP Request credentials (e.g., API keys, tokens) for the "HTTP Request" node to interact with the VEO3 API.
  3. Customize Nodes:
    • AI Agent (Think): Adjust the agent's prompt and configuration to guide its "thinking" process for your specific video scene context.
    • OpenAI Chat Model: Fine-tune the model's parameters (e.g., model, temperature) to achieve the desired narrative style and quality.
    • Structured Output Parser: Define the expected JSON schema for the narrative output.
    • Edit Fields (Set): Map the parsed AI output to the correct fields for your VEO3 API or Google Sheet.
    • If: Modify the conditions to match your validation criteria for the generated narratives.
    • Wait: Adjust the wait duration as needed.
    • HTTP Request: Update the URL, headers, and body of the request to match your VEO3 API's specifications for scene extension submission.
    • Google Sheets: Specify the Spreadsheet ID, Sheet Name, and the data to be written.
  4. Execute: Click "Execute workflow" on the "Manual Trigger" node to run the workflow.

Related Templates

Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets

This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger β€” Manually start the workflow or schedule it to run periodically. Input Setup β€” Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) β€” Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring β€” Clean and convert GPT output into JSON format. Data Storage (Google Sheets) β€” Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the β€œSet Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors β†’ Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection β†’ Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report β†’ Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization β†’ Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs β†’ Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.

Ranjan DailataBy Ranjan Dailata
161

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chatβ€”turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. πŸ“‹ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing πŸ”§ Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation πŸ”‘ Required Credentials OpenAI API Setup Go to platform.openai.com β†’ API keys (sidebar) Click "Create new secret key" β†’ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai β†’ Dashboard β†’ API Keys Generate a new API key β†’ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) βš™οΈ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowβ€”chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353