What This Workflow Does
This workflow automatically sends personal fact emails on a schedule based on what each subscriber wants. It solves the problem of handling sign-ups, sending mistakes, and unsubscriptions by automating everything. The user gets unique fact emails with pictures on their favorite topics, sent daily, weekly, or surprise intervals, with easy unsubscribe options.
The system uses n8n to connect forms, Airtable, AI content creation, and Gmail. Subscribers sign up or unsubscribe through simple forms. The workflow runs every morning at 9 to find who should get emails. It makes fresh facts and fitting pictures using AI tools. Then it sends emails and notes down the event in Airtable for tracking.
Tools and Services Used
- n8n: Automation platform running the workflow.
- Airtable: Stores subscriber details and send history.
- Gmail with OAuth2: Sends rich HTML emails securely.
- Groq Chat Model (llama-3.3-70b): Generates fact content.
- Langchain Content Generation Agent: Orchestrates AI prompts and memory.
- Wikipedia node: Retrieves factual info.
- OpenAI API: Creates custom illustrative images for emails.
Inputs, Processing Steps, and Output
Inputs
- Subscriber email, topic, frequency (daily, weekly, surprise), and status entered via n8n form nodes.
- Subscriber records and event logs stored in Airtable with unique IDs.
- Scheduled trigger set at 9 AM daily to start the email sending process.
Processing Steps
- Sign-up/upsert: Form data is added or updated in Airtable with subscriber preferences.
- Unsubscribe: Status changed to inactive securely by subscriber ID so no unwanted emails continue.
- Selection: Scheduled trigger searches Airtable for active subscribers filtered by frequency and last sent date.
- Subworkflow execution: Each subscriber triggers a separate workflow execution to generate and send emails individually.
- Content generation: AI agents use Wikipedia facts and conversation memory to create a fresh, non-repeated factoid tailored to the topic.
- Image generation: AI creates a child-friendly illustration matching the fact, and image is resized for email consistency.
- Email composition and sending: Workflow sets email fields (to, subject, body with HTML, unsubscribe link) and sends through Gmail API.
- Logging: Last sent timestamp is updated in Airtable for correct scheduling and analytics.
Output
- Subscribers receive fact emails personalized to their topics and schedules.
- Airtable has updated records showing subscriber status and send history.
- Emails contain unique AI-made content and images with proper unsubscribe links for safety and trust.
Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Import the Workflow
- Click the Download button on this page to get the workflow JSON file.
- In the n8n editor, select “Import from File” and load the downloaded workflow file.
Step 2: Configure Credentials and Settings
- Add or update API Keys and OAuth2 credentials for Airtable, Gmail, OpenAI, and Groq Chat model in n8n credentials section.
- Check and update Airtable base IDs, table names, and field names if your Airtable has different structure.
- Verify email addresses and sender details in the Gmail nodes.
- Confirm formTrigger node paths for the subscribe and unsubscribe forms if needed.
- Copy and paste any AI prompt or code snippet if provided within the workflow’s content generation nodes.
Step 3: Test the Workflow
- Run the workflow manually to verify all parts execute without errors.
- Use test form data to add a subscriber and check that Airtable updates and confirmation email sends.
- Test the unsubscribe form to confirm status switches correctly.
- Test scheduled trigger manually or adjust for faster runs during testing.
Step 4: Activate the Workflow
- Turn on the workflow to run automatically every day at 9 AM as planned.
- Monitor initial runs for errors via n8n execution logs and Airtable records.
- If your list grows large, adjust the subworkflow concurrency settings to avoid slowdowns or failures.
- Consider self-host n8n for better control and performance if preferred.
Customization Ideas
- Change the email design in the Set Email Vars node’s HTML body for branding or added messages.
- Adjust frequency options in the Subscribe Form node dropdown for sending intervals that suit your audience.
- Swap AI models like GPT-4 or Stable Diffusion to fit budget or style preferences for text or images.
- Add extra subscriber info fields in Airtable and form, then use this info in AI prompts for more personal facts.
- Use multiple languages in fact generation by tweaking AI prompt in Content Generation Agent node.
Troubleshooting
- Problem: “No subscribers found at scheduled execution”
Cause: Airtable filters too strict or no active subscribers.
Solution: Check Airtable base for active entries with correct frequencies. Adjust search node filters accordingly. - Problem: “Emails not sending or rejected by Gmail”
Cause: Gmail OAuth2 invalid or API limits exceeded.
Solution: Re-authenticate Gmail credentials in n8n. Check Gmail sending quota. Run tests before full use. - Problem: “AI content repeats or gives bad facts”
Cause: Buffer memory missing or prompt unclear.
Solution: Review Window Buffer Memory settings and improve AI prompt clarity in Content Generation Agent node.
Pre-Production Checklist
- Make sure Airtable has proper subscribers with correct statuses and intervals.
- Test both subscribe and unsubscribe forms flow and Airtable updates.
- Run manual executions on off-hours to check all nodes work.
- Verify all AI API keys and Gmail OAuth2 tokens are valid.
- Create backups of Airtable data before live operations start.
Summary
✓ Saves time by automating subscriber emails fully.
✓ Delivers unique, relevant facts with images to each subscriber.
✓ Keeps subscriber data updated and handles unsubscribes safely.
→ Enables large scale email sending without manual efforts or errors.
→ Provides a human-touch feel with AI-generated personalized content.
→ Offers easy customization to fit different audiences and needs.
