Prerequisites & Overview

Everything you need to know before starting the setup process.

๐Ÿ“‹

What You'll Need

Category Breakdown

๐Ÿค– AI Services โ€ข Google Gemini API Key
โ€ข Active Google AI Studio Account
๐Ÿ”‘ Setup Guide
๐Ÿ“ฑ Messaging โ€ข WhatsApp Business Account
โ€ข Facebook Developer Account
โ€ข Verified Business
๐Ÿ“ž Configure
โ˜๏ธ Cloud Services โ€ข Google Cloud Project
โ€ข Gmail API Access
โ€ข Google Sheets & Drive API
๐ŸŒ Setup
๐Ÿ› ๏ธ Platform โ€ข n8n Instance (Cloud/Self-hosted)
โ€ข SSL Domain
โ€ข PDF Generator API
โš™๏ธ Deploy
๐Ÿ“Š Data Source โ€ข Google Sheets with Beach Data
โ€ข Proper Data Structure
โ€ข Read/Write Permissions
๐Ÿ“ˆ Template

๐Ÿ” API Credentials & Accounts

Service Purpose Setup Time Cost
n8n Instance Workflow Automation 5 min Free Tier Available
WhatsApp Business API Message Reception 30 min Free for Testing
Google Cloud Project Sheets & Gmail Access 15 min Free ($300 credit)
Google Gemini AI Data Analysis 5 min Free Tier
PDF Generator API Report Creation 10 min Free Tier Available
๐Ÿ’ก Pro Tip: Have all your account credentials and information ready before starting to streamline the setup process. Most services offer free tiers for development and testing.
๐Ÿ”ง

Workflow Components

Plemdo AI uses the following integrated components for conversational data analytics:

Component Purpose Key Features
๐Ÿง  Conversation Router Intent Detection & Context Management Natural Language Processing, Multi-turn Memory, Query Enhancement, Clarification Engine
๐Ÿค– AI Data Scientist Advanced Data Analysis Google Gemini AI, Multi-dimensional Analysis, Strategic Recommendations, Competitive Intelligence
๐Ÿ“Š Visualization Engine Professional Chart Generation 8+ Chart Types, Enterprise Color Schemes, Context-Aware Selection, HD Export Quality
๐Ÿ“„ PDF Reporting Automated Report Generation 15+ Page PDFs, Executive Summaries, Branded Templates, Multi-format Delivery
๐Ÿ’ณ Monetization Tracker Business Value Analytics Usage-based Billing, ROI Calculation, Cost Savings Analytics, Tier-based Pricing
Important: All components require proper API configuration and authentication for Plemdo AI to function seamlessly.

Google OAuth Setup

Configure OAuth 2.0 credentials for seamless integration with YouTube, Google Sheets, and Google Drive.

1

Configure OAuth Consent Screen

Set up your OAuth consent screen in Google Cloud Console:

  • Go to APIs & Services โ†’ OAuth consent screen
  • Select External user type and click Create
  • Fill in application details:
    • App name: "AI Video Factory Automator"
    • User support email: [Your email]
    • Developer contact information: [Your email]
  • Click Save and Continue
Note: The consent screen is essential for OAuth 2.0 authentication flows.
2

Add OAuth Scopes

Configure the required scopes for your application:

  • Click Add or Remove Scopes
  • Add these scopes manually:
    • Google Drive: https://www.googleapis.com/auth/drive
    • Google Sheets: https://www.googleapis.com/auth/spreadsheets
    • Gmail Send: https://www.googleapis.com/auth/gmail.send
  • Click Update then Save and Continue
  • Add test users by entering your email address
  • Click Save and Continue
https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/gmail.send
3

Create OAuth Client ID

Generate OAuth credentials for n8n integration:

  • Go to Credentials page in Google Cloud Console
  • Click Create Credentials โ†’ OAuth client ID
  • Set Application type: "Web application"
  • Enter Name: "n8n-video-factory"
  • Add authorized redirect URIs:
    • For n8n Cloud: https://app.n8n.cloud/rest/oauth2-credential/callback
    • For Self-hosted: https://your-n8n-domain.com/rest/oauth2-credential/callback
  • Click Create
  • Copy the Client ID and Client Secret
Client ID: 1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com Client Secret: GOCSPX-abcdefghijklmnopqrstuvwxyz123456789 ๐Ÿ”’ Keep these credentials secure and never share them publicly.
4

Configure n8n OAuth Credentials

Set up OAuth credentials in your n8n instance:

  • In n8n, go to Settings โ†’ Credentials
  • Click Add Credential
  • Search for and select "Google OAuth2 API"
  • Fill in the credential form:
    • Name: "Google OAuth (Video Factory)"
    • Client ID: [From Step 3]
    • Client Secret: [From Step 3]
  • Click Save
  • n8n will redirect you to Google for authentication
  • Grant the necessary permissions when prompted
  • You'll be redirected back to n8n with the credential created
Important: Ensure all OAuth scopes are granted during authentication for full functionality.

Gemini API Setup

Enable Google Gemini for intelligent video prompt generation and creative content automation.

1

Enable Gemini API

Enable the Gemini API in your Google Cloud project:

  • Go to the API Library
  • Search for "Generative Language API" or "Gemini API"
  • Click on the API from the results
  • Click "Enable"
Tip: You can also use the direct link: Generative Language API
2

Get API Key

Create an API key for the Gemini API:

  • Go to the Credentials page
  • Click "Create Credentials" โ†’ "API Key"
  • Copy the generated API key
  • Optionally, restrict the API key to only the Generative Language API for security
API Key: AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ๐Ÿ”’ Security Tip: Restrict your API key to only the necessary APIs and consider setting up application restrictions for enhanced security.
3

Configure in N8N

Set up the Gemini credential in N8N:

  • In N8N, go to Settings โ†’ Credentials
  • Click "Add Credential"
  • Search for "Google Gemini" or "PaLM API"
  • Select "Google Gemini(PaLM) API"
  • Enter your API Key in the provided field
  • Click "Save"
Note: This credential will be used by the "Google Gemini Chat Model" nodes in your workflow.

PDF Generator API

Configure PDF Generator API to convert HTML content into professional PDF documents seamlessly.

1

Create PDF Generator Account

Get started with PDF Generator API:

  • Go to pdfgeneratorapi.com
  • Click "Sign up for free account"
  • Complete the registration form with your details
  • Verify your email address to activate your account
Pro Tip: The free tier includes generous limits perfect for testing and small-scale deployments.
2

Get API Credentials

Retrieve your authentication credentials from the dashboard:

  • Login to your PDF Generator dashboard
  • Navigate to "API Settings" or "Credentials" section
  • Copy the following credentials:
    • Workspace ID - Your unique workspace identifier
    • API Key - Public authentication key
    • API Secret - Private authentication secret
Workspace ID: ws_xxxxxxxxxxxxx API Key: pk_live_xxxxxxxxxxxxx API Secret: sk_live_xxxxxxxxxxxxx
Security Alert: Keep your API Secret confidential. Never expose it in client-side code or public repositories.
3

Configure n8n Credentials

Set up PDF Generator API credentials in your n8n instance:

  • Open n8n and go to Settings โ†’ Credentials
  • Click "Add Credential" or "Create new"
  • Search for and select "PDF Generator API"
  • Fill in the credential form with your copied values:
    • Name: "PDF Generator API (Plemdo AI)"
    • Workspace ID: [Your Workspace ID]
    • API Key: [Your API Key]
    • API Secret: [Your API Secret]
  • Click "Save" to store the credential
Note: You can test the connection by clicking the "Test" button before saving to ensure your credentials are valid.
4

Assign to Workflow

Connect the PDF Generator API to your Plemdo AI workflow:

  • Open your "Plemdo AI" workflow in n8n
  • Locate the "PDF โ€” Render HTML โ†’ PDF" node
  • Click on the node to open its settings
  • In the "Credential" dropdown, select "PDF Generator API (Plemdo AI)"
  • Configure your PDF generation settings (page size, margins, orientation, etc.)
  • Test with sample HTML content to verify the integration
Testing Tip: Start with simple HTML to ensure basic functionality, then gradually add more complex content and styling.

Setup Complete!

You're all set! Your PDF Generator API is now ready to transform HTML content into beautiful PDFs. You can now:

  • โœจ Generate PDF documents from dynamic HTML templates
  • ๐Ÿ“Š Create reports, invoices, and certificates automatically
  • ๐ŸŽจ Apply custom styling and branding to your PDFs
  • โšก Process high-volume PDF generation with API-level performance

WhatsApp OAuth API

Integrate your WhatsApp Business Account for automated messaging and notifications.

1

Create a Meta App

Set up a Meta for Developers app to manage your WhatsApp integration:

  • Go to Meta for Developers
  • Click "My Apps" โ†’ "Create App"
  • Select "Business" as the app type and click "Next"
  • Enter your App Name (e.g., "Plemdo AI WhatsApp") and your Business Email
  • Click "Create App"
Note: Ensure you have a Facebook Business Manager account linked to this app.
2

Add WhatsApp Product

Integrate the WhatsApp product into your Meta app:

  • In your App Dashboard, find and click on "Set up" for "WhatsApp"
  • You will be redirected to the WhatsApp product page
  • Click "Configure"
  • Select your Meta Business account and the Business account that owns your WhatsApp Business Account (WABA).
  • If you don't have a WABA, you'll be prompted to create one.
3

Obtain API Credentials

Get your WhatsApp API token and phone number:

  • On the WhatsApp product page, you'll see a "Token" section.
  • Copy the System User Access Token. This is your API token.
  • Under the "Phone numbers" section, you should see your verified WhatsApp Business phone number.
  • If not, you'll need to add and verify a phone number using the WhatsApp Business Platform setup.
API Token: EAABXXXXXXXXXXXXXX... Phone Number: +11234567890
Security Alert: Treat your API Token as a password. Do not expose it publicly.
4

Configure Webhooks

Set up webhooks to receive incoming messages:

  • On the WhatsApp product page, scroll down to the "Webhooks" section.
  • Click "Edit"
  • Enter your Callback URL. This will be your n8n webhook URL: https://your-n8n-domain.com/webhook/whatsapp-inbound (replace with your actual n8n domain).
  • Enter a Verify Token. This is a secret string you create to verify webhook requests.
  • Click "Verify and Save".
  • You will need to subscribe to message events. Click "Add Subscription" and select "messages".
Note: Ensure your n8n instance is publicly accessible and has an SSL certificate for webhooks to work.
5

Configure n8n WhatsApp Credential

Add the WhatsApp credential to your n8n instance:

  • In n8n, go to Settings โ†’ Credentials
  • Click "Add Credential"
  • Search for "Meta Webhooks"
  • Select "Meta Webhooks"
  • Fill in the credential form:
    • Name: "WhatsApp API (Plemdo AI)"
    • Token: [Your System User Access Token from Step 3]
    • Verify Token: [Your secret Verify Token from Step 4]
  • Click "Save"
Note: This credential will be used for sending messages via the WhatsApp nodes in n8n.

N8N Configuration

Complete setup and testing of your N8N workflow for full automation pipeline.

1

๐Ÿ“ฅ Import the Workflow

Import Plemdo AI into Your n8n Instance

Access Your n8n Dashboard

  • Navigate to your n8n instance
  • Go to the Workflows page

Import Workflow File

  • Click "Import from file" button
  • Select the Plemdo-AI-Workflow.json file
  • Click "Import"

Verify Import Success

  • Workflow appears in your list
  • All 25+ nodes pre-configured
  • Ready for credential assignment
โœ… Expected Result: Complete conversational analytics workflow loaded with intelligent routing, AI analysis, and automated reporting nodes.

Quick Configuration Steps:

  1. Open imported workflow in n8n editor
  2. Locate key configuration nodes (highlighted in workflow)
  3. Update project-specific parameters
  4. Save workflow to apply changes
2

๐Ÿ” Assign Credentials to Nodes

Connect Your API Services to Power Plemdo AI

Node Icon Credential Type Purpose
WhatsApp Trigger ๐Ÿ“ฑ WhatsApp Business API Conversation intake
AI Data Scientist ๐Ÿค– Google Gemini API Intelligent analysis
Get Beach Data ๐Ÿ“Š Google Sheets OAuth2 Data source access
Email Delivery โœ‰๏ธ Gmail OAuth2 Report distribution
Drive Upload โ˜๏ธ Google Drive OAuth2 PDF storage
Analytics Tracker ๐Ÿ’ณ Google Sheets OAuth2 Usage tracking

Credential Assignment Process:

๐Ÿ“ฑ
1. WhatsApp Business Integration
Node: "Trigger โ€” WhatsApp (Client)" Credential: WhatsApp Business API โ†’ Phone Number ID + Permanent Access Token
๐Ÿค–
2. AI Intelligence Layer
Node: "๐Ÿค– AI Data Scientist" Credential: Google Gemini API โ†’ API Key with generative text permissions
๐Ÿ“Š
3. Data Source Connection
Node: "Get Beach Data" Credential: Google Sheets OAuth2 โ†’ Read access to beach tourism dataset
โ˜๏ธ
4. Delivery & Storage
Nodes: "Email โ€” Send Report" + "Upload file" Credentials: Gmail + Drive OAuth2 โ†’ Send permissions + Drive upload access
๐Ÿ’ณ
5. Analytics & Monitoring
Node: "๐Ÿ’ณ Monetization & Analytics Tracker" Credential: Google Sheets OAuth2 โ†’ Write access for usage tracking
3

๐Ÿงช Testing & Validation

Verify Complete Pipeline Functionality

Initial Smoke Test

Test 1: WhatsApp Connection
# Send "Hi" to your business number โ†’ Expect immediate welcome message
Test 2: AI Processing
# Send "Show me all beaches" โ†’ Expect processing notification + PDF delivery
Test 3: Email Delivery
# Check inbox for professional report โ†’ 15-page PDF with charts & analysis
๐Ÿ’ก Pro Tip: Run each test sequentially and verify success before moving to the next. This ensures you can quickly identify and fix any configuration issues.

Sample Errors & Troubleshooting

Common issues and their solutions for a smooth setup experience.

โŒ Error: "Permission denied" when accessing Vertex AI

Solution: Ensure your service account has the "Vertex AI User" role. Go to IAM & Admin > IAM and verify permissions.

โŒ Error: "Quota exceeded" for Veo3

Solution: Check your Vertex AI quotas in Google Cloud Console. Request a quota increase if needed.

WhatsApp OAuth API Troubleshooting

โŒ Error: Business Verification Pending

Solution: Business verification is required before creating WhatsApp Business App. This may take 1-3 days for approval. Required documents:

  • Business registration certificate
  • Tax identification number
  • Utility bill or bank statement
  • Government-issued ID

โŒ Error: System User Token Not Generated

Solution: Ensure you have the correct role permissions. Steps to resolve:

  • Navigate to System Users section in your Facebook app
  • Create new System User with "Developer" role
  • Click "Generate New Token" and select your app
  • Choose "Never Expire" for token duration
  • Copy immediately - you won't see it again! (Format: EAAL...)

โŒ Error: Webhook Not Receiving Messages

Solution: Verify all webhook configurations:

  • Callback URL must be publicly accessible: https://your-n8n-domain.com/webhook/whatsapp
  • Verify Token must match exactly in both Facebook and n8n
  • Webhook Version should be v16.0 or latest stable
  • Confirm "messages" event is subscribed in Meta for Developers
  • Test with a simple message first: "Hi"

โŒ Error: Phone Number Verification Failed

Solution: Follow the verification process:

  • Go to WhatsApp โ†’ API Setup โ†’ Add Phone Number
  • You'll receive a 6-digit code via SMS or phone call
  • Enter the code immediately within 10 minutes
  • Save your Phone Number ID (different from actual phone number)
  • Example Phone Number ID format: 904388409414179

โŒ Error: Invalid Credentials in n8n

Solution: Ensure all credentials are correctly configured:

  • Access Token: Your permanent token from System User (starts with EAAL)
  • Phone Number ID: Found in WhatsApp โ†’ API Setup
  • Business Account ID: In your app settings
  • App ID: In your app settings
  • Double-check for extra spaces or characters

โŒ Error: Message Send Fails with Timeout

Solution: Message processing may be delayed:

  • Gemini AI analysis can take 20-30 seconds
  • PDF generation and email delivery add processing time
  • n8n workflow has automatic retry mechanisms
  • Check n8n execution logs for detailed error messages
  • Verify all downstream services (email, storage) are accessible

โŒ Error: WhatsApp Message Not Received After Sending

Solution: Full message flow verification:

  • Send test message: "Show me top beaches in Dublin"
  • Expected response: Welcome message and processing notification
  • Wait 20-30 seconds for Gemini analysis completion
  • Verify PDF was generated and emailed
  • Check n8n logs if WhatsApp summary is missing
  • Ensure phone number is in international format: +1234567890

โŒ Error: OAuth Consent Screen Not Verified

Solution: Complete OAuth verification:

  • For testing: Add test users in OAuth consent screen
  • For production: Submit app for verification by Google
  • Ensure all required scopes are documented and justified
  • Provide clear descriptions of data usage
  • Review process typically takes 3-5 days

โœ… Validation Checklist

Before going live, verify:

  • โœ“ Business verification complete
  • โœ“ WhatsApp Business App created and active
  • โœ“ Permanent access token securely stored
  • โœ“ Webhooks configured and verified
  • โœ“ Phone number verified and configured
  • โœ“ n8n credentials tested successfully
  • โœ“ Sample message flow works end-to-end
  • โœ“ PDF generation and email delivery functional