In this tutorial, we show you how to start automation workflows from n8n or Zapier easily and directly from Google Sheets. It’s easier than many people think.
Use cases for Google Sheets with n8n webhooks
Use Case 1: Process lead table
Imagine you have a table with leads or project data. As soon as you enter new information, you want to send this data to n8n, e.g. to create a CRM entry or send a notification. Instead of building an automatic trigger logic for this, a manual click on “Send webhook” is often sufficient.
Use case 2: News and article tool
How easy would it be to have a table with the latest news in Google Sheets and use it to directly create an article on the current topics. To do this, you can create a menu in Google Sheets and call up the news with a click or create new articles using generative AI.
This is how it works: Set up menu in Google Sheets & start n8n webhook
Requirements: You need a) an n8n instance in the cloud or b) a self-hosted instance with connected domain (e.g. via a web hoster). An n8n instance on your own computer does not directly work here, as it cannot be reached externally. Workaround: install a tunnel with ngrok.
This works in 5 minutes:
-
Create a workflow with webhook in n8n
Create a new workflow with a webhook trigger. - Set up webhook
Define a URL under which the webhook can be accessed. Also make sure that your webhook is protected by authentication to prevent unauthorized use. Copy the URL displayed in the webhook. You will need this in the following apps script code in Google Sheets. - Activate webhook
Then set the workflow to “Active”, otherwise the webhook will not be found. - Google Sheets: Google Apps script for menu entry
With just a few lines of code, you can add your own menu called “n8n” to the table menu. Create entries such as “Start webhook” in it. -
Google Sheets: Google Apps script for webhook call
Open the menu Extensions → Apps Script in Google Sheets. Insert a short Javascript there that calls the webhook URL of n8n viaUrlFetchApp.fetch()
and thus starts the workflow. -
Testing the workflow
Save, return to the sheet, click on the menu – and the command fires your n8n workflow.
Code for Google Sheets menu and webhook call
Copy the code into Google Sheets (Extensions > Apps Script) and customize your instance URL. You need a cloud instance of n8n for this. This works in exactly the same way with Zapier, as you can also create webhooks with your own URLs here.
function onOpen() { SpreadsheetApp.getUi() .createMenu("NewsScanner") .addItem("▶ Scan news", "runWebhookScanNews") .addItem("▶ Write article", "runWebhookCreateArticle") .addToUi(); } function runWebhookScanNews() { const message = "Scanning news - Please wait 1 minute"; triggerWebhook("air-get-news", message); } function triggerWebhook(endpoint, successMessage) { const baseUrl = "https://YOUR-INSTANCE-NAME.app.n8n.cloud/webhook/"; const url = `${baseUrl}${endpoint}`; const ui = SpreadsheetApp.getUi(); try { const response = UrlFetchApp.fetch(url, {method: "get", muteHttpExceptions: true}); const code = response.getResponseCode(); if (code === 200) { ui.alert(successMessage); } else { ui.alert(`Failed to trigger. Status ${code}: ${response.getContentText()}`); } } catch (error) { ui.alert(`Error occurred: ${error.message}`); } }
How the workflow with Google Sheets menu helps
There are many advantages to this complete automation:
- No constant copying of data when retrieving news and creating articles.
- Colleagues do not need access to n8n.
- You decide yourself when data is passed on instead of rigid workflows or folders
This is a great approach, especially for pragmatic scenarios such as data transfer, reporting or small automations: quick to implement, easy to understand and flexibly expandable.
You can get n8n here using our affiliate partner link (we earn a little commission if you order):