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
Automate WordPress CF7 with n8n and Google Gemini

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

Learn how to Build this Workflow with AI:

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.


Automate WordPress CF7 with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

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.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.