by LukaszB
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant messages in their Gmail inbox — from cold offers to spammy promotions — and want to automatically filter and delete them using AI. Its main purpose is to scan new emails with the help of OpenAI, classify their content, and automatically delete those considered marketing (OFFER) or junk (SPAM). The result is a cleaner inbox without the need to manually sift through low-value messages. The classification logic uses a detailed system prompt with practical examples, so even complex or borderline messages are categorized accurately. Important emails — such as payment confirmations, shipping updates, or genuine business inquiries — remain untouched. This helps maintain a professional inbox with only valuable and relevant communication. The entire process runs automatically in the background and can be customized further — for example, to archive instead of delete, or log deleted emails for review. How it works When triggered (every hour), the workflow fetches new Gmail messages using the Gmail Trigger node. Each message is passed to an AI classifier powered by OpenAI, which reads the message body (email snippet) and returns one of three labels: SPAM: Obvious junk messages, scams, or low-effort bulk messages OFFER: Cold outreach, discount promotions, cart reminders, or generic advertising IMPORTANT: Valuable information for the user, even if commercial (e.g., invoices, order updates, personal inquiries) The workflow then routes the result through an IF node. If the message is marked as SPAM or OFFER, it is immediately deleted from Gmail via the Gmail Delete node. Emails marked as IMPORTANT are ignored and remain in the inbox. The classification is entirely AI-driven based on message content — sender address, headers, or metadata are not used. How to set up To get started, simply connect two credentials: A Gmail account using OAuth2 (via the Gmail Trigger and Gmail Delete nodes) An OpenAI API key (used by the AI classifier node) No advanced setup is needed beyond these two connections. Optionally, you can review or modify the system prompt used for classification — it’s available inside the workflow’s LangChain AI Agent node. The prompt is in English, so it’s recommended to use this workflow with English-language emails for best results. By default, the workflow deletes matching emails immediately. If you prefer safer testing, you can modify the Gmail node to archive, label, or log emails instead of deleting them. The full workflow takes around 5–10 minutes to configure and includes a sticky note with additional instructions and warnings.
by Niklas Hatje
Use Case In most companies, employees have a lot of great ideas. That was the same for us at n8n. We wanted to make it as easy as possible to allow everyone to add their ideas to some formatted database - it should be somewhere where everyone is all the time and could add a new idea without much extra effort. Since we're using Slack, this seemed to be the perfect place to easily add ideas and collect them in Notion. What this workflow does This workflow waits for a webhook call within Slack, that gets fired when users use the /idea command on a bot that you will create as part of this template. It then checks the command, adds the idea to Notion, and notifies the user about the newly added idea as you can see below: Creating your Slack bot Visit https://api.slack.com/apps, click on New App and choose a name and workspace. Click on OAuth & Permissions and scroll down to Scopes -> Bot token Scopes Add the chat:write scope Head over to Slash Commands and click on Create New Command Use /idea as the command Copy the test URL from the Webhook node into Request URL Add whatever feels best to the description and usage hint Go to Install app and click install Setup Add a Database in Notion with the columns Name and Creator Add your Notion credentials and add the integration to your Notion page. Fill the setup node below Create your Slack app (see other sticky) Click Test workflow and use the /idea comment in Slack Activate the workflow and exchange the Request URL with the production URL from the webhook How to adjust it to your needs You can adjust the table in Notion and for example, add different types of ideas or areas that they impact You might wanna add different templates in Notion to make it easier for users to fill their ideas with details Rename the Slack command as it works best for you How to enhance this workflow At n8n we use this workflow in combination with some others. E.g. we have the following things on top: We additionally have a /bug Slack command that adds a new bug to Linear. Here we're using AI to classify the bugs and move it to the right team. (see this template and this template) We also added other types, like /pain to be less solution-driven To make it easier for everyone to give input, we added a Votes column that allows everyone to vote on ideas/pain points in the list We're also running a workflow once a week that highlights the most popular new ideas and the most active voters (see here)
by Daniel Nolde
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot of different LLM models and providers and change models on the fly in an agentic workflow. For prior n8n versions, there's a workaround to make OpenRouter accessible, by using the OpenAI node with a OpenRouter-specific BaseURL. This trivial workflow demonstrates this for version before 1.78, so that you can use different LLM model dynamically with the available n8n nodes for OpenAI LLM and OpenAI credentials. What you can do: Use any of the OpenRouter models Have the model even dynamically configured or changing (by some external config, some rule, or some specific chat message) Setup steps: Import the workflow Ensure you have registered and account, purchased some credits and created and API key for OpenRouter.ai Configure the "OpenRouter" credentials with your own credentials, using an OpenAI type credential, but making sure in the credential's config form its "Base URL" is set to https://openrouter.ai/api/v1 so OpenRouter is used instead of OpenAI. Open the "Settings" node and change the model value to any valid model id from the OpenRouter models list or even have the model property set dynamically
by Fahmi Oktafian
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automate keyword research using Google Sheets, Google Suggest, and Google Custom Search. Ideal for those building content pipelines, researching trends, or powering AI content generation with fresh search data. What it does This workflow automates the process of discovering a new keyword daily. It: Rotates through a keyword list in Google Sheets Selects one keyword per day Fetches autocomplete suggestions from Google Suggest Queries the Google Custom Search API for top results Returns structured JSON containing titles, links, and snippets How it works Manual Trigger – Initiates workflow manually Google Sheets – Reads keywords from a sheet (column: Title or Keyword) Code Node – Selects a daily keyword based on the number of days since July 4, 2025 Set Node – Saves the selected keyword as seed_keyword HTTP Request – Fetches autocomplete suggestions from Google Suggest API Function Node – Parses suggestions into usable items HTTP Request – Calls Google Custom Search API for each suggestion Code Node – Formats the search results into JSON How to set up Connect your Google Sheets OAuth2 credentials in n8n Use credential variables for Google Custom Search (⚠️ do not hardcode your key and cx) Replace the sample sheet ID with your own Run the workflow manually or schedule it daily Requirements Google account Enabled Custom Search JSON API on Google Cloud Google Sheet with a column labeled Title or Keyword n8n instance (cloud or self-hosted) How to customize Change the start date to control the keyword rotation cycle Randomize keyword selection instead of rotating Enrich results using tools like Ahrefs or SEMrush Push final output to Telegram, Notion, Slack, or Airtable Add filtering logic based on CPC, volume, or duplicates Example Sheet 📄 Click Here to access the example Google Sheet Sheet must contain a column Title or Keyword in the first row: Title teknologi AI berita viral tren startup
by bangank36
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup Your Workflows to GitHub template by allowing users to seamlessly restore previously saved workflows. How It Works The workflow fetches workflows stored in a GitHub repository and imports them into your n8n instance. Setup Instructions To configure the workflow, update the Globals node with the following values: repo.owner** – Your GitHub username repo.name** – The name of your GitHub repository storing the workflows repo.path** – The folder path within the repository where workflows are stored For example, if your GitHub username is john-doe, your repository is named n8n-backups, and workflows are stored in a workflows/ folder, you would set: repo.owner → john-doe repo.name → n8n-backups repo.path → workflows/ Required Credentials GitHub API** – Access to your repository n8n API** – To import workflows into your n8n instance Who Is This For? This template is ideal for users who want to restore their workflows from GitHub backups, ensuring easy migration and recovery in case of data loss. Check out my other templates: 👉 My n8n Templates
by Wyeth
Encode JSON to Base64 String in n8n This example workflow demonstrates how to convert a JSON object into a base64-encoded string using n8n’s built-in file processing capabilities. This is a common requirement when working with APIs, webhooks, or SaaS integrations that expect payloads to be base64-encoded. > Tip: The three green-highlighted nodes (Stringify → Convert to File → Extract from File) can be wrapped in a Subworkflow to create a reusable Base64 encoder in your own projects. 🔧 Requirements Any running n8n instance (local or cloud) No credentials or external services required What This Workflow Does Generates example JSON data Converts the JSON to a string Saves the string as a binary file Extracts the file’s contents as a base64 string Outputs the base64 string on the final node Step-by-Step Setup Manual Trigger Start the workflow using the Manual Execution node. This is useful for testing and development. Create JSON Data The Create Json Data node uses raw mode to construct a sample object with all major JSON types: strings, numbers, booleans, nulls, arrays, nested objects, etc. Convert to String The Convert to String node uses the expression ={{ JSON.stringify($json) }} to flatten the object into a single string field named json_text. Convert to File The Convert to File node takes the json_text value and saves it to a UTF-8 encoded binary file in the property encoded_text. Extract from File This node takes the binary file and extracts its contents as a base64-encoded string. The result is saved in the base64_text field. Customization Tips Replace the sample JSON in the Create Json Data node with your own payload structure. To make this reusable, extract the three core nodes into a Subworkflow or wrap them in a custom Function. Use the base64_text output field to post to APIs, store in databases, or include in webhook responses.
by Tenkay
This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and returns: Items common to both lists (based on the key) Items only in List A Items only in List B How it works: Accepts a JSON input containing: listA: the first list of items listB: the second list of items key: the field name to use for comparison Performs a field-based comparison using the specified key Returns a structured output: common: items with matching keys (only one version retained) onlyInA: items found only in List A onlyInB: items found only in List B Example Input: { "key": "email", "listA": [ { "email": "alice@example.com", "name": "Alice" }, { "email": "bob@example.com", "name": "Bob" } ], "listB": [ { "email": "bob@example.com", "name": "Bobby" }, { "email": "carol@example.com", "name": "Carol" } ] } Output: common: [ { "email": "bob@example.com", "name": "Bob" } ] onlyInA: [ { "email": "alice@example.com", "name": "Alice" } ] onlyInB: [ { "email": "carol@example.com", "name": "Carol" } ] Use Cases: Deduplicate data between two sources Find overlapping records Identify new or missing entries across systems This workflow is useful for internal data auditing, list reconciliation, transaction reconciliation, or pre-processing sync jobs.
by Ria
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist within workflow executions. https://docs.n8n.io/code/cookbook/builtin/get-workflow-static-data/ This can be useful for example when working with access tokens that expire after a certain time period. Using staticData we can keep a record of that access token and the expiry time and build our workflow logic around it. Important Static Data only persists across production executions, i.e. triggered by Webhooks or Schedule Triggers (not manual executions!) For this the workflow will have to be activated. Setup configure HTTP Request node to fetch access token from your API (optional) activate workflow test the workflow with the webhook production link you can check the population of the static data in the single executions Feedback If you found this useful or want to report some missing information - I'd be happy to hear from you at ria@n8n.io
by Marcelo Abreu
Who is this workflow for? If you're using Meta Ads to generate new leads to your sales pipeline, this workflow is for you! 🙌🏻 What this workflow does Triggers every time you have a new calendar event on a chosen Google Acount Filter only events with the same name of your "Schedule a demo" event Formats and send event to Meta Conversion API What events can I send? Any event you'd like! It's preconfigured with the "Schedule" event, but you can change to "Purchase", "InitiateCheckout", "Lead" and custom events. Setup Guide Connect Google OAuth2 to n8n Get your PIXEL ID and Access Token from Meta Set your configuration node with Pixel ID, Access Token, source_url and event_name Requirements Meta Access Token + Pixel ID (via Meta Conversion API): Documentation Google Access (via OAuth2): Documentation This free template was created by pdforge. Feel free to contact us via the founder Linkedin, if you have any questions! 👋🏻
by Nskha
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It utilizes the public blockchain database of TronScan, requiring no API authentication, to periodically check and process transaction data. This workflow is ideal for users who need an automated solution to track their TRC20 wallet transactions. Features Automated Tracking**: Executes every 15 minutes to capture new transactions. Customizable Filters**: Tailors the tracking based on specific parameters like transaction time and wallet addresses. Data Aggregation**: Compiles transaction data into a single, structured list. Formatted Outputs**: Presents transaction data in an organized and comprehensible format. Requirements N8N (self-hosted or cloud version) setup and operational. Basic understanding of N8N workflows and nodes. Setup and Configuration Import Workflow: Load the provided JSON workflow into your N8N instance. Configure Edit Fields Node: Enter your TRC20 wallet address in the 'Your Wallet Address' field. Adjust 'Number of transactions to retrieve per request' if necessary. (Default one set to 20 which is recommanded) TronScan Data Access: The workflow accesses TronScan's public blockchain data, so no additional configuration is required for API access. Schedule Trigger Node: Defaulted to trigger every 15 minutes. Modify as per your requirements. Test the Workflow: Execute the workflow manually to ensure everything is operating correctly. How it Works Schedule Trigger: Initiates the workflow at predetermined intervals. Edit Fields: Sets up the wallet address and transaction retrieval count. TronScan Data Retrieval: Gathers transaction data from the TRC20 wallet using TronScan's public database. Split Out & Filter: Processes and filters the transaction data. Final Results: Organizes and formats the required transaction data for review. Aggregate: Consolidates all records (items) into a one comprehensive list (item). Customization Modify the filter conditions and fields to suit your tracking needs. (for example you can higher or lower the number of time to filter or IN / OUT transactions - Default is 15m/IN) Adjust the schedule trigger frequency according to your preference (default is 15m). Best Practices Regularly test the workflow to ensure consistent performance. Stay updated with any changes to the structure of TronScan's public data that might affect the workflow. Contributing Your feedback and contributions are greatly appreciated. Feel free to adapt, modify, and share enhancements with the n8n community.
by Niklas Hatje
Use Case This workflow is a slight variation of a workflow we're using at n8n. In most companies, employees have a lot of great ideas. That was the same for us at n8n. We wanted to make it as easy as possible to allow everyone to add their ideas to some formatted database - it should be somewhere where everyone is all the time and could add a new idea without much extra effort. Since we're using Slack, this seemed to be the perfect place to easily add ideas. In this example, we're adding the ideas to Google Sheets instead of Notion, like we do. What this workflow does This workflow waits for a webhook call within Slack, that gets fired when users use the /idea command on a bot that you will create as part of this template. It then checks the command, adds the idea to Google Sheets and notifies the user about the newly added idea as you can see below: Creating your Slack bot Visit https://api.slack.com/apps, click on New App and choose a name and workspace. Click on OAuth & Permissions and scroll down to Scopes -> Bot token Scopes Add the chat:write scope Head over to Slash Commands and click on Create New Command Use /idea as the command Copy the test URL from the Webhook node into Request URL Add whatever feels best to the description and usage hint Go to Install app and click install Setup Create a Google Sheets document with the columns Name and Creator Add your Google credentials Fill the Set me up node. Create your Slack app (see other sticky) Click Test workflow and use the /idea comment in Slack Activate the workflow and exchange the Request URL with the production URL from the webhook How to adjust it to your needs You can adjust the table in Google Sheets and for example, add different types of ideas or areas that they impact Rename the Slack command as it works best for you How to enhance this workflow At n8n we use this workflow in combination with some others. E.g. we have the following things on top: We additionally have a /bug Slack command that adds a new bug to Linear. Here we're using AI to classify the bugs and move it to the right team. (Bug command workflow and Ai Classifier workflow) We also added other types, like /pain to be less solution-driven To make it easier for everyone to give input, we added a Votes column that allows everyone to vote on ideas/pain points in the list We're also running a workflow once a week that highlights the most popular new ideas and the most active voters
by Guillaume Duvernay
Description This template provides a simple and powerful backend for adding speech-to-text capabilities to any application. It creates a dedicated webhook that receives an audio file, transcribes it using OpenAI's gpt-4o-mini model, and returns the clean text. To help you get started immediately, you'll find a complete, ready-to-use HTML code example right inside the workflow in a sticky note. This code creates a functional recording interface you can use for testing or as a foundation for your own design. Who is this for? Developers:** Quickly add a transcription feature to your application by calling this webhook from your existing frontend or backend code. No-code/Low-code builders:** Embed a functional audio recorder and transcription service into your projects by using the example code found inside the workflow. API enthusiasts:** A lean, practical example of how to use n8n to wrap a service like OpenAI into your own secure and scalable API endpoint. What problem does this solve? Provides a ready-made API:** Instantly gives you a secure webhook to handle audio file uploads and transcription processing without any server setup. Decouples frontend from backend:** Your application only needs to know about one simple webhook URL, allowing you to change the backend logic in n8n without touching your app's code. Offers a clear implementation pattern:** The included example code provides a working demonstration of how to send an audio file from a browser and handle the response—a pattern you can replicate in any framework. How it works This solution works by defining a clear API contract between your application (the client) and the n8n workflow (the backend). The client-side technique: Your application's interface records or selects an audio file. It then makes a POST request to the n8n webhook URL, sending the audio file as multipart/form-data. It waits for the response from the webhook, parses the JSON body, and extracts the value of the Transcript key. You can see this exact pattern in action in the example code provided in the workflow's sticky note. The n8n workflow (backend): The Webhook node catches the incoming POST request and grabs the audio file. The HTTP Request node sends this file to the OpenAI API. The Set node isolates the transcript text from the API's response. The Respond to Webhook node sends a clean JSON object ({"Transcript": "your text here..."}) back to your application. Setup Configure the n8n workflow: In the Transcribe with OpenAI node, add your OpenAI API credentials. Activate the workflow to enable the endpoint. Click the "Copy" button on the Webhook node to get your unique Production Webhook URL. Integrate with the frontend: Inside the workflow, find the sticky note labeled "Example Frontend Code Below". Copy the complete HTML from the note below it. ⚠️ Important: In the code you just copied, find the line const WEBHOOK_URL = 'YOUR WEBHOOK URL'; and replace the placeholder with the Production Webhook URL from n8n. Save the code as an HTML file and open it in your browser to test. Taking it further Save transcripts:* Add an *Airtable* or *Google Sheets** node to log every transcript that comes through the workflow. Error handling:** Enhance the workflow to catch potential errors from the OpenAI API and respond with a clear error message. Analyze the transcript:* Add a *Language Model** node after the transcription step to summarize the text, classify its sentiment, or extract key entities before sending the response.