Automated E-commerce Order Logging in Dynamic Google Sheets - n8n Workflow

A robust n8n workflow to automatically log e-commerce orders into dynamically created monthly Google Sheets tabs, complete with conditional formatting and status tracking. Start building custom n8n templates today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Ideal User Persona

E-commerce operations managers needing organized, real-time order tracking.
Technical users looking to leverage the full power of the Google Sheets API via an n8n node to apply complex formatting and validation.
Automation specialists seeking advanced n8n templates for complex flow control and data structuring.
Users of the n8n platform who require monthly or periodic data segregation and tracking.

Overview

This powerful n8n workflow provides a sophisticated solution for centralized e-commerce data logging. Instead of dumping all orders into a single, unwieldy spreadsheet, this automation utilizes the n8n node ecosystem to dynamically create a new sheet tab for every month (e.g., 'JULY ORDERS'24'). When triggered by a new order, the system first checks for the required sheet. If the sheet does not exist, the n8n workflow initiates a sequence of Google Sheets API calls to create the tab, set specific headers, apply date formatting, establish data validation (for tracking status like 'Shipped' or 'Delivered'), and configure advanced conditional formatting for visual status tracking. This complex n8n template ensures data is clean, organized, and immediately actionable, proving the extensive capability of n8n for complex data management tasks.

How it Works

The entire process is initiated by an e-commerce event captured by an n8n trigger.


  1. Webhook Activation (n8n Trigger): The n8n workflow starts when an e-commerce platform sends an order creation event to the dedicated Webhook n8n trigger (Order created).

  2. Configuration and Metadata: The workflow defines the target Google Sheet ID, calculates the required monthly sheet name (Generate Sheet Name n8n node), and retrieves a list of all existing sheet titles using the Get Order Sheets metadata HTTP Request n8n node.

  3. Flow Control: The If n8n node checks if the calculated month name already exists in the retrieved metadata.

  4. Existing Sheet Path (True): If the sheet exists, the n8n workflow prepares the order data (Google Sheets Row values existing), converting the order date into the necessary Google Sheets serial number format, and uses the Google Sheets n8n node (Append to Existing Orders Sheet) to log the new row.

  5. New Sheet Path (False): If the sheet is new, the n8n workflow takes the advanced route:

It executes the Create Month Sheet n8n node (HTTP Request) to create the new tab with the monthly name and freeze the header row.
The Write Headers (A1:I1) HTTP Request n8n node then applies extensive formatting, including defining column headers, applying data validation for the 'Status' field, and configuring several conditional formatting rules (e.g., setting background colors based on status).
* Finally, the row values are prepared, and the Append to Orders Sheet Google Sheets n8n node logs the first order into the perfectly formatted new tab. This shows a high level of customization possible within an n8n workflow.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON and import it directly into your n8n instance as a new n8n workflow.

  2. Webhook Setup: Activate the Order created n8n trigger node. Copy the generated Webhook URL and configure your e-commerce platform (e.g., Shopify, WooCommerce) to send order creation events (POST requests) to this URL.

  3. Google Sheets Credential: Configure your Google Sheets OAuth2 API credentials. Ensure the credentials are set up for both the standard Google Sheets n8n node and the HTTP Request n8n node connections.

  4. Spreadsheet ID: Update the Config (set spreadsheetId) n8n node with your specific Google Spreadsheet ID. This ID can be found in the URL: docs.google.com/spreadsheets/d//.

  5. Timezone Adjustment (Optional): Review the JavaScript expressions in the Generate Sheet Name and Google Sheets Row values n8n nodes if your required timezone is different from 'Asia/Kolkata'.

  6. Activate: Set the n8n workflow to 'Active' to start listening for incoming orders.

Node Details


  • Order created (Webhook n8n Trigger): Serves as the primary entry point and n8n trigger, capturing order payloads from the source system.

  • Config (set spreadsheetId) (Set n8n node): A crucial configuration n8n node where the target spreadsheetId is stored for easy reference across the entire n8n workflow.

  • Get Order Sheets metadata (HTTP Request n8n node): Executes a GET request to the Google Sheets API to fetch existing sheet names. This is vital for the dynamic logic flow.

  • Generate Sheet Name (Set n8n node): Uses JavaScript to dynamically calculate the sheet name (e.g., "MONTH ORDERS'YY") for the current period, ensuring the correct destination is targeted by the n8n node logic.

  • If (If n8n node): The core decision maker of this n8n workflow. It uses a JavaScript expression to check if the dynamically generated sheet name exists, routing the process to either append or create/format.

  • Create Month Sheet (HTTP Request n8n node): Part of the advanced formatting sequence. This n8n node sends a batchUpdate request to create a new spreadsheet tab with a frozen header row.

  • Write Headers (A1:I1) (HTTP Request n8n node): A highly complex n8n node that sets column headers, applies date number formatting, establishes strict data validation rules for the 'Status' column dropdown, and implements multiple conditional formatting rules to color-code status values (Delivered, Cancelled, Shipped).

  • Google Sheets Row values / existing (Set n8n node): These n8n nodes prepare the final data row by mapping incoming webhook fields (Order ID, Customer Name, Line Items, Total Price) and performing critical calculations, such as converting UTC date strings to the Google Sheets serial date number.

  • Google Sheets (Append n8n node): Used twice (Append to Existing Orders Sheet and Append to Orders Sheet) to finalize the n8n workflow by inserting the prepared order data into the correct, dynamically managed monthly tab.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Ruthwik Masina
Ruthwik Masina

Featured*