An n8n workflow that creates an AI-powered parenting advice system using multiple language models, PDF generation, and automated email delivery.
Dr. Dovid Berry is an AI parenting research assistant that provides thoroughly researched, evidence-based parenting advice. The system accepts questions through a web form, processes them through AI models, generates PDF reports, and delivers personalized responses via email.
The workflow consists of 8 interconnected nodes:
- Webhook - Receives form submissions from Tally.so
- Code Node - Processes form data and extracts recipient information
- AI Agent - Generates structured parenting advice using language models
- OpenRouter Chat Model - Primary AI model (Claude Sonnet 4)
- Google Gemini Chat Model - Alternative AI model
- Structured Output Parser - Ensures consistent JSON response format
- HTTP Request (PDFShift) - Converts HTML responses to PDF
- Google Drive Upload - Saves PDFs to cloud storage
- Gmail Send - Delivers formatted email responses
- Uses Claude Sonnet 4 via OpenRouter as the primary model
- Google Gemini 2.0 Flash as backup/alternative
- Structured output ensures consistent formatting
- Contextual advice for parents in Jerusalem, Israel
- PDFShift API converts HTML to professional PDFs
- Automatic file naming based on question summaries
- Print-optimized formatting
- Email templates with professional styling
- Google Drive integration for file storage
- Multiple recipient support
- Branded email design with Dr. Dovid Berry persona
- Tally.so form for question submission
- Dynamic recipient selection
- Question preprocessing and validation
- Primary:
anthropic/claude-sonnet-4(via OpenRouter) - Secondary:
models/gemini-2.0-flash(via Google AI) - Structured JSON output with predefined schema
- Service: PDFShift API
- Format: A4, portrait orientation
- Features: Print optimization, CSS styling
- Platform: Google Drive
- Organization: Automatic folder structure
- Access: Shareable links in email responses
- Provider: Gmail API
- Template: Custom HTML with inline CSS
- Features: Responsive design, branded styling
The AI generates responses in this JSON format:
{
"summary_file_safe": "question-topic-in-lowercase-with-hyphens",
"summary_human_readable": "Question Topic In Title Case",
"summarised_prompt": "Brief summary of the user's question",
"html_response": "<p>Email-ready HTML content</p>",
"html_full_document": "<!DOCTYPE html>...Complete HTML document..."
}- OpenRouter API - For Claude Sonnet 4 access
- Google AI API - For Gemini model access
- PDFShift API - For PDF generation
- Google Drive OAuth - For file storage
- Gmail OAuth - For email sending
- Tally.so form with specific field structure:
- "Your question for Dr Dovid Berry" (text field)
- "Send answer to" (multiple choice for recipients)
- n8n webhook endpoint configured to receive Tally.so submissions
- POST method with JSON payload processing
├── config.json # n8n workflow configuration
├── email-template.html # Email template for responses
├── images/
│ └── 1.png # Workflow diagram
└── README.md # This documentation
The email template (email-template.html) features:
- Professional medical-style design
- Responsive layout with inline CSS
- Dr. Dovid Berry branding
- Direct links to Google Drive files
- Call-to-action for additional questions
- Form Submission → Webhook receives Tally.so data
- Data Processing → Code node extracts question and recipients
- AI Processing → Agent generates structured response using Claude/Gemini
- PDF Creation → HTML converted to PDF via PDFShift
- File Storage → PDF uploaded to Google Drive
- Email Delivery → Formatted email sent with PDF link
Modify the system message in the AI Agent node to adjust:
- Response tone and style
- Expertise focus areas
- Output format requirements
- Regional context
Customize email-template.html for:
- Branding and colors
- Layout and typography
- Additional content sections
- Call-to-action buttons
Adjust PDFShift parameters for:
- Page size and orientation
- Print optimization
- Margin settings
- CSS styling
- Deploy the n8n workflow using
config.json - Configure all required credentials and API keys
- Set up the Tally.so form with proper field mapping
- Test the webhook endpoint
- Customize email template and AI prompts as needed
- n8n - Workflow automation platform
- OpenRouter - AI model access
- Google Cloud APIs - Drive and Gmail integration
- PDFShift - PDF generation service
- Tally.so - Form builder platform
