Automate WordPress CF7 Contact Form Responses with n8n & Google Gemini

This n8n workflow automates handling WordPress Contact Form 7 inquiries by classifying messages with Google Gemini AI, drafting personalized email replies, and saving all data to Google Sheets. It saves time and reduces errors in managing customer communications efficiently.
webhook
lmChatGoogleGemini
chainLlm
+6
Workflow Identifier: 1104
NODES in Use: Webhook, Set, lmChatGoogleGemini, textClassifier, chainLlm, gmail, googleSheets, outputParserStructured, stickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow takes contact form messages from a WordPress site using Contact Form 7 and sorts them automatically.

It reads messages, figures out if they ask about products, orders, or something else, then writes proper email replies and saves everything in a Google Sheet.

This saves time by stopping manual sorting and replying to customers.


Who should use this workflow

This is for small business owners or anyone using WordPress with Contact Form 7 and who get many customer questions.

If manually sorting and replying to messages takes too long, this workflow helps make that easier and faster.


Tools and services used

  • WordPress CF7 to Webhook Plugin: Sends form data to the automation.
  • n8n automation platform: Runs the workflow.
  • Google Gemini Chat Model: Classifies message type and writes emails.
  • LangChain: Organizes AI classification logic.
  • Gmail API: Creates email drafts automatically.
  • Google Sheets API: Records inquiries and replies.

How the workflow works: Inputs, Process, and Outputs

Inputs

  • New customer contact form submission from WordPress.
  • Data includes first name, last name, email, phone, and message text.

Processing Steps

  • Webhook node receives the form submission through POST from WordPress.
  • Set Fields node extracts and stores user details and message content for processing.
  • Google Gemini Chat Model combined with LangChain analyzes the message.
  • The Message Classifier LangChain node decides if the message is “Product Info,” “Order Info,” or “Other.”
  • Based on the category, the workflow sends the data to specific Email writer nodes that generate professional reply drafts.
  • Subject and Text parser nodes extract email subject and body from the AI output.
  • Gmail draft nodes create email drafts in Gmail with the generated replies and form data.
  • Google Sheets node appends the inquiry and email draft details to a sheet for record-keeping.

Outputs

  • Email drafts ready in Gmail for review and sending.
  • Logged inquiry and response data saved in Google Sheets.

Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Inside n8n editor, click “Import from File” and select the downloaded workflow.

Step 2: Add credentials and update settings

  1. Add Google Palm API credentials in n8n for Google Gemini Chat nodes.
  2. Fill in Gmail account OAuth2 credentials for email drafts creation.
  3. Add Google Sheets OAuth2 credentials and update the Google Sheet ID in the logging node.
  4. Make sure the webhook node has a unique path and note down its URL.
  5. On the WordPress site, configure the CF7 to Webhook plugin with the webhook URL to send POST data.

Step 3: Testing and activating

  1. Send a test submission on the WordPress contact form.
  2. Check if the webhook triggers and the workflow runs without errors in n8n.
  3. Verify email drafts appear in Gmail.
  4. Check the Google Sheet for the new log entry.
  5. Activate the workflow inside n8n to start automatic processing.

If self hosting n8n on server, visit self-host n8n for help setting up webhook access.


Customization ideas

  • Add more classification types by editing the category list in the Message Classifier LangChain node.
  • Change email recipients in each Gmail draft node’s sendTo field.
  • Change the writing style and tone in prompts inside the Email writer nodes.
  • Extend the Google Sheet columns to log extra data fields from the form or AI outputs.
  • Swap Google Gemini AI with other models supported by LangChain if wanted.

Common problems and fixes

  • Issue: Webhook not triggered when form is sent.
    Fix: Check the webhook URL is exactly copied to CF7 plugin settings and POST method is enabled.
  • Issue: Gmail draft nodes do not create drafts.
    Fix: Verify Google Palm API and Gmail OAuth credentials are correct and authorized.
  • Issue: All messages classified as “Other”.
    Fix: Update categories and system prompts in the Message Classifier node and test examples.

Summary of results

✓ Incoming form messages automatically classified and sorted.
✓ Professional email replies drafted without typing.
✓ Email drafts ready in Gmail for quick sending.
✓ All messages and replies recorded in Google Sheets.
✓ Saves hours of manual work every day.
✓ Reduces errors and missed customer inquiries.


Frequently Asked Questions

Yes. The workflow can use other LangChain-compatible AI models by updating the prompts and API credentials.
Common causes include incorrect webhook URL input in the CF7 to Webhook plugin and not enabling POST method for requests.
All inquiries and AI-generated email drafts are appended to a Google Sheet specified in the workflow.
After importing and configuring credentials, test the workflow once, then toggle the active status in n8n to start running it automatically.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free