Create emotional stories with Gemini AI: Generate images and Veo3 JSON prompts
This n8n template demonstrates how to create an automated emotional story generation system that produces structured video prompts and generates corresponding images using AI. The workflow creates a complete story with 5 scenes featuring a Pakistani character named Yusra, converts them into Veo 3 video generation prompts, and generates images for each scene. Use cases include: Automated story creation for social media content Video pre-production with AI-generated storyboards Content creation for educational or entertainment purposes Multi-scene narrative development with consistent character design Good to know: Uses Gemini 2.5 Flash Lite for story generation and prompt conversion Uses Gemini 2.0 Flash Exp for image generation The image generation model may be geo-restricted in some regions Workflow includes automatic Google Drive organization and Google Sheets tracking How it works: Story Creation: Gemini AI creates a 5-scene emotional story featuring Yusra, a Pakistani girl aged 20-25 in traditional dress Folder Organization: AI generates a unique folder name with timestamp for project organization Google Sheets Setup: Creates a new sheet to track all scenes and their processing status Scene Processing: Each scene is processed individually with character and action prompts Veo 3 Prompt Conversion: Converts natural language scene descriptions into structured JSON format optimized for Veo 3 video generation, including parameters like: Detailed scene descriptions Camera movements and angles Lighting and mood settings Style and quality specifications Aspect ratios and technical parameters Image Generation: Uses Gemini's image generation model to create visual representations of each scene File Management: Automatically uploads images to Google Drive and organizes them in project folders Status Tracking: Updates Google Sheets with processing status and file URLs Automated Workflow: Includes conditional logic to handle different processing states and file movements How to use: Execute the workflow manually or set up automated triggers The system will automatically create a new story with 5 scenes Each scene gets processed through the AI pipeline Generated images are organized in Google Drive folders Track progress through the Google Sheets interface The workflow handles all file management and status updates automatically Requirements: Gemini API access for both text and image generation Google Drive for file storage and organization Google Sheets for project tracking and management n8n instance with appropriate node access Customizing this workflow: Modify the character description in the Story Creator node Adjust the number of scenes by changing the story prompt Customize the Veo 3 prompt parameters for different video styles Add additional AI models or processing steps Integrate with other content creation tools Modify the folder naming convention or organization structure Technical Features: Automated retry logic for failed operations Conditional processing based on status flags Batch processing for multiple scenes Error handling and status tracking File organization with timestamp-based naming Integration with Google Workspace services This template is perfect for content creators, educators, or anyone looking to automate story-based content creation with AI assistance.
Smart human takeover & auto pause AI-powered Facebook Messenger chatbot
π€ Facebook Messenger Chatbot - Smart Human Takeover, Auto Pause & Context-Aware Adaptable to n8n 1.113+ and 2.x by Nguyen Thieu Toan (Jay Nguyen) --- π Overview An intelligent Facebook Messenger chatbot that automatically detects human agent intervention and pauses AI responses accordingly. Features smart pause management, full context preservation, and seamless handoff between AI and human support. Perfect for: πΌ Customer support with AI + human escalation π― Sales conversations requiring manual intervention π οΈ Technical support needing human expertise π€ Any chatbot requiring human oversight capability Requirements: n8n v1.113.0+, Facebook App with Messenger, Google Gemini API key (or compatible LLM) --- π Complementary Workflow Smart Facebook Messenger Chatbot β Message Batching & History Enhances Messenger automation with intelligent batching, conversation tracking, and context-aware responses. Messages are grouped, stored, and processed with full history for smoother interactions. Why combine? π§© Smart Batch (v3): Efficient multi-message handling, reduced spam π Conversation History: Maintains context across sessions π€ AI Responses: Natural, context-aware replies β‘ Scalability: Sequential processing for reliable delivery π Access workflow Smart Facebook Messenger Chatbot β Message Batching & History --- β‘ Key Features Core Capabilities | Feature | Description | |---------|-------------| | π Human Takeover Detection | Automatically detects when admin/human sends messages from page via metadata checking | | βΈοΈ Smart Auto-Pause | Bot pauses for configurable duration (default 60s) when human joins conversation | | π Context Preservation | Saves both AI and human responses in conversation history for seamless continuity | | π Whitelist Management | Tracks paused users with timestamp-based auto-resume (no manual intervention needed) | | π Seamless Handoff | Smooth transition between AI and human, then automatic resume after timeout | | π’ Multi-Page Support | Single workflow handles multiple Facebook Pages via page_id differentiation | | π Full History Context | AI sees both previous AI and human responses when resuming | Technical Highlights β Metadata-based detection (message.metadata == "bot_rep") β Timestamp-based pause management (auto-expires) β Upsert operation for whitelist (updates if exists, inserts if new) β Composite key indexing (userid + pageid) β Zero manual cleanup required β Full conversation context preserved across handoffs --- ποΈ How It Works ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 1. Message Intake β β β’ The system receives incoming messages from different β β sources and identifies their type. β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 2. Human Interaction Recognition β β β’ Detects when a human is involved and records the event β β β’ Adjusts automated handling accordingly. β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 3. Pause & Resume Control β β β’ Temporarily pauses automation when needed β β β’ Resumes once conditions are met. β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β 4. Automated Response β β β’ Processes messages with context β β β’ Generates and delivers appropriate replies. β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ --- π οΈ Setup Guide Step 1: Facebook App Setup Step 2: Data Storage Preparation Step 3: Workflow Configuration Step 4: Testing --- π€ About the Author Nguyen Thieu Toan (Nguyα» n Thiα»u ToΓ n / Jay Nguyen) AI Automation Specialist | n8n Workflow Expert | Business Optimization Consultant Services: AI Automation Solutions, n8n Workflow Development, Custom Chatbot Implementation, Team Training Programs Contact: π nguyenthieutoan.com π Facebook πΌ LinkedIn π¦ X (Twitter) πΊ YouTube π§ me@nguyenthieutoan.com GenStaff Company: genstaff.net | contact@genstaff.net --- π License After purchase, use in commercial/personal projects. No redistribution or resale. Keep author attribution when sharing. Last Updated: December 18, 2025 | Version: 1.0 | n8n Compatibility: v1.123.0+ and v2.0.0+ | Facebook API: v23.0/v24.0 --- Ready to enable intelligent human-AI collaboration in your Facebook Messenger? Import this workflow and transform your chatbot today! π