Automate Personalized Email Campaigns with n8n, Twitter & LinkedIn

Manually checking social profiles and crafting emails wastes hours weekly. This n8n workflow fetches LinkedIn and Twitter posts, uses AI to generate tailored emails, and automatically sends them, saving time and boosting lead engagement.
googleSheetsTrigger
httpRequest
lmChatOpenAi
+8
Workflow Identifier: 1336
NODES in Use: Google Sheets Trigger, If, Set, HTTP Request, Code, OpenAI Chat Model, Structured Output Parser, LangChain Chain LLM, Email Send, Google Sheets, Sticky Note
Automate social media emails with n8n and OpenAI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow takes lead info from a Google Sheet and fetches their recent LinkedIn posts and tweets.
It then uses AI to find topics the leads care about and writes a custom email for each.
The workflow sends the email and marks the lead as done to avoid duplicates.
This saves many hours and makes outreach more personal and effective.


Tools and Services Used


How This Workflow Works: Inputs, Processing, and Output

Inputs

  • Lead data from Google Sheets: LinkedIn URL, Twitter handle, email, and status.

Processing Steps

  • Trigger runs when sheet shows new leads.
  • Filter out leads already marked as done.
  • Retrieve the user ID from Twitter using the handle via RapidAPI.
  • Get up to 10 recent tweets for each lead.
  • Fetch up to 10 LinkedIn posts for each lead.
  • Use code nodes to extract and limit tweets and LinkedIn posts.
  • Send this social data and company info to OpenAI GPT-4o chat model.
  • Generate a subject line and personalized HTML email body.
  • Send the created email to the lead with a CC to the user.
  • Update the lead row in Google Sheets to mark as done.

Output

  • Personalized outreach emails sent automatically.
  • Google Sheet rows updated to prevent repeat emailing.

Beginner Step-by-Step: How to Use This Workflow in Production

1. Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you want to use this.
  3. Use the Import from File option to load the workflow.

2. Configure Credentials and Settings

  1. Add API Keys: Google Sheets, RapidAPI, and OpenAI in the credential manager.
  2. Set your email SMTP details for the Email Send node.
  3. Update Google Sheet IDs, sheet names, email addresses, or any other IDs if you copied a sample.
  4. Copy and paste any prompt texts or code snippets from inside the workflow nodes if needed.

3. Test the Workflow

  1. Run a manual test using sample data in your Google Sheet.
  2. Verify if emails are sent and Sheets updated.

4. Activate for Production

  1. Turn on the Google Sheets Trigger node by activating the workflow.
  2. Keep monitoring in n8n for any errors or usage limits.

Use self-host n8n if planning to run this workflow on your own server for more control.


Customization Ideas


Troubleshooting Common Issues

  • No tweets found: Check Twitter handle accuracy and API quota on RapidAPI.
  • No LinkedIn posts: Verify full LinkedIn URL and RapidAPI credentials.
  • AI parsing errors: Refine JSON schema in parser node and adjust prompt.

Pre-Production Checklist

  • Confirm Google Sheets has valid data and “done” status column works correctly.
  • Test API keys and ensure correct scopes and call limits.
  • Run test leads through to check email delivery and sheet updates.
  • Backup the Google Sheet and exported workflow files.

Summary

✓ Saves 4-5 hours every week of manual social research.
✓ Sends personalized emails with relevant social media content.
✓ Updates lead status automatically to prevent repeats.
✓ Improves email response rates and sales pipeline quality.
→ You get an easy-to-use automation inside n8n.
→ You connect social profiles, AI, and email without coding.


Automate social media emails with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

No, the workflow needs RapidAPI Fresh LinkedIn and Twitter APIs to fetch social posts.
Verify SMTP email settings and credentials in the Email Send node are correct.
The workflow marks leads as done in Google Sheets. Make sure the done column updates properly.
Yes, add HTTP Request nodes for other social APIs and update AI prompts accordingly.
Author
Written By
Ritu Sanjali

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.