AI-Powered Meal Plan Generator: Automated Form Submission to PDF Delivery

Aug 20, 2025·6 Minutes Read

What You'll Have When Done

A fully automated system that monitors your Google Sheets for new form submissions, generates personalized 7-day meal plans using AI, creates professional PDF documents, and delivers them directly to your clients via email.

Prerequisites

Before you begin, make sure you have:

  • A PDF.co API Key (Get yours here)
  • OpenAI API credentials configured in N8N (or N8N free OpenAI credits)
  • Google Sheets OAuth2 credentials configured in N8N
  • Google Drive OAuth2 credentials configured in N8N (for file storage)
  • An N8N instance (cloud or self-hosted)
  • A Google Sheet with columns for client intake information
  • An HTML meal plan template uploaded to PDF.co
  • SMTP credentials for email delivery (Gmail app password)

Quick Start Options

Option A: I Want It Working Now

  1. Import this workflow templateDownload JSON File
  2. Connect your Google accounts (Sheets, Drive) in N8N
  3. Add your PDF.co API key and template ID
  4. Configure your OpenAI API credentials
  5. Set up your SMTP email credentials
  6. Create your Google Sheet with the required columns
  7. Test with a sample client request
  8. Activate and let it run

Option B: I Want to Build It Step-by-Step

Follow the 6-step guide below to create the automation from scratch.

What This Automation Does (Overview)

  1. Monitors your Google Sheet for new meal plan requests
  2. Processes client intake information
  3. Generates personalized 7-day meal plans using AI
  4. Creates professional PDF documents using custom HTML templates
  5. Stores PDFs in Google Drive for backup
  6. Delivers meal plans directly to clients via email

Real Example: Client fills out intake form → AI creates custom pescatarian meal plan with grocery list → Professional PDF generated → Delivered to client's email within minutes. View Samples Here.

Step-by-Step Build Guide

Step 1: Monitor for New Client Requests

Node: Google Sheets Trigger

Settings:

  • Document From List: Select your meal plan intake spreadsheet
  • Sheet: Choose the sheet containing client requests (usually Sheet1)
  • Trigger On: Row Added

What This Does: Automatically detects when a new client submits their meal plan request through your intake form and starts the AI generation process.

Success Looks Like: The trigger activates immediately when a new row is added, capturing all client information for processing.

Step 2: Generate AI Meal Plan

Node: OpenAI → Message a Model

Settings:

  • Model: GPT-4.1-MINI (or available)
  • Message: (Sample)
You are a professional nutritionist creating personalized meal plans. Based on the client information provided, generate a complete 7-day meal plan with grocery list.

CLIENT INFORMATION:
- Name: {{ $json['Client Name'] }}
- Goal: {{ $json.Goal }}
- Dietary Preferences: {{ $json['Dietary Preference'] }}
- Activity Level: {{ $json['Activity Level'] }}
- Allergies/Restrictions: {{ $json['Allergies / Restrictions'] }}

IMPORTANT: You must respond with ONLY valid JSON in this exact structure. Do not include any other text, explanations, or markdown formatting.

{
  "client_name": "Client's full name",
  "client_goal": "Their fitness/nutrition goal", 
  "dietary_preferences": "Their dietary restrictions/preferences",
  "creation_date": "Current date in format: Month DD, YYYY",
  "meals": {
    "monday": {
      "breakfast": "<strong>Meal Name</strong><br>Detailed ingredients and instructions<br><em>Calories: XXX | Protein: XXg</em>",
      "lunch": "<strong>Meal Name</strong><br>Detailed ingredients and instructions<br><em>Calories: XXX | Protein: XXg</em>",
      "dinner": "<strong>Meal Name</strong><br>Detailed ingredients and instructions<br><em>Calories: XXX | Protein: XXg</em>"
    },
    // ... continue for all 7 days
  },
  "grocery_list": {
    "proteins": ["Specific protein items with quantities"],
    "vegetables": ["Specific vegetable items with quantities"],
    "grains": ["Specific grain/carb items with quantities"],
    "pantry": ["Pantry items, oils, condiments, etc."]
  }
}

REQUIREMENTS:
- Each meal must include HTML formatting exactly as shown
- Include realistic calorie and protein counts for each meal
- Ensure all meals align with the client's dietary preferences and goals
- Provide variety across the week - no repeated meals
- Generate a complete grocery list based on ALL meals in the plan
- Include specific quantities in grocery list
- Organize grocery items into the 4 categories: proteins, vegetables, grains, pantry
- Respond with ONLY the JSON - no additional text or explanations

What This Does: Uses advanced AI to create a personalized 7-day meal plan based on the client's specific goals, dietary preferences, activity level, and restrictions.

Success Looks Like: AI returns structured JSON containing complete meal plans with detailed recipes, nutritional information, and organized grocery lists.

Step 3: Generate PDF from Template

Node: PDF.co API → URL/HTML to PDF

Settings:

  • Convert Type: HTML Template to PDF
  • Template ID: 1 (your custom HTML template)
  • Template Data: {{ $json.message.content }}
  • Advanced Options → File Name: {{ $('Google Sheets Trigger').item.json['Client Name'] }}

What This Does: Converts the AI-generated meal plan data into a professional PDF using your custom HTML template with proper formatting, styling, and branding.

Success Looks Like: PDF.co returns a download URL for the completed meal plan PDF with all client information and meal details properly formatted.

Step 4: Download PDF File

Node: HTTP Request

Settings:

  • Method: GET
  • URL: {{ $json.url }} (from the PDF.co step)

What This Does: Downloads the generated PDF file from PDF.co's servers so it can be stored to Google Drive for backup.

Success Looks Like: The meal plan PDF is downloaded and ready for storage.

Step 5: Store PDF in Google Drive

Node: Google Drive → Upload File

Settings:

  • Input Data Field Name: data
  • Parent Drive From List: My Drive
  • Parent Folder From List: Select your designated meal plans output folder

What This Does: Saves a backup copy of each generated meal plan PDF to your Google Drive for record-keeping and client support.

Success Looks Like: PDF is successfully uploaded to Google Drive with the client's name as the filename.

Step 6: Email PDF to Client

Node: HTTP Request → PDF.co Send Email

Settings:

  • Method: POST
  • URL: https://api.pdf.co/v1/email/send
  • Headers:
    • Content-Type: application/json
    • x-api-key: [Your PDF.co API Key]
  • JSON Body:
{
  "url": "{{ $('PDFco Api').item.json.url }}",
  "from": "Your Business <your@email.com>",
  "to": "{{ $('Google Sheets Trigger').item.json['Client Name'] }} <{{ $('Google Sheets Trigger').item.json['Email Address'] }}>",
  "subject": "Your Custom 7-Day Meal Plan is Ready!",
  "bodytext": "Hi {{ $('Google Sheets Trigger').item.json['Client Name'] }}, your personalized meal plan is attached. Enjoy your healthy eating journey!",
  "bodyHtml": "<p>Hi {{ $('Google Sheets Trigger').item.json['Client Name'] }},</p><p>Your personalized meal plan is attached. Enjoy your healthy eating journey!</p>",
  "smtpserver": "smtp.gmail.com",
  "smtpport": "587",
  "smtpusername": "your@gmail.com",
  "smtppassword": "[Your Gmail App Password]"
}

What This Does: Automatically sends the personalized meal plan PDF directly to the client's email address with a professional message.

Success Looks Like: Client receives an email with their custom meal plan PDF attachment within seconds of submitting their request.

Congrats! You've created an intelligent meal planning service that transforms client intake forms into personalized, professional meal plans delivered automatically via email.

Built something cool with this workflow? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials