Skip to main content
M

Mohamed Abdelwahab

4
Workflows

Workflows by Mohamed Abdelwahab

Workflow preview: Automate document ingestion & RAG system with Google Drive, Sheets & OpenAI
Free advanced

Automate document ingestion & RAG system with Google Drive, Sheets & OpenAI

## 1. Overview The **IngestionDocs** workflow is a fully automated **document ingestion and knowledge management system** built with **n8n**. Its purpose is to continuously ingest organizational documents from **Google Drive**, transform them into vector embeddings using **OpenAI**, store them in **Pinecone**, and make them searchable and retrievable through an **AI-powered Q&A interface**. This ensures that employees always have access to the most up-to-date knowledge base without requiring manual intervention. ------------------------------------------------------------------------ ## 2. Key Objectives - **Automated Ingestion** → Seamlessly process new and updated documents from Google Drive.\ - **Change Detection** → Track and differentiate between new, updated, and previously processed documents.\ - **Knowledge Base Construction** → Convert documents into embeddings for semantic search.\ - **AI-Powered Assistance** → Provide an intelligent Q&A system for employees to query manuals.\ - **Scalable & Maintainable** → Modular design using n8n, LangChain, and Pinecone. ------------------------------------------------------------------------ ## 3. Workflow Breakdown ### **A. Document Monitoring and Retrieval** - The workflow begins with two **Google Drive triggers**: - **File Created Trigger** → Fires when a new document is uploaded.\ - **File Updated Trigger** → Fires when an existing document is modified.\ - A **search operation** lists the files in the designated Google Drive folder.\ - Non-downloadable items (e.g., subfolders) are filtered out.\ - For valid files: - The file is downloaded.\ - A **SHA256 hash** is generated to uniquely identify the file's content. ------------------------------------------------------------------------ ### **B. Record Management (Google Sheets Integration)** To keep track of ingestion states, the workflow uses a **Google Sheets--based Record Manager**:\ - Each file entry contains:\ - **Id** (Google Drive file ID)\ - **Name** (file name)\ - **hashId** (SHA256 checksum)\ - The workflow compares the current file's hash with the stored one:\ - **New Document** → File not found in records → Inserted into the Record Manager.\ - **Already Processed** → File exists and hash matches → Skipped.\ - **Updated Document** → File exists but hash differs → Record is updated. This guarantees that only new or modified content is processed, avoiding duplication. ------------------------------------------------------------------------ ### **C. Document Processing and Vectorization** Once a document is marked as new or updated:\ 1. **Default Data Loader** extracts its content (binary files supported).\ - Pages are split into individual chunks.\ - Metadata such as file ID and name are attached.\ 2. **Recursive Character Text Splitter** divides the content into manageable segments with overlap.\ 3. **OpenAI Embeddings (`text-embedding-3-large`)** transform each text chunk into a semantic vector.\ 4. **Pinecone Vector Store** stores these vectors in the configured index:\ - For **new documents**, embeddings are inserted into a namespace based on the file name.\ - For **updated documents**, the namespace is cleared first, then re-ingested with fresh embeddings. This process builds a **scalable and queryable knowledge base**. ------------------------------------------------------------------------ ### **D. Knowledge Base Q&A Interface** The workflow also provides an **interactive form-based user interface**:\ - **Form Trigger** → Collects employee questions.\ - **LangChain AI Agent**:\ - Receives the question.\ - Retrieves relevant context from **Pinecone** using vector similarity search.\ - Processes the response using **OpenAI Chat Model (`gpt-4.1-mini`)**.\ - **Answer Formatting**:\ - Responses are returned in **HTML** format for readability.\ - A **custom CSS theme** ensures a modern, user-friendly design.\ - Answers may include references to page numbers when available. This creates a **self-service knowledge base assistant** that employees can query in natural language. ------------------------------------------------------------------------ ## 4. Technologies Used - **n8n** → Orchestration of the entire workflow.\ - **Google Drive API** → File monitoring, listing, and downloading.\ - **Google Sheets API** → Record manager for tracking file states.\ - **OpenAI API**: - **text-embedding-3-large** for semantic vector creation.\ - **gpt-4.1-mini** for conversational Q&A.\ - **Pinecone** → Vector database for embedding storage and retrieval.\ - **LangChain** → Document loaders, text splitters, vector store connectors, and agent logic.\ - **Crypto (SHA256)** → File hash generation for change detection.\ - **Form Trigger + Form Node** → Employee-facing Q&A submission and answer display.\ - **Custom CSS** → Provides a modern, responsive, styled UI for the knowledge base. ------------------------------------------------------------------------ ## 5. End-to-End Data Flow 1. **Employee uploads or updates a document** → Google Drive detects the change.\ 2. **Workflow downloads and hashes the file** → Ensures uniqueness and detects modifications.\ 3. **Record Manager (Google Sheets)** → Decides whether to skip, insert, or update the record.\ 4. **Document Processing** → Splitting + Embedding + Storing into Pinecone.\ 5. **Knowledge Base Updated** → The latest version of documents is indexed.\ 6. **Employee asks a question via the web form**.\ 7. **AI Agent retrieves embeddings from Pinecone + uses GPT-4.1-mini** → Generates a contextual answer.\ 8. **Answer displayed in styled HTML** → Delivered back to the employee through the form interface. ------------------------------------------------------------------------ ## 6. Benefits - **Always Up-to-Date** → Automatically syncs documents when uploaded or changed.\ - **No Duplicates** → Smart hashing ensures only relevant updates are reprocessed.\ - **Searchable Knowledge Base** → Employees can query documents semantically, not just by keywords.\ - **Enhanced Productivity** → Answers are immediate, reducing time spent browsing manuals.\ - **Scalable** → New documents and users can be added without workflow redesign. ------------------------------------------------------------------------ ✅ In summary, **IngestionDocs** is a **robust AI-driven document ingestion and retrieval system** that integrates **Google Drive, Google Sheets, OpenAI, and Pinecone** within **n8n**. It continuously builds and maintains a **knowledge base of manuals** while offering employees an intelligent, user-friendly **Q&A assistant** for fast and accurate knowledge retrieval.

M
Mohamed Abdelwahab
AI RAG
6 Sep 2025
1307
0
Workflow preview: Generate LinkedIn posts from books using OpenAI, LangChain & Pinecone vector search
Free advanced

Generate LinkedIn posts from books using OpenAI, LangChain & Pinecone vector search

Automates the process of generating, storing, and publishing engaging LinkedIn posts derived from books (PDFs) using AI and vector search. --- ## 🧠 Overview This workflow: 1. **Watches a Google Drive folder** for new or updated book PDFs. 2. **Extracts and embeds** the content using OpenAI. 3. **Stores the data** in a Pinecone vector database. 4. **Uses a LangChain agent** to generate post ideas. 5. **Creates concise LinkedIn posts** with hook, insight, CTA. 6. **Updates a Google Sheet** and posts to LinkedIn. --- ## 🛠 Workflow Breakdown ### 📥 1. Google Drive Trigger - **Trigger:** Watches a folder for new or updated PDF files. - **Action:** Downloads the updated PDF. ### 📄 2. Extract and Embed Content - **Extract from File:** Parses PDF to extract text. - **Text Splitter:** Breaks text into chunks. - **Embeddings (OpenAI):** Converts chunks into vector embeddings. - **Pinecone Vector Store:** Saves the embeddings with the book name as namespace. ### 🧠 3. Post Idea Generation (LangChain Agent) - Uses a prompt to: - Search Pinecone DB - Extract insights - Format into 5 LinkedIn post ideas with: - **Hook** - **Insight** - **CTA** - **Memory buffer** and structured output parser are used for clean AI interaction. ### ✍️ 4. Post Creation - Each idea is: - **Split** - Rewritten with a GPT model prompt to match LinkedIn tone - Styled for under 600 characters - Includes emojis, hashtags, and tone guidelines ### 📊 5. Google Sheet Integration - Saves all generated posts to a **Google Sheet**. - Marks status: `"published"` or `"no"`. ### 🔁 6. Scheduled Publishing - Every day: - Pulls an unpublished post - Publishes it to LinkedIn - Updates the post's status and timestamp in the Google Sheet --- ## ⚙️ Setup Guide ### 📂 Google Drive - Create a folder for book PDFs - Connect your Google Drive account to n8n - Provide access token with file read permission ### 📊 Google Sheets - Create a Google Sheet with columns: - `bookname`, `hook`, `insight`, `cta`, `postContent`, `published`, `date` - Add credentials in n8n with read/write permission ### 🧠 Pinecone - Set up a Pinecone project and index (`linkdenpost`) - Namespace will be auto-named using the book filename ### 🔑 API Credentials Required - **OpenAI API** (for embeddings and post generation) - **Pinecone API** (for vector storage and retrieval) - **LinkedIn OAuth2** (to publish posts) - **Google Drive & Sheets** credentials --- ## 🔁 Flow Summary ```mermaid graph TD A[Google Drive Trigger] --> B[Download PDF] B --> C[Extract Text] C --> D[Text Splitter] D --> E[Create Embeddings] E --> F[Pinecone Vector Store] F --> G[LangChain Agent] G --> H[Structured Output (5 Post Ideas)] H --> I[Split Ideas] I --> J[Format as LinkedIn Post (GPT)] J --> K[Store in Google Sheet] L[Schedule Trigger] --> M[Get Unpublished Post] M --> N[Post to LinkedIn] N --> O[Mark as Published] ``` --- ## 🧪 Prompt Example (Used in LangChain Agent) ```text You are a content strategist. Search the Pinecone vector DB containing a book. Generate 5 unique LinkedIn post ideas with: - A Hook (curiosity driven) - Insight (summary < 100 words) - CTA ("Agree or disagree?", etc.) Respond in structured JSON: [ { "Hook": "...", "Insight": "...", "CTA": "..." }, ... ] ``` --- ## ✅ Output Sample ```json { "Hook": "Why your lab's results might be invalid 😱", "Insight": "ISO/IEC 17025 stresses that labs must plan and address risks to impartiality and validity.", "CTA": "Does your lab audit for these risks?" } ``` --- ## 📆 Schedule Control - Uses **Schedule Trigger** to post daily at a set time. - Ensures automation with LinkedIn and accurate Google Sheet syncing. --- ## 📝 Notes - Posts remain **professional and concise** for a LinkedIn audience - Works with **any PDF book** - Supports multi-book pipelines - You can filter and tag books by filename or folder for segmenting post styles

M
Mohamed Abdelwahab
Social Media
20 Jul 2025
682
0
Workflow preview: AI SEO Blog Automation for WordPress with featured images-End-to-End
Free advanced

AI SEO Blog Automation for WordPress with featured images-End-to-End

🧠 Automate end-to-end SEO blog creation and WordPress publishing using a GPT-5 multi-agent workflow with real-time research, metadata generation, and optional featured images. ## 🧠 AI-Powered SEO Blog Automation for WordPress — n8n + GPT-5 **Category:** Content Creation · Marketing Automation · AI Agents · Publishing **Use Case:** End-to-End SEO Blog Generation & Publishing This **production-ready n8n workflow** automates the entire blog content lifecycle — from keyword input to WordPress draft publishing — using a **multi-agent GPT-5 orchestration architecture**. Designed for **content teams, SEO professionals, agencies, and founders**, the workflow transforms structured inputs into **fact-checked, SEO-optimized, publication-ready blog posts** with metadata, tags, excerpts, and optional featured images. Simply copy, paste, and configure — no custom coding required. --- ## 🚀 What This Workflow Does This workflow automates **content creation at scale** by coordinating specialized AI agents that each handle a single responsibility in a strict execution order. It supports both **manual content requests** and **scheduled batch publishing**, making it suitable for editorial pipelines, programmatic SEO, and marketing automation. --- ## ✨ Key Features & Capabilities ### 🧠 AI Content Creation (GPT-5 Optimized) - Multi-agent content pipeline with clearly defined roles - SEO-driven outline and section planning - Expert-level long-form writing - Inline citations and verified sources - Final editorial HTML polishing ### 🔍 Real-Time Web Research - Live Q&A and fact retrieval (OpenRouter / Perplexity Sonar) - Context-aware, up-to-date information - Reduced hallucinations and outdated content ### 📝 SEO & Publishing Automation - SEO-optimized titles, slugs, excerpts, and meta descriptions - Automatic WordPress category selection - Dynamic tag creation and updates - Draft publishing via WordPress REST API ### 🖼️ Optional Featured Image Pipeline - AI-generated realistic cover image prompts - Alt-text generation for accessibility and SEO - Image upload, resizing, and WordPress attachment ### 📊 Workflow Tracking - Google Sheets integration for batch automation - Automatic status update (`created = yes`) - Suitable for editorial calendars and content tracking --- ## 🔁 Supported Triggers ### 1️⃣ Form Trigger (Manual Publishing) Collects: - Keywords - Target word count - Number of sections - Writing style - Website URL - Website context - Featured image toggle ### 2️⃣ Google Sheets + Schedule Trigger (Batch Publishing) Automatically processes rows containing: - Keywords - Word count - Sections count - Writing style - Website - Website context - Featured image toggle - `created` status flag (auto-updated after publishing) --- ## 🧠 AI Agent Orchestration (GPT-5) A central **Orchestration Agent** coordinates specialized sub-agents: - **GetOnlineInfo** — Live research and Q&A - **OutlinePlanner** — SEO-structured table of contents - **createSections** — Detailed section definitions - **SectionsWriter** — Expert-level content drafting - **Editor** — Final HTML refinement and compliance checks - **MetaInfo** — Title, slug, excerpt, and category selection - **Tags Agent** — SEO-friendly WordPress tag creation and updates - **ImagePrompt** — Cover image prompt and alt text (optional) Each agent executes **once, deterministically**, ensuring consistent and predictable output quality. --- ## ✍️ End-to-End Writing Flow 1. Input parsing (Form or Google Sheets) 2. Real-time data retrieval 3. SEO-optimized outline generation 4. Section-by-section expert writing 5. Editorial refinement into valid HTML 6. Metadata and excerpt generation 7. Tag creation and update in WordPress 8. Optional image generation and upload 9. Draft post publishing to WordPress 10. Google Sheets row update (`created = yes`) --- ## 📦 Output Structure (Validated JSON) ```json { "toc": "Table of Contents", "post_html": "<final HTML content>", "meta_data": { "title": "...", "slug": "...", "excerpt": "...", "category_id": 0 }, "image_data": { "image_prompt": "...", "alt_text": "..." }, "tags": [ { "name": "...", "description": "..." } ], "ready": true } ``` --- ## 🌐 WordPress Integration - REST API endpoints: - `/wp-json/wp/v2/posts` - `/wp-json/wp/v2/media` - `/wp-json/wp/v2/tags` - Draft publishing with author and category assignment - Automatic excerpt and tag updates - Featured image handling (optional) --- ## 🧩 Setup Requirements ### 🔑 Required Credentials - WordPress API credentials - OpenAI API key - OpenRouter API key (optional) - Google Sheets API credentials (optional) ### 🧠 Required Sub-Workflows - OutlinePlanner - createSections - SectionsWriter - Editor - MetaInfo - Tags Agent - ImagePrompt (optional) --- ## 💡 Why Use This Workflow? - Purpose-built for **Content Creation and Marketing Automation** - Eliminates manual writing, formatting, and publishing steps - Scales from single posts to batch content pipelines - Modular design for easy testing and customization - Suitable for SEO blogs, SaaS content, affiliate sites, and agencies --- ## 🏁 Production-Ready - Copy-paste deployable - Validated HTML, JSON, tags, and excerpts - Modular and debuggable architecture - Optimized for GPT-5 quality, consistency, and reliability

M
Mohamed Abdelwahab
Content Creation
18 Jul 2025
4303
0
Workflow preview: Auto-bidder for Freelancer.com with Telegram approval and AI proposals
Free advanced

Auto-bidder for Freelancer.com with Telegram approval and AI proposals

# 🔁 Auto-Bidder for Freelancer.com with Telegram Approval and AI Proposals This **n8n template** automates your freelance bidding workflow on [Freelancer.com](https://freelancer.com), combining API calls, Telegram interactions, and AI-generated proposals. Ideal for freelancers who want to bid smarter, faster, and hands-free. ## ✨ Features - 🔍 **Skill-Based Project Search** Searches for active projects on Freelancer.com using your chosen skill keywords (e.g., `n8n`, `Python`, `Django`). - 🚫 **Duplicate Bid Prevention** Automatically checks if you’ve already bid on a project and skips it. - 🤖 **AI Proposal Generation** Generates short, persuasive, and customized proposals using an AI agent. - 📬 **Telegram Notifications** Sends project summaries to Telegram with inline buttons to **Bid** or **Cancel**. - ✅ **Auto-Bid Submission** When you approve a project via Telegram, the bid is submitted with predefined values (amount, period, milestone). - ⏱️ **Manual or Scheduled Execution** Supports both on-demand and scheduled workflows (hourly, daily, etc.). ## 📌 Requirements - Freelancer.com API token (OAuth) - Telegram Bot API token - OpenAI API key (for proposal generation) ## 📎 Use Cases - Freelancers automating repetitive bidding tasks - Agencies managing client profiles - Developers experimenting with AI + API + chat integration ## 🔗 Included Workflows - `freelancerMain` – Kicks off execution with skill input - `freelancerAgent` – Performs project search, bidding logic, Telegram prompts, and AI proposal generation --- > 💡 Tip: You can easily customize the skill query list, bid amount logic, or prompt format in the workflow settings.

M
Mohamed Abdelwahab
Lead Nurturing
16 Jul 2025
292
0