Auto-Create Google Docs from Form Data with n8n [Template Workflow 2026]

Automatically generate Google Documents from form submissions using n8n. Works with Google Forms, Typeform, and webhooks — includes templating and variable filling.
formTrigger
googleDrive
code
+2
Workflow Identifier: 1565
NODES in Use: Form Trigger, Sticky Note, Google Drive, Code, HTTP Request
Auto-create Google Docs with n8n and Google Drive

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

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow takes form submissions and turns them into ready Google Docs contracts fast.

It copies a Google Docs template, replaces placeholders with the form data, and creates a personalized document immediately.

This cuts down hours of manual work and avoids errors like missing or wrong information.


Tools and Services Used

  • n8n.io: Runs automation workflows and integrates services.
  • Google Drive: Stores and copies the Google Docs template files.
  • Google Docs API: Edits document content by replacing placeholder text.
  • Form Trigger Node in n8n: Captures client inputs from a web form.
  • Google OAuth2 Credentials: Allows access to Google Drive and Docs securely.

Inputs, Processing Steps, and Output

Inputs

Processing Steps

  1. The workflow copies a predefined Google Docs template in Google Drive via Google Drive copy operation.
  2. A Code node extracts form fields into key-value pairs for processing.
  3. Another Code node formats the key-values as “replaceAllText” requests for Google Docs API.
  4. The HTTP Request node calls Google Docs API to replace placeholders (like {{name}}) with the form values inside the copied document.

Output

The final output is a personalized Google Docs document copied and updated in Google Drive, ready instantly after submission.


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

Importing the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where the workflow will be used.
  3. Choose Import from File in n8n and select the downloaded workflow file.

Setup after import

  1. Add OAuth2 Credentials for Google Drive and Google Docs nodes using your Google account with proper access.
  2. Update the Google Drive node’s File ID with your template file ID if different.
  3. If more form fields were added, ensure your Google Docs template has matching placeholders with double curly braces, e.g., {{address}}, {{email}}.
  4. Add Basic Authentication settings in the Form Trigger node to protect the form from unauthorized access.

Testing and activating

  1. Submit sample data through the form URL provided by the Form Trigger node.
  2. Check the created Google Docs in your Drive to confirm proper data replacement.
  3. Once confirmed, toggle the workflow from disabled to enabled to start running it automatically in production.
  4. Monitor runs and errors via the n8n dashboard logs.

For privacy and control, consider using self-host n8n to run the workflow on your own server.


Key Code Snippets Used

Format form data Code node

This code takes all submitted form data and turns them into an array of key-value pairs.

const data = [];

Object.keys($('Form').all().map((item) => {
  Object.keys(item.json).map((bodyProperty) => {
    data.push({
      key: bodyProperty,
      value: item.json[bodyProperty],
    });
  })
}));

return {
  webhook_data: data,
  pairedItem: 0,
};

Format form data to Google Docs API requests Code node

This code converts the key-values to the Google Docs API “replaceAllText” requests.

const result = [];

$('Format form data').all().map((item) => {
  item.json.webhook_data.map((data) => {
    if ("submittedAt" !== data.key && "formMode" !== data.key) {
      result.push({
        "replaceAllText": {
            "containsText": {
              "text": `{{${data.key}}}`, 
              "matchCase": true
            },
            "replaceText": `${data.value}`
        },
      });
    }
  });
})

return {
  data: result,
  pairedItem: 0,
};

Common Problems and How to Fix Them

Failed to copy Google Drive template file

Cause: Wrong template file ID or missing permissions.

Fix: Check the file ID in the Google Drive node and make sure the OAuth user can access the file with edit rights.

Google Docs API Unauthorized or Forbidden error

Cause: OAuth credentials expired or configured wrong.

Fix: Re-authenticate Google Docs OAuth credentials and confirm API is enabled.

Form data not replacing variables in Google Doc

Cause: Placeholder variables in template don’t match form field names exactly.

Fix: Ensure placeholders use double curly braces {{ }} and names match the form fields letter by letter.


Customization Ideas

  1. Add new form fields (like “email” or “address”) in the Form Trigger node and add matching placeholders in the Google Docs template.
  2. Change Google Docs template by replacing the template file ID in the Google Drive copy node.
  3. Protect the form by enabling Basic Authentication in the Form Trigger node settings.
  4. Adjust the copied file names by editing the expression in the Google Drive node’s Name field, adding timestamps or other details.

Summary

✓ Saves hours of manual copying by automating contract creation from forms.

✓ Eliminates errors from manual data entry, making contracts accurate every time.

✓ Quickly creates personalized Google Docs documents using form input.

✓ Works fully inside n8n using Google Drive and Google Docs API with simple setup.

✓ Suitable for event coordinators, businesses, anyone needing fast document prep from client data.


Auto-create Google Docs with n8n and Google Drive

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow captures form inputs using the Form Trigger node, copies a Google Docs template, then uses Google Docs API to replace placeholders with submitted form data.
Check that placeholders in the Google Docs template exactly match form field names inside double curly braces and verify the Google Docs API request isn’t failing.
No. The workflow requires Google OAuth2 credentials for both Drive and Docs nodes to access and edit files securely.
Yes. Users can run the workflow via self-host n8n solutions to keep data private and control workflow hosting.

Promoted by BULDRR AI

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.