Back to Catalog

Create personalized B2B outreach emails with Tavily Research & OpenRouter LLM

Haruki KuwaiHaruki Kuwai
283 views
2/3/2026
Official Page

🧠 About this workflow

This workflow automatically generates personalized B2B outreach email messages by combining AI-based company research and text generation.
It’s designed to help sales and marketing professionals automate the creation of tailored cold emails for prospects.


⚙️ How it works

  1. Get rows from Google Sheets — Retrieves companies marked as “ready” for outreach.
  2. Loop Over Items — Processes each company individually.
  3. Company Research (LangChain Agent) — Uses the Tavily search tool to collect key company insights such as overview, offerings, and recent news.
  4. Generate Outreach Message (LLM Chain) — Drafts a professional, concise, and fully personalized email body in English using the AI training context from YOUR_COMPANY_NAME.
    This example uses an AI training and automation service context, but you can easily modify the prompt to fit your own company’s products, services, or industry.
  5. Add to Google Sheets — Writes the generated messages back into the sheet.
  6. (Optional) Add to Instantly.ai — Sends the finalized lead data to your Instantly campaign for cold email distribution.

👥Use Cases

💼Sales & CRM:Automatically build and update your client database from received business cards

🏢Back Office & Admin: Digitize incoming cards for unified company records

📧Marketing Teams: Collect and manage leads efficiently

📚 AI / OCR Research: Build structured datasets for training AI models or internal automation


🧩 Troubleshooting

If the workflow does not generate emails or data fails to appear in Google Sheets, please check the following:

  1. Google Sheets credentials — Ensure that the connected account has edit permissions and the document ID and sheet name are correctly set.
  2. API keys — Verify that your OpenRouter and Tavily API credentials are valid and not expired.
  3. Rate limits — Tavily and OpenRouter may throttle requests when processing multiple records. Try lowering the batch size in the “Limit” node.
  4. Empty company background — If the “Company Research” node returns no output, make sure the input company name is correct and includes sufficient context (e.g., full company name, not abbreviation).
  5. LLM output format — Ensure the “Generate Outreach Message” node is set to return plain text, not JSON or markdown.
  6. Instantly.ai integration (optional) — If leads are not added, confirm that your API key and campaign ID are valid, and that the node is not disabled.

If the issue persists, enable “Always Output Data” in key nodes (such as Company Research and Generate Outreach Message) to debug intermediate results.
You can also use the Execution Log to inspect where the flow stops or returns an empty output.


⚠️ Disclaimer

This workflow uses AI language models and third-party APIs (OpenRouter, Tavily).
Ensure that you add your own API credentials securely and verify all AI-generated content before sending emails.

Create Personalized B2B Outreach Emails with Tavily Research & OpenRouter LLM

This n8n workflow automates the creation of highly personalized B2B outreach emails by leveraging Tavily Research for company-specific insights and an OpenRouter Large Language Model (LLM) for crafting the email content. It streamlines the process of generating tailored emails from a list of prospects in a Google Sheet.

What it does

  1. Triggers Manually: The workflow is initiated manually when you click 'Execute workflow'.
  2. Reads Prospect Data: It reads prospect information (e.g., company name, contact person) from a specified Google Sheet.
  3. Limits Processing (Optional): A "Limit" node is included, which can be configured to process only a subset of the data for testing or partial runs.
  4. Loops Through Prospects: For each prospect, the workflow performs the following steps:
    • Researches Company: An AI Agent (LangChain) uses Tavily Search to gather relevant, up-to-date information about the target company.
    • Generates Email Draft: A Basic LLM Chain, powered by an OpenRouter Chat Model, uses the gathered research and a predefined prompt to generate a personalized B2B outreach email.
    • Parses Output: A Structured Output Parser extracts the generated email content in a structured format (e.g., JSON).
  5. Writes Emails Back to Google Sheets: The generated personalized emails are written back to the original Google Sheet, or a new one, alongside the prospect data.

Prerequisites/Requirements

  • n8n Instance: A running n8n instance.
  • Google Sheets Account: With a spreadsheet containing your prospect data (e.g., company names, contact names).
  • Tavily API Key: For the AI Agent to perform web research.
  • OpenRouter API Key: To access the Large Language Model for email generation.

Setup/Usage

  1. Import the Workflow:
    • Copy the provided JSON code.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three dots next to "New workflow" and select "Import from JSON".
    • Paste the JSON and click "Import".
  2. Configure Credentials:
    • Google Sheets: Set up your Google Sheets credential to allow n8n to read from and write to your spreadsheet.
    • Tavily: Configure a new "Tavily Search API" credential with your Tavily API Key.
    • OpenRouter: Configure a new "OpenRouter API" credential with your OpenRouter API Key.
  3. Update Google Sheets Node (Node 18):
    • Select the Google Sheets node.
    • Choose your Google Sheets credential.
    • Specify the Spreadsheet ID and Sheet Name where your prospect data is located.
    • Ensure the "Operation" is set to "Read" initially.
    • Later, you'll configure a second Google Sheets node (or modify this one) to "Write" the generated emails back.
  4. Configure AI Agent (Node 1119):
    • Select the "AI Agent" node.
    • Ensure the "Tool" is set to "Tavily Search" and select your Tavily credential.
    • Adjust the "Agent Prompt" to guide the research effectively.
  5. Configure OpenRouter Chat Model (Node 1281):
    • Select the "OpenRouter Chat Model" node.
    • Choose your OpenRouter credential.
    • Select the desired LLM model (e.g., mistralai/mistral-7b-instruct:free).
    • Adjust "Temperature" and other parameters as needed.
  6. Configure Basic LLM Chain (Node 1123):
    • Select the "Basic LLM Chain" node.
    • Craft the "Prompt Template" to instruct the LLM on how to generate the personalized email, incorporating data from the Google Sheet and the research results.
      • Example variables to use: {{ $json.companyName }}, {{ $json.contactName }}, {{ $json.researchResults }}.
  7. Configure Structured Output Parser (Node 1179):
    • Define the "Output Schema" to specify the expected JSON structure for the generated email (e.g., { "subject": "string", "body": "string" }).
  8. Add a Google Sheets Write Node (Not explicitly in JSON, but implied for saving results):
    • After the "Structured Output Parser" node, add another "Google Sheets" node.
    • Configure it to "Append" or "Update" rows in your spreadsheet, mapping the parsed email subject and body to appropriate columns.
  9. Test and Activate:
    • Run the workflow in "Test" mode to ensure it's functioning as expected and generating correct output.
    • Once satisfied, activate the workflow.
  10. Execute: Click "Execute workflow" to run the process and generate personalized emails for your prospects.

This workflow provides a powerful foundation for automating your B2B outreach, allowing you to scale personalization efforts efficiently.

Related Templates

Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets

This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.

Ranjan DailataBy Ranjan Dailata
161

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353