by Davide
This workflow is ideal for businesses looking to automate their email responses, especially for handling inquiries about company information. It leverages AI to ensure accurate and professional communication. How It Works Email Trigger: The workflow starts with the Email Trigger (IMAP) node, which monitors an email inbox for new messages. When a new email arrives, it triggers the workflow. Email Preprocessing: The Markdown node converts the email's HTML content into plain text for easier processing by the AI models. Email Summarization: The Email Summarization Chain node uses an AI model (DeepSeek R1) to generate a concise summary of the email. The summary is limited to 100 words and is written in Italian. Email Classification: The Email Classifier node categorizes the email into predefined categories (e.g., "Company info request"). If the email does not fit any category, it is classified as "other". Email Response Generation: The Write email node uses an AI model (OpenAI) to draft a professional response to the email. The response is based on the email content and is limited to 100 words. The Review email node uses another AI model (DeepSeek) to review and format the drafted response. It ensures the response is professional and formatted in HTML (e.g., using `, , , ` tags where necessary). Email Sending: The Send Email node sends the reviewed and formatted response back to the original sender. Vector Database Integration: The Qdrant Vector Store node retrieves relevant information from a vector database (Qdrant) to assist in generating accurate responses. This is particularly useful for emails classified as "Company info request". The Embeddings OpenAI node generates embeddings for the email content, which are used to query the vector database. Document Vectorization: The workflow includes steps to create and refresh a Qdrant collection (Create collection and Refresh collection nodes). Documents from Google Drive are downloaded (Get folder and Download Files nodes), processed into embeddings (Embeddings OpenAI1 node), and stored in the Qdrant vector store (Qdrant Vector Store1 node). Set Up Steps Configure Email Trigger: Set up the Email Trigger (IMAP) node with the appropriate IMAP credentials to monitor the email inbox. Set Up AI Models: Configure the DeepSeek R1, OpenAI, and DeepSeek nodes with the appropriate API credentials for text summarization, response generation, and review. Set Up Email Classification: Define the categories in the Email Classifier node (e.g., "Company info request", "Other"). Ensure the OpenAI 4-o-mini node is configured to assist in classification. Set Up Vector Database: Configure the Qdrant Vector Store and Qdrant Vector Store1 nodes with the appropriate Qdrant API credentials and collection details. Set up the Embeddings OpenAI and Embeddings OpenAI1 nodes to generate embeddings for the email content and documents. Set Up Document Processing: Configure the Get folder and Download Files nodes to access and download documents from Google Drive. Use the Token Splitter and Default Data Loader nodes to process and split the documents into manageable chunks for vectorization. Set Up Email Sending: Configure the Send Email node with the appropriate SMTP credentials to send responses. Test the Workflow: Trigger the workflow manually using the When clicking ‘Test workflow’ node to ensure all steps execute correctly. Verify that emails are summarized, classified, and responded to accurately. Activate the Workflow: Once tested, activate the workflow to automate the process of handling incoming emails. Key Features Automated Email Handling**: Automatically processes incoming emails, summarizes them, and generates professional responses. AI-Powered Classification**: Uses AI to classify emails into relevant categories for targeted responses. Vector Database Integration**: Retrieves relevant information from a vector database to enhance response accuracy. Document Vectorization**: Processes and stores documents from Google Drive in a vector database for quick retrieval. Professional Email Formatting**: Ensures responses are professionally formatted and concise. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by Ysqander
Extract data from any PDF or image invoice dropped in Google Drive directly into Google Sheets – powered by AI OCR. Free, fully modifiable n8n workflow. Optional add-ons for pro features. 🚀 What this template does Stop typing invoice data by hand. Drop a PDF or phone-snapshot into your Invoices Inbox folder in Google Drive and this n8n workflow will: Auto-OCR the document with the Mistral OCR API Match any fields you list in Row 1 of your Google Sheet (totally schema-agnostic) Append a clean, structured row – every time Works with both PDFs and images, in any language supported by Mistral. Template JSON included, ready to import into self-hosted or n8n Cloud 👀 Who’s this for? Freelancers & agencies processing client invoices Small finance teams on Google Workspace Anyone self-hosting n8n who wants an AI OCR flow without glue-code No coding skills required – but flow tweaking is possible for power users. 🛠 Upcoming PRO Add-Ons I am also working on PRO add-ons for this template: Add-On #1 – Error Handling & Alerts (ships Jul 2025)• Flags missing fields, branches to Email/Slack notification; prevents silent failures Add-On #2 – Auto-Currency Converter (ships Jul 2025)• Detects invoice currency symbol/code → converts Total into your base currency via a free FX API Add-On #3 – VAT / GST Breakdown (ships Jul 2025)• Extracts VAT number, net, tax rate, tax amount, gross – ready for EU/UK/AU filings To pre-order these please see: https://ysqander.gumroad.com/l/N8N-AI-Workflow-Invoice-Data-Extraction-LITE
by Samir Saci
Tags: Supply Chain Management, Logistics, Transportation Context Hey! I'm Samir, a Supply Chain Engineer and Data Scientist from Paris founder of LogiGreen Consulting We design tools to help small and medium businesses in improving their logistics processes using data analytics and automation. > Let's use N8N to make supply chains more efficient and sustainable Supply Chains! 📬 For business inquiries, you can add me on Here Who is this template for? This workflow template is designed for logistics operations that cannot rely on a Transportation Management System to record proofs of deliveries. What is a delivery confirmation? This workflow uses a Telegram bot to automatically notify logistics teams by email when a shipment is delivered. Drivers (equipped with their smartphones) can record their arrival with all the necessary information for accurate distribution planning. How do we notify the delivery? Let us imagine a truck driver arriving at the destination; he can contact the bot to be guided on how to record the delivery. User Guide: the first bot's message is a brief explanation of the process Record Shipment Number: the bot asks the driver to share the shipment number and record it Collect GPS Location: the bot asks the driver to share its GPS location and record them Picture of the Shipment: the bot asks for a picture of the shipment and saves it in Google Drive Send Confirmation: after data collection, the bot proposes to send a confirmation to the logistics management team An email is then automatically sent by the N8N workflow including all the information recorded by the flow and a picture of the shipment. Prerequisite This workflow does not require any additional paying subscription. A Google Drive Account with a folder including a Google Sheet API Credentials: Google Drive API, Google Sheets API and Gmail API A Telegram Bot with its API token from BotFather A Google sheet to store the shipment records with these five columns prepared: shipmentNumber, recordTime, gpsLattitude, gpsLongitude, cargoPicture, deliveryTime Next Steps Follow the sticky notes to set up the parameters inside each node and get ready to improve your logistics operations! I have detailed the steps in a short tutorial 👇 🎥 Check My Tutorial 🚀 Interested in applications of N8N for Logistics & Supply Chain Management? Let's connect on Linkedin Notes This workflow can be adapted to add more functionalities. I explain how in the video. The bot can handle multiple drivers at the same time. If you want to learn more about the original tool designed with Python: 🚚 Blog Article about Telegram Shipment Tracking Bot This workflow has been created with N8N 1.82.1 Submitted: March 17th, 2025
by Kamalraj
🧠 Overview A dual-engine, AI-driven n8n workflow that automates the monitoring of both vendor policy webpages and compliance-related RSS feeds. It intelligently detects recent updates, evaluates their potential risk, and delivers a structured HTML digest categorized by severity — right to your inbox. ⚙️ How It Works 1️⃣ Scheduled Execution ⏰ Runs daily at 3 AM to ensure timely and consistent monitoring. 2️⃣ Dual Data Streams 📰 RSS Feed Monitoring: Ingests articles from selected feeds focused on security, privacy, and compliance. 🌐 Vendor Webpage Monitoring: Fetches specified policy URLs and checks for updates using Last-Modified headers and in-page content analysis. 3️⃣ Content Filtering 🧹 Applies logic to filter out stale or irrelevant data, focusing only on updates within the past 24 hours. 4️⃣ AI-Powered Risk Categorization 🤖 Two dedicated AI agents (one per stream) analyze content to: 📝 Generate a 2-line compliance/risk-focused summary 🚦 Assign a risk score: High, Medium, Low, or Informational 5️⃣ Digest Generation 🖼️ Summaries are grouped by risk level and formatted into a visually polished HTML report, using category-specific styles and color coding. 6️⃣ Email Delivery 📧 Automatically sends out two separate email reports via Gmail: 🗂️ One for vendor webpage updates 📰 One for RSS feed-based vendor news ✨ Key Features 🔁 Automates daily monitoring across feeds and policy pages 🤖 AI-driven summarization and structured risk scoring 🧾 Clean, HTML-formatted digests grouped by risk category 🧩 Fully customizable: feed sources, vendor URLs, AI prompts, and email styling 🛡️ Designed for compliance, security, and risk teams needing proactive intelligence
by Harshil Agrawal
This workflow allows you to validate emails stored in a table using the Mailcheck node. Airtable node: This node will list all the records from a table. Based on your use case, you might want to replace this node. Mailcheck node: This node will check the emails that got returned by the previous node. Set node: We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow. Airtable1 node: This node will update the Valid field in the table. Based on your use case, you might want to replace this node.
by Juan Sanchez
📌 Request TRM (Colombian Peso to US Dollar exchange rate) 🎯 Objective Retrieve the TRM (Colombian Peso to US Dollar exchange rate) for a specific date provided by the user via Telegram. 🔄 Summary Flow 📨 Telegram Message The user sends a text or audio message to the Telegram Bot. 🧠 Date Extraction AI (OpenAI) is used to identify the date in YYYY-MM-DD format. 📅 Validation If the date is in the future, the user is notified that it is not valid. 📡 TRM Query The bot queries the open data API from the Colombian government. 📥 Result ✅ If TRM data exists for that date → The bot replies to the user. ❌ If not → It searches up to 10 previous days for available data. 📤 Final Response The most recent available value is sent, or a message indicating no information is available. 🔗 Data Source datos.gov.co – TRM
by Harrison P
🎬 Create Unlimited Viral ASMR Videos — Fully Automated! Tired of spending hours brainstorming viral content, writing prompts, and juggling video uploads? This powerful n8n workflow automates your entire short-form ASMR video creation process, turning you into a content powerhouse — without burnout or repetitive manual work. ✅ No coding required ✅ Connects with cutting-edge AI video generation (FalAI) ✅ Publishes videos to TikTok, Instagram, YouTube, and more ✅ Tracks everything neatly in Google Sheets ✅ Ready for customization! ✨ How It Works Here’s how this workflow becomes your virtual content assistant: Brainstorm New Viral ASMR Objects Generates a creative, unused idea like: Glass Kiwi Crystal Banana Frozen Watermelon Ensures fresh content by checking your Google Sheet for duplicates. Generate a Detailed Video Prompt Transforms your object idea into a sensory-rich ASMR video script: “Imagine a crystal-clear kiwi sliced open, glistening under neon lights…” This prompt is crafted to produce hyper-realistic AI visuals perfect for short-form platforms. Create the ASMR Video with FalAI Sends the prompt to FalAI, an advanced video-generation API. Supports vertical aspect ratio for social reels. Automatically waits for video processing to complete. Save Video Details to Google Sheets Adds each new object and video URL to a Google Sheet. Maintains a running archive of all your generated videos. No more manual tracking or losing track of which videos you’ve already created! Upload to Blotato and Publish Across Platforms Uploads the video to Blotato’s media hosting service. Optionally posts the video automatically to: TikTok Instagram YouTube And easily extendable to Facebook, Pinterest, and more! Posts your captions, hashtags, and links seamlessly. 🎯 Why You’ll Love This Workflow ✅ Saves hours of creative work and publishing time ✅ Eliminates manual uploads and spreadsheets ✅ Keeps your content fresh and consistent ✅ Highly customizable for new platforms or personal style ✅ Includes clear instructions and sticky notes for easy setup 💬 Need Help? If you get stuck: Check the included sticky notes in the workflow canvas Or search for “N8N Assistant by Nskha” on ChatGPT, and upload your JSON file for personalized support. 🎉 Supercharge Your Content Creation This isn’t just a workflow — it’s a full-scale ASMR content machine ready to scale your viral video production effortlessly. Automate your creativity and free up your time to focus on what matters most! ✅ Ready to impress your audience and grow your brand? Import this workflow today and start creating viral ASMR magic!
by Kurt Bijl
📝 POSTIZ MEDIA UPLOAD WORKFLOW ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 PURPOSE: Automated media upload pipeline that downloads videos and images from Google Drive and uploads them to Postiz storage for social media posting. 🔄 WORKFLOW PROCESS: Webhook triggers the workflow Fetch media metadata from Airtable Download video + image from Google Drive Upload both files to Postiz storage Save Postiz file paths back to Airtable 🔧 TECHNICAL DETAILS: • API: Postiz /upload endpoint (multipart-form-data) • Storage: Converts Google Drive files → Postiz URLs • Integration: Updates Airtable with Postiz paths • Required: All media must be uploaded before posting 📱 SOCIAL MEDIA POSTING WORKFLOW ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 PURPOSE: Automated multi-platform social media posting using Postiz API. Distributes content across Instagram, Twitter/X (2 accounts), LinkedIn, and Facebook with platform-specific content cleaning and formatting. 🔄 COMPLETE WORKFLOW PROCESS: 📊 Fetch social media content from Airtable database 🔗 Get integration IDs for all connected social platforms 🔀 Route each platform to appropriate content processor 🧹 Clean content to prevent JSON formatting errors 📱 Post to respective social media platforms simultaneously 📋 PLATFORM COVERAGE: • 📸 Instagram (Visual content + captions) • 🐦 Twitter/X Main Account (Text + images) • 🐦 Twitter/X Alt Account (Duplicate posting) • 💼 LinkedIn (Professional content) • 📘 Facebook (Meta ecosystem posting) ⚠️ CRITICAL CONTENT CLEANING: • Removes line breaks (\n), carriage returns (\r), tabs (\t) • Replaces multiple spaces with single spaces • Prevents 'JSON parameter needs to be valid JSON' errors • ESSENTIAL: Without cleaning, all API calls fail! 🔧 TECHNICAL SPECIFICATIONS: • API: Postiz /posts endpoint (POST) • Authentication: HTTP Header Auth • Content-Type: application/json • Posting Type: Immediate ('now') + 1 minute delay • Media: References pre-uploaded Postiz image paths • Rate Limit: 30 requests/hour (API beta limitation) 🔗 DATA SOURCES: • Content: Airtable • Media: Pre-uploaded via separate media upload workflow • Fields: instagram_caption, linkedin_post, twitter single, faceboook • Images: References 'postiz image' field paths ⚡ EXECUTION FLOW: Airtable → Integrations → Platform Router → Content Cleaners → Social Publishers 🚨 TROUBLESHOOTING: • JSON Errors: Check content cleaning nodes • 500 Errors: Verify integration IDs and account connections • Missing Media: Ensure media upload workflow ran first • Rate Limits: Space out executions (30/hour limit) 🔄 DEPENDENCIES: • Requires: Media upload workflow (for image/video paths) • Connects to: Analytics and monitoring workflows • Updates: Airtable with posting status and URLs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚠️ CRITICAL NOTES: • Cannot use external URLs in Postiz posts • Files must be uploaded to google drive first - id referenced in airtable • Enables reference tracking for all platforms 📊 DATA FLOW: Google Drive → Download → Postiz Upload → Airtable Update 🔗 CONNECTS TO: Main social media posting workflows that reference these uploaded file paths for Instagram, Twitter, LinkedIn, Facebook, and YouTube posting. 🎬 VIDEO POSTING WORKFLOW ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 PURPOSE: Automated video content distribution across Instagram, Facebook, and YouTube using Postiz API. Specialized workflow for video content with platform-specific processing and cleaning. 🔄 WORKFLOW EXECUTION: 📊 Fetch video content from Airtable database (recuoYjg4icStHsMK) 🔗 Get integration IDs for video-enabled platforms 🔀 Route platforms to appropriate video processors 🧹 Clean content for Instagram & Facebook (YouTube bypassed) 📹 Publish to video platforms simultaneously 📹 PLATFORM COVERAGE: • 📱 Instagram: Video posts & Reels (✅ Working) • 📘 Facebook: Video content (⚠️ Test mode) • 🎬 YouTube: Long-form videos (🚨 Broken) ⚡ EXECUTION FLOW: Airtable → Integrations → Video Router → [3 Parallel Paths] ├── Instagram: Cleaner → Publisher ├── Facebook: Cleaner → Publisher └── YouTube: [Direct] → Publisher 🗄️ DATA SOURCE: • Base: Netkreatives.com • Table: Youtube tool • Video Field: 'postiz video' • Content Fields: instagram_caption, faceboook 🔧 TECHNICAL SPECS: • Method: POST • Auth: HTTP Header (Postiz credentials) • Timing: Immediate posting (+1 minute delay) • Media: Pre-uploaded video paths • Content-Type: application/json
by Misek
> 💛 Sticky Note: > This Hyperpersonalized Outreach n8n template automates AI‑powered B2B email campaigns by combining Apollo.io lead scraping, LinkedIn enrichment, GPT‑4 generation, and SendGrid delivery. Follow the setup steps below to get started in minutes! 🔥 TLDR Build a scalable, AI‑driven email outreach pipeline that: Scrapes up to 500 leads from Apify Enriches profiles with LinkedIn work history & posts Filters and scores leads via Apollo.io Generates personalized HTML emails with GPT‑4.1 . Sends via SendGrid and logs status in Supabase 👥 Who’s It For Sales teams, growth marketers, and founders who need: High‑touch cold outreach at scale Data‑driven personalisation using real profile insights Automated lead qualification and tracking ⚙️ How It Works / What It Does Apollo Scraper: Uses Apify HTTP nodes (no hard‑coded API keys) to pull lead data. Supabase Sink: Persists email, linkedin_url, and ingestion timestamp. LinkedIn Enrichment: Fetches career history and latest 5 posts via RapidAPI. Data Validation: Conditional nodes drop incomplete or irrelevant leads. Product Description Agent: Creates a customer profile based on the product and how it can help them. Story Agent: Has the persona, style of speech and rules to generate reply for the customer based on the pain points and solution found by the Product Description agent. HTML Modifier: Contains a fix format to keep the output format of each mail consistent and also generate a subject for the mail. SendGrid Dispatch: An SMTP service which delivers emails in large quantity and also keep your mail spam free otherwise if you use gmail node your mail will go staright to spam; updates status=true/false in Supabase. 🛠️ How to Set Up Clone the workflow JSON into your n8n instance. Configure environment variables for Apollo.io, RapidAPI, OpenAI, SendGrid, and Supabase. Rename credentials and test each HTTP node. Activate the workflow and monitor executions in n8n’s UI. ✅ Requirements n8n 0.300.0+ Accounts & API keys for Apollo.io, RapidAPI (LinkedIn), OpenAI, SendGrid, Supabase Supabase to store LinkedIn id and gmails of leads, also useful to eliminate the risk of having duplicate data. 🎨 How to Customize Adjust lead batch size in the Apollo HTTP node. Swap the HTML email template to match your brand. Add A/B subject‑line experiments by cloning the Email Agent. > 🔐 Security Reminder: All credentials must be stored in n8n’s credential manager—never hard‑code API keys in HTTP nodes.
by Mutasem
Use case Error workflows are an important part of running workflows in production. Make sure to set them up for all your important workflows. The message links directly to the execution. How to setup Add Telegram creds Set chat id in Telegram node Add this error workflow to other workflows https://docs.n8n.io/flow-logic/error-handling/#create-and-set-an-error-workflow
by dmr
AI YouTube Playlist & Video Analyst Chatbot This n8n workflow transforms entire YouTube playlists or single videos into interactive knowledge bases you can chat with. Ask questions and get summaries without needing to watch hours of content. 🌟 How it Works 🔗 Provide a Link: Start by giving the workflow a URL for a YouTube playlist or a single video. 📄 Content Retrieval: The workflow automatically fetches the video details and transcripts for the provided link. For playlists, it can process multiple videos at once (you might be asked how many). 🧠 AI Processing: Google's Gemini AI reads through the transcripts, understands the content, and creates summaries. 💾 Storage & Context: The processed information and summaries are stored in a vector database (Qdrant), making them ready for conversation. Context is managed using Redis, remembering the current video/playlist you're discussing. 💬 Chat & Ask: Now, you can ask the AI agent questions about the playlist or video content! Because context is maintained, you can ask follow-up questions (like "expand on point X") without needing to provide the URL again. 🛠️ Requirements Community Node:** This workflow uses the youtubeTranscripter community node to fetch video transcripts. You'll need to install it in your n8n environment. Installation: npm install n8n-nodes-youtube-transcription-dmr Important: Community nodes require a self-hosted n8n instance. Redis:** A Redis instance is required for managing conversation context and status between interactions. Credentials:** You will need API credentials configured in your n8n instance for: Google Gemini (AI Models) Qdrant (Vector Store) Redis (Context Store) 🤖 AI Agent Capabilities Engage with the AI agent to explore the video content. Since the agent remembers the context of your conversation, you can ask detailed follow-up questions naturally: Get a quick summary of a single video or an entire playlist. Ask for key takeaways or main topics discussed. Query for specific information mentioned in the videos. Ask the agent to elaborate on a specific point previously mentioned. Understand complex subjects without watching the full duration. 🚀 Use Cases 📊 Content Analysis:** Quickly understand the themes and key points across a playlist or long video. 📚 Research & Learning:** Extract insights from educational series or tutorials efficiently. ✍️ Content Creation:** Easily repurpose video transcript information into blog posts, notes, or social media content. ⏱️ Save Time:** Get the essence of video content when you're short on time. ♿ Accessibility:** Offers a text-based way to interact with and understand video content. ✨ Sample Prompts Please analyze this playlist and tell me the main topics covered: [YouTube Playlist URL] Summarize the first 5 videos in this playlist: [YouTube Playlist URL] (Follow-up) Tell me more about the main point in video 3. What are the key points discussed in this video? [YouTube Video URL] (Follow-up) Expand on the second key point you mentioned. Does the video at [YouTube Video URL] mention [specific topic]?
by Luciano Gutierrez
Create & Publish Instagram Carousel Posts with GPT-4.1-mini, Imgur & Graph API Version: 2.0.0 n8n Version: 1.88.0+ Author: Unknown License: MIT Description An intelligent and modular workflow that automatically generates, manages, and publishes Instagram carousel posts, using AI for both content and images. It includes semantic memory to ensure uniqueness across posts and a scalable architecture for brand growth. Key Features 🤖 Advanced AI Carousel Content: Generates unique multi-slide post content—titles, captions, hashtags, and strategic CTAs for each card in the carousel. 🎨 Automated Image Generation: Creates high-quality visuals for every slide using OpenAI's DALL·E API. 🧠 Semantic Memory Search: Checks each theme against a local vector database using OpenAI Embeddings to avoid content repetition. 📊 Publication Database: Logs all generated carousel posts into Google Sheets for tracking, analytics, and audits. 📱 Instagram Direct Publishing: Publishes carousel media and captions automatically through the Instagram Graph API. 🗓️ Scheduled & Manual Runs: Trigger manually or schedule every 12 hours. 🔐 Secure Credential Management: Uses n8n credential fields—no hardcoded API keys or tokens. 🚀 Flexible Prompting System: Dynamically adapts style templates for different brands and industries. Use Cases E‑commerce Launches: Showcase product features across multiple slides with tailored benefits and CTAs. Fitness & Wellness Tips: Educate followers with step-by-step workouts or nutrition advice in a carousel format. Educational Infographics: Present multi-part tutorials, stats, or course highlights. SaaS Feature Demos: Demonstrate software workflows or new features slide by slide. Event Announcements: Build excitement for webinars, conferences, or local meetups. Customization Examples Retail/E‑commerce: Adjust the **Theme Generator Code Node to include product category, price point, and seasonal focus as vector inputs. Health & Fitness: Tweak the **AI Prompt Templates to match your brand voice—e.g., friendly coach tone with bullet‑pointed workout steps. Education/Training: Modify the **Semantic Memory Embeddings Node thresholds to deepen topic variety across tutorial series. Tech/SaaS: Customize the **Image Hosting HTTP Request Node to use your company’s CDN instead of Imgur by swapping the endpoint and credential field. Workflow Overview 1. Theme Generation (Generate Theme Code Node) Combines random vectors (topic starter + focus + benefit) to create unique carousel themes. 2. Content Creation (AI Agent Code Node) Sends themed prompts to OpenAI, generating slide-by-slide titles, captions, and CTAs in structured JSON. 3. Semantic Memory Check (OpenAI Embeddings Node) Runs embeddings against past themes stored in a Postgres vector database (pgvector) to ensure novelty. If similarity > threshold, regenerates theme. 4. JSON Validation (Parse & Validate Code Node) Parses AI response, validates JSON schema, and handles errors gracefully to prevent workflow failures. 5. Content Storage (Google Sheets Node) Writes carousel metadata (titles, captions, hashtags, slide count, scheduled date) to a Google Sheets spreadsheet. 6. Image Generation (DALL·E Image Generation Node) Generates one graphic per slide at 1024×1024 resolution. 7. Image Hosting (Imgur Upload HTTP Request Node) Uses an HTTP Request node with Imgur credential field to upload each image and retrieve public URLs. 8. Instagram Publishing (Instagram Graph API Nodes) Create Media Containers**: Sends batch media creation request. Publish Carousel**: Publishes the carousel using the list of container IDs and caption. 9. Scheduling & Triggers Manual Trigger**: For testing and one‑off posts. Cron Trigger**: Scheduled trigger every 12 hours (configurable). Security All sensitive values (OpenAI API key, Imgur Client ID/Secret, Instagram Access Token, Google Sheets OAuth2) must be stored in n8n’s Credentials panel. Do not hardcode keys or tokens in HTTP Request or Code nodes. Instead, reference credential fields: In HTTP Request nodes: select the corresponding credential under Authentication. In Code nodes: access this.getCredentials('openAI'), this.getCredentials('imgur'), etc. Instructions Import the Workflow: In n8n, go to Workflows > Import from File and upload the JSON. Configure Credentials: OpenAI API – set up in Credentials > OpenAI API. Google Sheets OAuth2 – set up in Credentials > Google Sheets OAuth2. Imgur – set up in Credentials > Imgur. Instagram Graph API – set up in Credentials > Instagram Graph API. Set Placeholders: Google Sheets Document ID Instagram User ID Customize Prompts & Vectors: Tweak Code node inputs and prompt templates as needed. Test & Activate: Run a manual trigger, verify outputs, then enable the cron schedule. Tags Social Media Instagram Carousel AI Content Generation OpenAI n8n Marketing Automation Vector Search Content Scheduling Technical Notes Uses pgvector in Postgres for efficient semantic similarity. Supports extensible platforms—duplicate the publishing steps to add LinkedIn or Facebook. Error handling ensures invalid JSON never reaches the publishing nodes. License This workflow is released under the MIT License.