AutomationFlowsAI & RAG › Reply to Contact Form Leads via Gmail and Google Sheets Using Openai Gpt-4o Mini

Reply to Contact Form Leads via Gmail and Google Sheets Using Openai Gpt-4o Mini

ByTakatoYamada @takato-door on n8n.io

This workflow triggers on n8n form submissions, uses OpenAI (GPT-4o mini) to draft a short acknowledgment email, sends the auto-reply through Gmail, and appends the submission details to a Google Sheets spreadsheet. Triggers when someone submits the n8n “Contact Us” form with…

Event trigger★★★☆☆ complexityAI-powered9 nodesForm TriggerChain LlmOpenAI ChatGmailGoogle Sheets
AI & RAG Trigger: Event Nodes: 9 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #16021 — we link there as the canonical source.

This workflow follows the Chainllm → Form Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "dbb4609124741d19",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Auto-reply to form submissions via Gmail and log to Google Sheets using OpenAI",
  "tags": [
    {
      "name": "contact-form"
    },
    {
      "name": "auto-reply"
    },
    {
      "name": "lead-capture"
    },
    {
      "name": "gmail"
    },
    {
      "name": "google-sheets"
    },
    {
      "name": "openai"
    },
    {
      "name": "automation"
    },
    {
      "name": "ai"
    }
  ],
  "nodes": [
    {
      "id": "6cfec3b6-2f52-4859-9f29-866903efa558",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -192
      ],
      "parameters": {
        "width": 480,
        "height": 640,
        "content": "## Auto-reply to form submissions via Gmail and log to Google Sheets using OpenAI\n\n## How it works\n\n1. Trigger runs on new contact form submission.\n2. Draft reply is generated using language model.\n3. Email reply is sent via Gmail.\n4. Submission is logged in Google Sheets.\n\n## Setup steps\n\n- [ ] Set up contact form trigger to start the workflow.\n- [ ] Configure OpenAI credentials to draft replies.\n- [ ] Set up Gmail account for sending auto-replies.\n- [ ] Connect Google Sheets for logging submissions.\n\n## Customization\n\nYou can customize the reply message by modifying the model's prompt settings."
      },
      "typeVersion": 1
    },
    {
      "id": "fc5fb9c5-7446-43d0-8d0b-086b839daa68",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 480,
        "content": "## Trigger and draft reply\n\nInitiates on form submission and drafts a reply using AI."
      },
      "typeVersion": 1
    },
    {
      "id": "41979f68-26f3-4abd-80de-38f913cffcfe",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -192
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 304,
        "content": "## Send auto-reply\n\nSends the drafted email reply using Gmail."
      },
      "typeVersion": 1
    },
    {
      "id": "267d7609-6ae8-4018-8b91-77c2e5a17df3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 240,
        "height": 304,
        "content": "## Log submission\n\nLogs the form submission details into Google Sheets."
      },
      "typeVersion": 1
    },
    {
      "id": "221dae63-7347-4b0d-aad0-5a6bfc9d5eed",
      "name": "When Form Submitted",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -40,
        0
      ],
      "parameters": {
        "options": {},
        "formTitle": "Contact Us",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Message",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b47fae92-0fb9-4e83-b2ba-e6befe366743",
      "name": "Prepare Email Reply",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        220,
        0
      ],
      "parameters": {
        "text": "=Write a warm, helpful auto-reply email (max 120 words) that acknowledges the message and sets the expectation of a human follow-up within 1 business day. Sign as 'The Team'.\n\nName: {{ $json.Name }}\nMessage: {{ $json.Message }}",
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "58cc57bf-ddae-4ac4-8e37-3b54c5c06cb1",
      "name": "OpenAI GPT-4o Mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        220,
        220
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {
          "temperature": 0.4
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a4e16fc2-5a8c-47d4-b192-856cb3e8a1fc",
      "name": "Send Email via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        608,
        -64
      ],
      "parameters": {
        "sendTo": "={{ $('When Form Submitted').item.json.Email }}",
        "message": "={{ $json.text }}",
        "options": {},
        "subject": "Thanks for reaching out!"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f6c8e5af-f22b-4c39-937c-1037454a651e",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        608,
        288
      ],
      "parameters": {
        "sheet": {
          "__rl": true,
          "mode": "list",
          "value": "Leads"
        },
        "columns": {
          "value": {},
          "mappingMode": "autoMapInputData"
        },
        "options": {},
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/REPLACE_ID/edit"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "OpenAI GPT-4o Mini": {
      "ai_languageModel": [
        [
          {
            "node": "Prepare Email Reply",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Email Reply": {
      "main": [
        [
          {
            "node": "Send Email via Gmail",
            "type": "main",
            "index": 0
          },
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Form Submitted": {
      "main": [
        [
          {
            "node": "Prepare Email Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow triggers on n8n form submissions, uses OpenAI (GPT-4o mini) to draft a short acknowledgment email, sends the auto-reply through Gmail, and appends the submission details to a Google Sheets spreadsheet. Triggers when someone submits the n8n “Contact Us” form with…

Source: https://n8n.io/workflows/16021/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

It works with both Thai and English business cards and even includes an optional step to draft greeting emails automatically.

OpenAI Chat, Agent, Chain Llm +5
AI & RAG

This n8n template automates targeted lead discovery, AI-driven data structuring, and personalized cold-email sending at controlled intervals. It’s ideal for sales teams, founders, and agencies that wa

Google Sheets, Form Trigger, Chain Llm +6
AI & RAG

Automate AI content creation from request to approval. While AI writes quickly, human review often delays delivery—and multiple tools create workflow gaps and version confusion. This unified solution

Form Trigger, Chain Llm, OpenAI Chat +2
AI & RAG

Workflow 3610. Uses httpRequest, formTrigger, chainLlm, lmChatOpenAi. Event-driven trigger; 18 nodes.

HTTP Request, Form Trigger, Chain Llm +3
AI & RAG

(Trustpilot + Bright Data + GPT-5.5)

HTTP Request, Form Trigger, Chain Llm +3