by Davi Saranszky Mesquita
Use case Workshop We are using this workflow in our workshops to teach how to use Tools a.k.a functions with artificial intelligence. In this specific case, we will use a generic "AI Agent" node to illustrate that it could use other models from different data providers. Enhanced Weather Forecasting In this small example, it's easy to demonstrate how to obtain weather forecast results from the Open-Meteo site to accurately display the upcoming days. This can be used to plan travel decisions, for example. What this workflow does We will make an HTTP request to find out the geographic coordinates of a city. Then, we will make other HTTP requests to discover the weather for the upcoming days. In this workshop, we demonstrate that the AI will be able to determine which tool to call first—it will first call the geolocation tool and then the weather forecast tool. All of this within a single client conversation call. Setup Insert an OpenAI Key and activate the workflow. by Davi Saranszky Mesquita https://www.linkedin.com/in/mesquitadavi/
by Mariano Kostelec
A fully automated content engine that researches, writes, scores, and visualizes LinkedIn posts — built with n8n, OpenAI, Perplexity, and Replicate. What it does: ✅ Researches any topic using real-time data ✅ Writes a personalized post in your voice ✅ Refines tone and structure ✅ Generates abstract, high-quality visual assets ✅ Scores the output and saves it to Google Sheets How it works: Triggered when you change a row status in Google Sheets Uses Perplexity to research GPT-4o (OpenAI) to create and polish content Replicate (FLUX Pro) to generate images Scores the post using heuristics Appends everything back to your sheet
by Rudi Afandi
Description This n8n workflow enables users to send an image to a Telegram bot and receive the extracted text using Tesseract OCR (via the n8n-nodes-tesseractjs Community Node). It's a quick and straightforward way to convert images into readable text directly through chat. How it Works The workflow listens for new image messages coming in via the Telegram bot. Once an image is received, it downloads the image file from Telegram (which initially arrives as application/octet-stream). The image data, now properly identified, is then sent to the Tesseract OCR node to extract the text. Finally, the recognized text is sent back as a reply to the Telegram user. Setup Steps Install Community Node: Ensure you have installed n8n-nodes-tesseractjs in your n8n instance. Connect Telegram Bot: Configure the Telegram Trigger node with your Telegram bot. Bot Token: Add your Telegram bot token to the Send Message node to send replies. Deploy & Test: Activate (deploy) the workflow and send an image to your Telegram bot to test.
by JPres
A Discord bot that responds to mentions by sending messages to n8n workflows and returning the responses. Connects Discord conversations with custom automations, APIs, and AI services through n8n. Full guide on: https://github.com/JimPresting/AI-Discord-Bot/blob/main/README.md Discord Bot Summary Overview The Discord bot listens for mentions, forwards questions to an n8n workflow, processes responses, and replies in Discord. This workflow is intended for all Discord users who want to offer AI interactions with their respective channels. What do you need? You need a Discord account as well as a Google Cloud Project Key Features 1. Listens for Mentions The bot monitors Discord channels for messages that mention it. Optional Configuration**: Can be set to respond only in a specific channel. 2. Forwards Questions to n8n When a user mentions the bot and asks a question: The bot extracts the question. Sends the question, along with channel and user information, to an n8n webhook URL. 3. Processes Data in n8n The n8n workflow receives the question and can: Interact with AI services (e.g., generating responses). Access databases or external APIs. Perform custom logic. n8n formats the response and sends it back to the bot. 4. Replies to Discord with n8n's Response The bot receives the response from n8n. It replies to the user's message in the Discord channel with the answer. Long Responses**: Handles responses exceeding Discord's 2000-character limit by chunking them into multiple messages. 5. Error Handling Includes error handling for: Issues with n8n communication. Response formatting problems. Manages cases where: No question is asked. An invalid response is received from n8n. 6. Typing Indicator While waiting for n8n's response, the bot sends a "typing..." indicator to the Discord channel. 7. Status Update For lengthy n8n processes, the bot sends a message to the Discord channel to inform the user that it is still processing their request. Step-by-Step Setup Guide as per Github Instructions Key Takeaways You’ll configure an n8n webhook to receive Discord messages, process them with your workflow, and respond. You’ll set up a Discord application and bot, grant the right permissions/intents, and invite it to your server. You’ll prepare your server environment (Node.js), scaffold the project, and wire up environment variables. You’ll implement message‐chunking, “typing…” indicators, and robust error handling in your bot code. You’ll deploy with PM2 for persistence and know how to test and troubleshoot common issues. 1. n8n: Create & Expose Your Webhook New Workflow Log into your n8n instance. Click Create Workflow (➕), name it e.g. Discord Bot Handler. Webhook Trigger Add a node (➕) → search Webhook. Set: Authentication: None (or your choice) HTTP Method: POST Path: e.g. /discord-bot Click Execute Node to activate. Copy Webhook URL After execution, copy the Production Webhook URL. You’ll paste this into your bot’s .env. Build Your Logic Chain additional nodes (AI, database lookups, etc.) as required. Format the JSON Response Insert a Function node before the end: return { json: { answer: "Your processed reply" } }; Respond to Webhook Add Respond to Webhook as the final node. Point it at your Function node’s output (with the answer field). Activate Toggle Active in the top‐right and Save. 2. Discord Developer Portal: App & Bot New Application Visit the Discord Developer Portal. Click New Application, name it. Go to Bot → Add Bot. Enable Intents & Permissions Under Privileged Gateway Intents, toggle Message Content Intent. Under Bot Permissions, check: Read Messages/View Channels Send Messages Read Message History Grab Your Token In Bot → click Copy (or Reset Token). Store it securely. Invite Link (OAuth2 URL) Go to OAuth2 → URL Generator. Select scopes: bot, applications.commands. Under Bot Permissions, select the same permissions as above. Copy the generated URL, open it in your browser, and invite your bot. 3. Server Prep: Node.js & Project Setup Install Node.js v20.x sudo apt purge nodejs npm sudo apt autoremove curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs node -v # Expect v20.x.x npm -v # Expect 10.x.x Project Folder mkdir discord-bot cd discord-bot Initialize & Dependencies npm init -y npm install discord.js axios dotenv 4. Bot Code & Configuration Environment Variables Create .env: nano .env Populate: DISCORD_BOT_TOKEN=your_bot_token N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/discord-bot Optional: restrict to one channel TARGET_CHANNEL_ID=123456789012345678 Bot Script Create index.js: nano index.js Implement: Import dotenv, discord.js, axios. Set up client with MessageContent intent. On messageCreate: Ignore bots or non‐mentions. (Optional) Filter by channel ID. Extract and validate the user’s question. Send “typing…” every 5 s; after 20 s send a status update if still processing. POST to your n8n webhook with question, channelId, userId, userName. Parse various response shapes to find answer. If answer.length ≤ 2000, message.reply(answer). Else, split into ~1900‑char chunks at sentence/paragraph breaks and send sequentially. On errors, clear intervals, log details, and reply with an error message. Login client.login(process.env.DISCORD_BOT_TOKEN); 5. Deployment: Keep It Alive with PM2 Install PM2 npm install -g pm2 Start & Monitor pm2 start index.js --name discord-bot pm2 status pm2 logs discord-bot Auto‐Start on Boot pm2 startup Follow the printed command (e.g. sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u your_user --hp /home/your_user) pm2 save 6. Test & Troubleshoot Functional Test In your Discord server: @YourBot What’s the weather like? Expect a reply from your n8n workflow. Common Pitfalls No reply → check pm2 logs discord-bot. Intent Errors → verify Message Content Intent in Portal. Webhook failures → ensure workflow is active and URL is correct. Formatting issues → confirm your Function node returns json.answer. Inspect Raw Data Search your logs for Complete response from n8n: to debug payload shapes. `
by EoCi - Mr.Eo
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Introduction Tired of spending time crafting the perfect AI prompt? This workflow takes your simple ideas like "write a blog post" and automatically transforms them into detailed, structured prompts that actually work. 🎯 What This Does Automatically converts simple user prompts like "write a blog post" into structured, professional AI prompts with metadata, variables, and clear instructions. Perfect for everybody, all industries and organizations who are wanting to eliminate prompt engineering works. 🔄 How It Works Google Sheets Trigger monitors for new prompts AI Enhancement Pipeline uses Gemini + Groq to add structure & context Field Completion auto-generates missing metadata (topic, categories) Quality Assurance validates & stores complete results 🚀 Setup Requirements AI APIs**: Gemini, Telegram, Groq API keys Google Sheets**: 2 sheets (Main, ModifiedPrompt) 5 minutes setup time** - detailed instructions in blue sticky notes Set up steps Setup time: < 5 minutes Create a Google Spreadsheet with two tabs (sheets): OriginalPrompts and ModifiedPrompts. OriginalPrompts columns: Original Prompt ID | Model | Original Prompt | Created Time ModifiedPrompts columns (example): Modified Prompt ID | Original Prompt ID | Topic | Topic Categories | Modified Prompt | Prompt Title | Prompt Type | Model Used | Improvement Notes | Updated Time | Created Time | isProcessed Add and attach credentials in n8n: Google Sheets OAuth2 (required for getting new prompt) Gemini and Groq API credentials (required for AI Agent) Telegram credential (required for notifications) Save & Activate the workflow. Add a test row to OriginalPrompts, for example: Original Prompt ID: 1 — Original Prompt: "Write a short blog post about AI ethics". Wait ~30–60s and check ModifiedPrompts for the enhanced output. That’s it ! Once it configured, drop short ideas into your sheet and get professional prompts back automatically. Your prompts get better, your AI outputs improve, and you save hours of manual prompt crafting.
by Trung Tran
CV Extractor: Google Drive to Sheet + Slack Update for Recruiters Watch the demo video below: > This workflow automatically processes resumes (PDFs) uploaded or updated in a Google Drive folder. It extracts and structures the candidate’s information using AI, then updates or inserts the data into a Google Sheet, acting as a central talent database. Finally, it notifies the hiring team via Slack with a summary. Perfect for HR and TA teams, this automation eliminates the repetitive task of manually copying candidate details from CVs into spreadsheets, saving hours of admin work every week and keeping your hiring pipeline clean, fast, and up to date. 👤 Who’s it for This workflow is designed for: Recruiters* and *HR coordinators** who manage candidate profiles via Google Drive. Talent Acquisition teams** who want to automate CV parsing, enrichment, and database updating. Companies or hiring agencies** using spreadsheets for candidate tracking and CRM-like HR ops. ⚙️ How it works / What it does This smart and fully automated workflow: Monitors a Google Drive folder for any uploaded or updated resumes (PDFs). Downloads and extracts resume content using PDF parsing. Sends the raw text to GPT-4, which returns a structured profile (name, title, experience, skills, etc.). Verifies the profile and transforms it into a clean, row-based format. Upserts the candidate profile into a Google Sheet (insert or update by email). Notifies the hiring team in Slack or email that a profile was added or updated. This is a no-touch pipeline to keep your candidate data clean, current, and centralized. 🛠️ How to set up Step 1: Prepare your Google Drive folder Create a folder like /SmartHR/cv/ Upload sample resumes in .pdf format Step 2: Create your Google Sheet Columns to include: Email, FullName, JobTitle, Phone, Location, Experience, Education, Skills, etc. Optional: Add conditional formatting to highlight updates Step 3: Connect the n8n workflow Use the Google Drive Trigger: fileCreated → new profile uploaded fileUpdated → existing profile modified Use Google Drive (Download file) to fetch the resume Use Extract From PDF to get raw content Step 4: Configure GPT-4 node Use the structured system prompt to extract profile information Use json parser node to ensure safe formatting for next steps Step 5: Transform & Save Use a Function node to map fields to Google Sheet columns Use Append or update row (based on email as unique key) Optionally send Slack or email message to notify hiring team ✅ Requirements 🔑 OpenAI GPT-4 API key 🟩 n8n Cloud or Self-hosted with: Google Drive integration Google Sheets integration Email/Slack credentials (optional) 📄 Resume files in readable PDF format 📊 Google Sheet prepared with relevant headers ✏️ How to customize the workflow | Part | Customization Options | |----------------------------|----------------------------------------------------------------------------------------| | GPT Prompt | Tune for different job levels or fields (e.g., engineers vs marketers) | | Field Mapping | Update transform node to include other profile fields (LinkedIn, portfolio, etc.) | | Notification | Switch to Microsoft Teams, Telegram, or email alerts instead of Slack | | Data Store | Replace Google Sheet with Airtable, Notion, or database system | | Trigger Source | Trigger from email attachments or webhook instead of Google Drive if needed | | Output Format | Generate PDF profile cards or summary documents using HTML → PDF node |
by Muhammad Farooq Iqbal
This n8n template demonstrates how to automate the creation of high-quality visual content using AI. The workflow takes simple titles from a Google Sheets spreadsheet, generates detailed artistic prompts using AI, creates photorealistic images, and manages the entire process from data input to final delivery. Use cases are many: Perfect for digital marketers, content creators, social media managers, e-commerce businesses, advertising agencies, and anyone needing consistent, high-quality visual content for marketing campaigns, social media posts, or brand materials! Good to know The Gemini 2.0 Flash Exp image generation model used in this workflow may have geo-restrictions. The workflow processes one image at a time to ensure quality and avoid rate limiting. Each generated image maintains high consistency with the source prompt and shows minimal AI artifacts. How it works Automated Trigger: A schedule trigger runs every minute to check for new entries in your Google Sheets spreadsheet. Data Retrieval: The workflow fetches rows from your Google Sheets document, specifically looking for entries with "pending" status. AI Prompt Generation: Using Google Gemini, the workflow takes simple titles and transforms them into detailed, artistic prompts for image generation. The AI considers: Specific visual elements, styles, and compositions Natural poses, interactions, and environmental context Lighting conditions and mood settings Brand consistency and visual appeal Proper aspect ratios for different platforms Text Processing: A code node ensures proper JSON formatting by escaping newlines and maintaining clean text structure. Image Generation: Gemini's advanced image generation model creates photorealistic images based on the detailed prompts, ensuring high-quality, consistent results. File Management: Generated images are automatically uploaded to a designated folder in Google Drive with organized naming conventions. Public Sharing: Images are made publicly accessible with read permissions, enabling easy sharing and embedding. Database Update: The workflow completes by updating the Google Sheets with the generated image URL and changing the status from "pending" to "posted", creating a complete audit trail. How to use Setup: Ensure you have the required Google Sheets document with columns for ID, prompt, status, and imageUrl. Configuration: Update the Google Sheets document ID and folder IDs in the respective nodes to match your setup. Activation: The workflow is currently inactive - activate it in n8n to start processing. Data Input: Simply add new rows to your Google Sheets with titles and set status to "pending" - the workflow will automatically process them. Monitoring: Check the Google Sheets for updated status and image URLs to track progress. Requirements Google Gemini API** account for LLM and image generation capabilities Google Drive** for file storage and management Google Sheets** for data input and tracking n8n instance** with proper credentials configured Customizing this workflow Content Variations: Try different visual styles, seasonal themes, or trending designs by modifying the AI prompt in the LangChain agent. Output Formats: Adjust the aspect ratio or image specifications for different platforms (Instagram, Pinterest, TikTok, Facebook ads, etc.). Integration Options: Replace the schedule trigger with webhooks for real-time processing, or add notification nodes for status updates. Batch Processing: Modify the limit node to process multiple items simultaneously, though be mindful of API rate limits. Quality Control: Add additional validation nodes to ensure generated images meet quality standards before uploading. Analytics: Integrate with analytics platforms to track image performance and engagement metrics. This workflow provides a complete solution for automated visual content creation, perfect for businesses and creators looking to scale their visual content production while maintaining high quality and consistency across all marketing materials.
by Yulia
Create a Telegram bot that combines advanced AI functionalities with LangChain nodes and new tools. Nodes as tools and the HTTP request tool are a new n8n feature that extend custom workflow tool and simplify your setup. We used the workflow tool in the previous Telegram template to call the Dalle-3 model. In the new version, we've achieved similar results using the HTTP Request tool and the Telegram node tool instead. The main difference is that Telegram bot becomes more flexible. The LangChain Agent node can decide which tool to use and when. In the previous version, all steps inside the custom workflow tool were executed sequentially. ⚠️ Note that you'd need to select the Tools Agent to work with new tools. Before launching the template, make sure to set up your OpenAI and Telegram credentials. Here’s how the new Telegram bot works: Telegram Trigger listens for new messages in a specified Telegram chat. This node activates the rest of the workflow after receiving a message. AI Tool Agent receives input text, processes it using the OpenAI model and replies to a user. It addresses users by name and sends image links when an image is requested. The OpenAI GPT-4o model generates context-aware responses. You can configure the model parameters or swap this node entirely. Window buffer memory helps maintain context across conversations. It stores the last 10 interactions and ensures that the agent can access previous messages within a session. Conversations from different users are stored in different buffers. The HTTP request tool connects with OpenAI's DALL-E-3 API to generate images based on user prompts. The tool is called when the user asks for an image. Telegram node tool sends generated images back to the user in a Telegram chat. It retrieves the image from the URL returned by the DALL-E-3 model. This does not happen directly, however. The response from the HTTP request tool is first stored in the Agent’s scratchpad (think of it as a short-term memory). In the next iteration, the Agent sends the updated response to the GPT model once again. The GPT model will then create a new tool request to send the image back to the user. To pass the image URL, the tool uses the new $fromAI() expression. Send final reply node sends the final response message created by the agent back to the user on Telegram. Even though the image was already passed to the user, the Agent always stops with the final response that comes from dedicated output. ⚠️ Note, that the Agent may not adhere to the same sequence of actions in 100% of situations. For example, sometimes it could skip sending the file via the Telegram node tool and instead just send an URL in the final reply. If you have a longer series of predefined steps, it may be better to use the “old” custom workflow tool. This template is perfect as a starting point for building AI agentic workflow. Take a look at another agentic Telegram AI template that can handle both text and voice messages.
by Davide
1. How it Works This n8n workflow automates fine-tuning OpenAI models through these key steps: Manual Trigger**: Starts with the "When clicking ‘Test workflow’" event to initiate the process. Downloads a .jsonl file from Google Drive Upload to OpenAI**: Uploads the .jsonl file to OpenAI via the "Upload File" node (with purpose "fine-tune"). Create Fine-tuning Job**: Sends a POST request to the endpoint https://api.openai.com/v1/fine_tuning/jobs with: { "training_file": "{{ $json.id }}", "model": "gpt-4o-mini-2024-07-18" } OpenAI automatically starts training the model based on the provided file. Interaction with the Trained Model**: An "AI Agent" uses the custom model (e.g., ft:gpt-4o-mini-2024-07-18:n3w-italia::XXXX7B) to respond to chat messages. 2. Set up Steps To configure the workflow: Prepare the Training File: Create a .jsonl file following the specified syntax (e.g., travel assistant Q/A examples). Upload it to Google Drive and update the ID in the "Google Drive" node. Configure Credentials: Google Drive: Connect an account via OAuth2 (googleDriveOAuth2Api). OpenAI: Add your API key in the "OpenAI Chat Model" and "Upload File" nodes. Customize the Model: In the "OpenAI Chat Model" node, specify the name of your fine-tuned model (e.g., ft:gpt-4o-mini-...). Update the HTTP request body (Create Fine-tuning Job) if needed (e.g., a different base model). Start the Workflow: Use the manual trigger ("Test workflow") to begin the upload and training process. Test the model via the "Chat Trigger" (chat messages). Integrated Documentation: Follow the instructions in the Sticky Notes to: Properly format the .jsonl (Step 1). Monitor progress on OpenAI (Step 2, link: https://platform.openai.com/finetune/). Note: Ensure the .jsonl file adheres to OpenAI’s required structure and that credentials are valid.
by Polina Medvedieva
Who is this template for This template is for marketers, SEO specialists, or content managers who need to analyze keywords to identify which ones contain references to a specific area or topic, in this case – IT software, services, tools, or apps. Use case Automating the process of scanning a large list of keywords to determine if they reference known IT products or services (like ServiceNow, Salesforce, etc.), and updating a Google Sheet with this classification. This helps in categorizing keywords for targeted SEO campaigns, content creation, or market analysis. How this workflow works Fetches keyword data from a Google Sheet Processes keywords in batches to prevent rate limiting Uses an AI agent (OpenAI) to analyze each keyword and determine if it contains a reference to an IT service/software Updates the original Google Sheet with the results in a "Service?" column Continues processing until all keywords are analyzed Set up steps Connect your Google Sheets account credentials Set the Google Sheet document ID (currently using "Copy of Sheet1 1") Configure the OpenAI API credentials for the AI agent Adjust the batch size (currently 6) if needed based on your API rate limits Ensure the Google Sheet has the required columns: "Number", "Keyword", and "Service?" The AI agent's prompt is highly customizable to match different identification needs. For example, instead of looking for IT software/services, you could modify the prompt to identify: Industry-specific terms (healthcare, finance, education) Geographic references (cities, countries, regions) Product categories (electronics, clothing, food) Competitor brand mentions Here's how you could modify the prompt for different use cases: Copy // For identifying educational content keywords "Check the keyword I provided and define if this keyword relates to educational content, courses, or learning materials and return yes or no." // For identifying local service keywords "Check the keyword I provided and determine if it contains location-specific terms (city names, neighborhoods, regions) that suggest local service intent and return yes or no." // For identifying competitor mentions "Check the keyword I provided and determine if it mentions any of our competitors (CompetitorA, CompetitorB, CompetitorC) and return yes or no." `
by Udit Rawat
This n8n automation is designed to extract, process, and store content from Notion pages into a Pinecone vector store. Here's a breakdown of the workflow: Notion - Page Added Trigger: The automation starts by monitoring for newly added pages in a specific Notion database. It triggers whenever a new page is created, capturing the page's metadata. Notion - Retrieve Page Content: Once triggered, the automation fetches the full content of the newly added Notion page, including blocks like text, images, and videos. Filter Non-Text Content: The next step filters out non-text content (such as images and videos), ensuring only textual content is processed. Summarize - Concatenate Notion's blocks content: The remaining text content is concatenated into a single block of text for easier processing. Token Splitter: The concatenated text is then split into manageable tokens, which are chunks of text that can be used for embedding. Create metadata and load content: Metadata such as the page ID, creation time, and title are added to the content, making it easy to reference and track. Embeddings Google Gemini: The processed text is passed through a Google Gemini model to generate embeddings, which are numerical representations of the text that capture its semantic meaning. Pinecone Vector Store: Finally, the embeddings, along with the content and metadata, are stored in a Pinecone vector store, making it searchable and ready for use in applications like document retrieval or natural language processing tasks. This workflow ensures that every new page added to the Notion database is processed into a format that can be easily searched and used in machine learning applications. The automation runs every minute to capture new data in real-time, providing an up-to-date and searchable vector database of Notion content. Use Case: This automation converts Notion pages into vector embeddings and stores them in Pinecone for enhanced search and AI-driven insights. It’s ideal for teams using Notion for knowledge management, enabling semantic search and context-based content retrieval. For example, employees can easily find relevant information across documents, and data scientists can use AI models to analyze and summarize the content stored in Notion.
by Friedemann Schuetz
Welcome to my AI Social Media Caption Creator Workflow! What this workflow does This workflow automatically creates a social media post caption in an editorial plan in Airtable. It also uses background information on the target group, tonality, etc. stored in Airtable. This workflow has the following sequence: Airtable trigger (scan for new records every minute) Wait 1 Minute so the Airtable record creator has time to write the Briefing field retrieval of Airtable record data AI Agent to write a caption for a social media post. The agent is instructed to use background information stored in Airtable (such as target group, tonality, etc.) to create the post. Format the output and assign it to the correct field in Airtable. Post the caption into Airtable record. Requirements Airtable Database: Documentation AI API access (e.g. via OpenAI, Anthropic, Google or Ollama) Example of an editorial plan in Airtable: Editorial Plan example in Airtable For this workflow you need the Airtable fields "created_at", "Briefing" and "SoMe_Text_AI" Feel free to contact me via LinkedIn, if you have any questions!