What this workflow does
This workflow sends fact emails to subscribers automatically.
The main problem it solves is handling subscriptions, content creation, sending emails, and unsubscriptions without manual work.
The result is personalized facts sent right on time with a matching illustration.
It works by taking sign-ups from a form, storing info in Airtable, making AI generate new facts each time, then sending an email with a fact and image.
Unsubscribe requests are also handled safely.
Who should use this workflow
This workflow fits small services that want to send unique emails to many users about topics they choose.
It helps hobbyists or small businesses who send daily or weekly content newsletters.
Users want to save time and avoid mistakes in sending facts or forgetting subscribers.
This system handles scheduling, content, and email delivery automatically.
Tools and services used
- n8n: Runs and automates the whole workflow.
- Airtable: Stores subscriber data like email, topic, status, interval.
- Gmail API: Sends confirmation and fact emails securely.
- Groq AI API: Produces unique fact texts using language models.
- OpenAI API: Generates child-friendly images based on the factoid.
This combination covers forms, AI generation, database storage, and messaging.
Beginner step-by-step: How to build this in n8n for production
Importing the workflow
- Download the workflow file using the Download button on this page.
- In the n8n editor, click “Import from File” and select the downloaded workflow.
Configuring credentials
- Add your Airtable API Key and set the base and table IDs correctly.
- Connect your Gmail account using OAuth2 in n8n credentials.
- Enter your Groq AI API credentials.
- Provide OpenAI API key in the corresponding node.
Update variables
- Check any emails or URLs in the nodes, update them for your own use.
- If needed, update code or prompt text in Content Generation Agent or Generate Image nodes by copying from the Input below.
Testing and activation
- Run the Subscribe Form trigger by submitting test data.
- Check Airtable to ensure data saving works.
- Send test confirmation emails with the Gmail node.
- Run the Schedule Trigger node manually to check AI fact generation and email sending.
- Once satisfied, activate the workflow in n8n for production use.
If using self hosting n8n, consider this helpful resource: self-host n8n.
Workflow inputs, processing steps, and outputs
Inputs
- User submits subscription via Subscribe Form with email, topic, and frequency.
- User can submit unsubscribe request with subscriber ID and reason.
Processing steps
- Subscribe Form triggers creation or update of subscriber in Airtable with status active.
- Confirmation email sent immediately through Gmail.
- Daily Schedule Trigger wakes workflow at 9 AM to check active subscribers.
- Three Airtable queries select subscribers for daily, weekly, or surprise intervals.
- For surprise subscribers, a random filter chooses who receives email that day.
- For each chosen subscriber, a subworkflow runs:
- LangChain Agent with Groq model generates a unique factoid on their topic, avoiding repeats by Window Buffer Memory.
- OpenAI creates a child-friendly image for the fact.
- Image is resized for email display.
- Email variables set up with HTML including the factoid, image, and unsubscribe link.
- Gmail node sends the personalized email.
- Airtable record updates Last Sent timestamp.
- Unsubscribe Form disables subscribers by setting status inactive.
Outputs
Subscribers get emails with new facts and images on their chosen schedule.
No manual work needed from the user after setup.
Subscription data and sending logs are saved in Airtable for monitoring.
Common edge cases and errors
Invalid Airtable API key or permission error
This happens when the API key is wrong or expired.
Fix by making a new token in Airtable account settings and update n8n credentials.
Emails not sending from Gmail node
Cause is usually expired or missing OAuth2 token for Gmail.
Re-authenticate Gmail OAuth2 and enable access for the app.
AI agent sends repeated or wrong facts
This means the Window Buffer Memory node isn’t saving previous facts correctly.
Check node config and add instructions in AI prompts to generate unique facts.
Customization ideas
- Change Schedule Trigger node time to send emails in different time zones.
- Add more frequency options like monthly or bi-weekly by updating Airtable and search filters.
- Make unsubscribe form richer by adding feedback or confirmation emails.
- Personalize emails more by adding user names or custom greetings in Set Email Vars node.
- Swap Groq or OpenAI with other AI tools if needed to fit budget or improve quality.
Summary of benefits
✓ Saves hours of manual work every week.
✓ Avoids human errors like wrong topics or missed unsubscribes.
✓ Sends fresh, unique facts with matching images regularly.
✓ Gives subscribers a smooth, personalized experience.
→ Workflow runs fully automated with logs for monitoring.
→ Subscription and sending info is always up to date.

