Guide: n8n Google Sheets node: how to use?
The n8n Google Sheets node: how to use is shown here for automation beginners. To use the n8n Google Sheets node, create OAuth2 credentials in Google Cloud, run n8n in Docker, add the Google Sheets node, and authorize with the OAuth consent flow. The steps below walk you through setup, commands, and a simple webhook example.
How to use n8n Google Sheets node: What You Need
- A Google account with access to Google Cloud Console.
- n8n running on Docker or Docker Compose.
- A Google Sheet you can edit.
- Basic terminal and network access to the n8n host.
Step 1: Create OAuth2 credentials in Google Cloud
Open Google Cloud Console. Create a new project or use an existing one. Enable the Google Sheets API and the Google Drive API.
Create an OAuth 2.0 Client ID credential. Set the application type to Web Application. Add this redirect URL:
http://localhost:5678/rest/oauth2-credential/callback
Save the Client ID and Client Secret. You will paste them into n8n when creating credentials.
Step 2: Run n8n with Docker
Start n8n locally with Docker. This example enables basic auth and mounts persistent data.
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE=true \
-e N8N_BASIC_AUTH_USER=admin \
-e N8N_BASIC_AUTH_PASSWORD=changeme \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
Or use a docker-compose.yml with these minimal settings:
version: '3'
services:
n8n:
image: n8nio/n8n
ports:
- '5678:5678'
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=changeme
volumes:
- ~/.n8n:/home/node/.n8n
Step 3: Add Google OAuth2 credential in n8n
Open n8n at http://localhost:5678 and log in using the basic auth values. Go to Credentials. Create new credential of type Google Sheets OAuth2.
- Enter the Client ID and Client Secret from Google Cloud.
- Use the same redirect URL if prompted: http://localhost:5678/rest/oauth2-credential/callback
- Start the OAuth flow to authorize n8n to access your sheets.
Step 4: Build a simple workflow that writes to a sheet
Create a new workflow. Add a Webhook trigger node. Add a Google Sheets node. Configure the Google Sheets node to use the OAuth2 credential and pick the sheet and range.
Example: the Google Sheets node set to Append will add rows. Connect the webhook to the Google Sheets node and save the workflow.
Test the workflow by calling the webhook with curl:
curl -X POST http://localhost:5678/webhook/my-workflow -H 'Content-Type: application/json' -d '{"name":"Alice","email":"alice@example.com"}'
The Google Sheets node will receive the data and append a row to the chosen sheet.
Update
To update the n8n Docker image, stop the container, pull the image, and restart. Use these commands for docker-compose or plain Docker.
# With docker-compose
docker-compose pull n8n
docker-compose up -d
# With plain Docker
docker stop n8n
docker rm n8n
docker pull n8nio/n8n
# then run the docker run command from earlier
Security
Enable basic auth and use strong passwords. Restrict the OAuth client to only needed scopes (Sheets and Drive limited to files). Use HTTPS in production and restrict inbound traffic to trusted IPs.
Store secrets in environment variables or a secrets manager. Do not expose your n8n UI to the public without protection.
Done
You now have a working path to use the n8n Google Sheets node with Docker and OAuth2. Create credentials, run n8n, build a workflow, and test with a webhook call. Update and secure your instance before moving to production.