Animated data flow diagram

AI Factoid Delivery Agent: Automated Content & Image Generation

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Groq OpenAI Airtable Gmail

Overview

Unlock Automated Personalized Content Delivery with this AI Agent\nThis AI Agent empowers you to build and run a fully automated subscription service that delivers engaging factoids with custom images directly to your users' inboxes. Imagine providing daily, weekly, or surprise insights on topics your audience loves, all without manual intervention. \n\nThis n8n workflow acts as an intelligent system that:\n1. Manages user subscriptions (sign-ups and unsubscriptions) via simple n8n forms, storing preferences in Airtable.\n2. On a schedule (daily at 9 AM), identifies active subscribers due for new content based on their chosen frequency (daily, weekly, or a randomized 'surprise').\n3. For each subscriber, the AI Agent:\n * Generates Unique Factoids: Utilizes a powerful Groq-hosted LLM (e.g., Llama 3 70B via Langchain) to craft fresh and relevant factual content based on the user's subscribed topic. It leverages memory to aim for novelty in successive messages.\n * Creates Complementary Images: Employs OpenAI's DALL-E (via a Langchain node) to produce child-friendly illustrations that visually enhance the factoid.\n * Delivers Personalized Emails: Sends the AI-generated text and image through Gmail, complete with an unsubscribe link.\n4. Logs sending activity back to Airtable, allowing you to track engagement and manage your service effectively.\n

Key Features & Benefits

  • AI-Powered Content & Image Generation: Automates the creation of unique textual factoids (Groq/Llama 3) and relevant visuals (OpenAI/DALL-E), saving significant time and resources.
  • Personalized User Experience: Delivers content tailored to individual user preferences for topics and frequency (daily, weekly, surprise).
  • End-to-End Subscription Management: Streamlines the entire lifecycle from user sign-up (n8n Forms) and preference storage (Airtable) to content delivery and unsubscription.
  • Scalable & Efficient: Uses n8n's sub-workflow execution to process multiple subscribers concurrently, ensuring timely delivery even as your user base grows.
  • Context-Aware Content: Incorporates Langchain's memory capabilities to help ensure content variation over time for each user.
  • Knowledge-Augmented AI: The Langchain agent can utilize tools like Wikipedia for richer, more accurate information retrieval during content generation.
  • Simple Deployment: Fully contained within n8n, leveraging familiar tools like Airtable and Gmail for a robust yet manageable setup.

Use Cases

  • B2C E-commerce: Send daily/weekly product tips, usage ideas, or fun facts related to purchased product categories to enhance customer engagement and build brand loyalty.
  • B2B SaaS: Deliver regular industry insights, feature highlights, or 'did-you-know' tips about your software to educate users and improve product adoption.
  • Educational Services: Automate the delivery of learning nuggets, vocabulary words, or historical facts for subscribers of an online course or learning platform.
  • Content Creators/Solopreneurs: Build and manage a niche newsletter service delivering unique AI-generated content and images with minimal manual effort.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • Groq API Key (for Llama 3 70B or other compatible model access).
  • OpenAI API Key (for DALL-E image generation).
  • Airtable account and Personal Access Token.
  • Gmail account with OAuth2 credentials configured in n8n.
  • A copy of the sample Airtable base: https://airtable.com/appL3dptT6ZTSzY9v/shrLukHafy5bwDRfD (or create one based on the workflow's expected schema).

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Set up your Airtable base: Copy the sample base from https://airtable.com/appL3dptT6ZTSzY9v/shrLukHafy5bwDRfD or create a new one. Ensure it has a table (e.g., 'Table 1' or 'Scheduled Emails') with fields like Email (text), Topic (text), Status (single select: active/inactive), Interval (single select: daily/weekly/surprise), Last Sent (DateTime), and id (Airtable Record ID, often a formula like RECORD_ID()).
  4. Configure Airtable nodes ('Search daily', 'Search weekly', 'Search surprise', 'Create Subscriber', 'Update Subscriber', 'Log Last Sent'):
    • Select or create your Airtable Personal Access Token credentials in n8n.
    • Set the correct Base ID and Table ID/Name for each Airtable node.
    • Verify field mappings. Crucially, ensure the 'Log Last Sent' and 'Update Subscriber' nodes correctly use the Airtable record id for updates.
  5. Configure Gmail nodes ('confirmation email1', 'Send Message'):
    • Select or create your Gmail OAuth2 credentials in n8n.
    • If needed, adjust the 'From' email address in the confirmation email node.
  6. Configure AI nodes:
    • 'Groq Chat Model': Enter your Groq API Key and select your preferred model (e.g., llama-3.3-70b-versatile).
    • 'Generate Image' (OpenAI Langchain node): Enter your OpenAI API Key. The node is pre-configured for image generation.
  7. Update Form Trigger URLs and Unsubscribe Link:
    • After importing, your 'Subscribe Form' and 'Unsubscribe Form' trigger nodes will have unique webhook URLs. These are your public form links (e.g., https://<YOUR_N8N_INSTANCE_URL>/form/free-factoids-subscribe).
    • In the 'Set Email Vars' node, critically update the unsubscribe_link expression with your n8n public URL for the unsubscribe form: https://<YOUR_N8N_INSTANCE_URL>/form/free-factoids-unsubscribe?ID={{ $('Execute Workflow Trigger').first().json.id }}. Replace <YOUR_N8N_INSTANCE_URL> with your actual n8n instance's public URL.
  8. Review the 'Schedule Trigger' node. It defaults to running daily at 9 AM. Adjust the time or frequency as needed.
  9. Activate the workflow. Test the subscription form, then the unsubscribe form. Manually run the schedule once or wait for it to trigger to test the email delivery.

Tags:

AI AgentContent GenerationImage GenerationEmail AutomationGroqOpenAIAirtablePersonalizationSubscription Management

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation