CRUD REST API Using Google Sheets Database - n8n Workflow

Build a robust CRUD REST API quickly using this n8n workflow, leveraging Google Sheets as your serverless database. This powerful n8n template handles POST, GET, PUT, and DELETE requests.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Developers and prototypers who need a fast, serverless backend.

  • Technical users looking for practical n8n templates for data management.

  • Anyone needing to expose Google Sheet data via a standard REST API endpoint.

  • Automation specialists seeking to implement complex logic using the n8n node structure.

Overview

Creating a reliable backend for prototypes or internal tools often requires setting up a database and handling endpoint logic. This process is simplified dramatically by using this comprehensive n8n workflow. This n8n template transforms a standard Google Sheet into a fully functional REST API, managing all Create, Read, Update, and Delete (CRUD) operations via separate, dedicated n8n trigger webhooks. This approach eliminates the need for traditional server code, offering a fast, scalable, and low-code solution. Each specific n8n node in this configuration is optimized for its respective task, ensuring efficient data manipulation in Google Sheets.

How it Works

This n8n workflow operates using five distinct, parallel branches, each activated by a specific type of API request (n8n trigger):


  1. Create (POST /items): The Webhook: Create n8n trigger (HTTP POST) receives the data payload (name, email, status) and passes it directly to the Append row in sheet n8n node, which adds the new record to the bottom of the Google Sheet. The flow then sends a 'Record created' success response.

  2. Read All (GET /items/all): The Webhook: Read All n8n trigger (HTTP GET) initiates the reading of the entire dataset. The subsequent Get rows in sheet n8n node retrieves all records, which are then returned as the API response via the Respond to Webhook: Read All node.

  3. Read Single (GET /items?id=X): The Webhook: Read n8n trigger (HTTP GET) accepts an ID via a query parameter. The Get row in sheet n8n node uses this id to filter and retrieve a specific row (by row number) from the Google Sheet.

  4. Update (PUT /items?id=X): The Webhook: Update n8n trigger (HTTP PUT) captures both the row ID (via query parameter) and the updated fields (via the request body). The flow uses the Prepare Fields for Update n8n node to correctly structure this data, passing the row number and the fields to the Update row in sheet n8n node, which performs the modification.

  5. Delete (DELETE /items?id=X): The Webhook: Delete n8n trigger (HTTP DELETE) receives the target row ID via a query parameter. The Delete rows or columns from sheet n8n node uses this row number as the starting index to delete the specific record, completing the required functionality of this n8n workflow.

Installation Guide

To deploy this useful n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and paste it into your n8n instance using the 'Import Workflow' function.

  2. Google Sheet Setup: Ensure you have a Google Sheet set up with the required headers: name, email, and status. Make sure this sheet is shared with the Service Account email address you will use for authentication.

  3. Credential Configuration: For all Google Sheets n8n node instances, set up or select your Google Service Account credentials. This is essential for the n8n workflow to interact with your sheet.

  4. Node Configuration: In every Google Sheets n8n node, ensure the correct Document ID and Sheet Name are selected, matching the sheet you prepared.

  5. Activate Webhooks: Save and activate the n8n workflow. The specific n8n trigger URLs for POST, GET, PUT, and DELETE operations will now be live, ready for external consumption.

Node Details

This n8n workflow template relies on precise configuration of several core n8n node types:

Webhook Nodes (n8n trigger): Five separate webhook nodes are used, sharing the base path but differentiated by HTTP method and endpoint structure to define the CRUD paths (/items for POST/PUT/DELETE, /items/all for GET all). These nodes act as the primary n8n trigger for the entire API.
Google Sheets Node (Append row in sheet): Used for the Create operation. It maps incoming JSON body data ($json.body.name, $json.body.email, etc.) directly into new spreadsheet rows.
Google Sheets Node (Get rows in sheet): Used for the Read All operation. Set to simply retrieve all rows from the specified sheet.
Google Sheets Node (Get row in sheet): Used for Read Single. Configured with a filter where lookupColumn is rownumber and the lookupValue is derived from the incoming URL query parameter ($json.query.id).
Set Node (Prepare Fields for Update): A crucial intermediary n8n node for the Update operation. It dynamically merges the ID received from the query string ($json.query.id) with the data body, structuring the output correctly for the subsequent Update n8n node.
Google Sheets Node (Update row in sheet): Used for the Update operation. It uses row
number (sourced from the Set node output) as the matching column to locate and overwrite the correct record.
Google Sheets Node (Delete rows or columns from sheet): Used for the Delete operation. It uses the startIndex parameter, populated by the row ID ($json.query.id), to delete a single row.
Respond to Webhook Nodes: These n8n nodes ensure that every operation immediately returns a status message or the requested data back to the API caller.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all

Featured*