AutomationFlowsEmail & Gmail › Daily Auto-archive for Gmail Messages

Daily Auto-archive for Gmail Messages

ByNiranjan G @niranjan on n8n.io

Professionals, solopreneurs, or productivity enthusiasts who want to keep their Gmail inbox clean and organized without manual effort.

Cron / scheduled trigger★★☆☆☆ complexity4 nodesGmail
Email & Gmail Trigger: Cron / scheduled Nodes: 4 Complexity: ★★☆☆☆ Added:

This workflow corresponds to n8n.io template #4679 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "61682ff7-397d-4ecb-a98f-91d45d5a07a1",
      "name": "Daily Trigger at 4AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -140,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 4
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "84a83cf9-63fc-40cf-bfa6-bc01ad67b3b7",
      "name": "Fetch Gmail Inbox Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        80,
        160
      ],
      "parameters": {
        "filters": {
          "labelIds": "={{ [\"INBOX\"] }}",
          "receivedBefore": "={{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "29939c36-30d1-499a-9c1b-9d3e4c4c9ba5",
      "name": "Split Each Email",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        300,
        160
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "id"
      },
      "typeVersion": 1
    },
    {
      "id": "316ad247-78c2-4fbb-b420-94bb8fb354f3",
      "name": "Archive Message (Remove INBOX Label)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        520,
        160
      ],
      "parameters": {
        "labelIds": [
          "INBOX"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "removeLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Split Each Email": {
      "main": [
        [
          {
            "node": "Archive Message (Remove INBOX Label)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Trigger at 4AM": {
      "main": [
        [
          {
            "node": "Fetch Gmail Inbox Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Gmail Inbox Emails": {
      "main": [
        [
          {
            "node": "Split Each Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive Message (Remove INBOX Label)": {
      "main": [
        []
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Professionals, solopreneurs, or productivity enthusiasts who want to keep their Gmail inbox clean and organized without manual effort.

Source: https://n8n.io/workflows/4679/ — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

Managing Gmail manually can be tedious and time-consuming. Spam, Promotions, Social, and Trash folders quickly fill up with unwanted emails, taking up valuable storage and creating clutter. This workf

Gmail
Email & Gmail

This workflow uses Gmail to send outreach emails to new Hubspot contacts that have yet to be contacted (usually unknown contacts), and records the outreach in Hubspot. Setup HubSpot Oauth2 creds (Be c

Gmail, HubSpot
Email & Gmail

The aim of the AI Latest 24 Update Workflow is to automate the daily collection and distribution of the most recent Artificial Intelligence and Technology news from the past 24 hours. It ensures users

Perplexity, Gmail
Email & Gmail

This automated n8n workflow uses the Gmail API to clean the spam folder by permanently deleting all emails on the first day of each month. The system ensures efficient email management and improves Gm

Gmail
Email & Gmail

If you hate SPAM emails or don't want to clean them up frequently.

Gmail