Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  VPS FAQ  >  How to Connect n8n to Google Sheets
Top Scroll

How to Connect n8n to Google Sheets

 2 min

If you want to connect n8n automation workflow to Google Sheets, follow this tutorial. You need to set up an OAuth 2.0 credential in the Google Cloud Console before connecting. The credential allows n8n to securely access your spreadsheets using the Google Sheets API. For those running a self-hosted instance, the process of using n8n VPS is straightforward with a few specific steps.

Steps to Connect n8n to Google Sheets

Step 1: Create Google API keys

  • Go to “Google Cloud Console” and sign in using your Google account.
  • To create a new project, you should click the project selection button at the top of the page followed by the button “New Project.”
  • Search the “Google Cloud Console”, and under APIs & Services, in the library, enable the “Google Sheets API.”
  • Then, go to “APIs and Services 0Auth consent” screen.
  • Click “External” as the type of user and complete the mandatory information on app registration.
  • Select “APIs & Services” and click “Credentials” and select “OAuth client ID.”
  • As the application type, choose “Web application.” Name your application and click “Create.”
  • A dialog will be presented and your client id and client secret. This window should be left open because you will be required to paste these values in n8n. 

Step 2: Further set up the n8n credential.

  • Within your n8n workflow, go ahead and add a node of “Google Sheets” by clicking the “+” button.
  • On the node configuration menu, select “Create” new credential on the dropdown list of Credential to connect with.
  • Enter the “Client ID” and Client secret you have copied on the “Google Cloud Console” into the form of n8n credential.
  • n8n will accept a redirect URL. Copy this URL. 

Step 3: Add redirect URL to Google.

  • Go back to the “Google Cloud Console” that you created your OAuth client in.
  • Click on your client to make changes, and locate the field of Authorized redirect URIs.
  • Click “Add URL” and paste the redirect URL that you copied in n8n.
  • Click “Save.” 

Step 4: Authorize your account

  • Return to the n8n setup credential and sign in using Google.
  • Select the right Google account and give the required permissions.
  • Once authorised the option will be displayed as a drop down menu on the Google Sheets node. 
  • Frequent Google Sheets actions in n8n.

After connecting, you can use the Google Sheets node to do various tasks in your workflow: 

  • Append Row: This will insert a row at the end of a sheet.
  • Get Rows: Retrieves information of a row or rows.
  • Update Row: Edits a row in a sheet.
  • Create: invents a completely new sheet or spreadsheet.
  • Clear: Removes everything in a sheet or a range.
  • Google Sheets Trigger: This is a workflow that can be automatically started once a new row is added to the sheet or once an existing one is updated.
For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.