Latenode

Gmail inbox cleanup

Run on a Tools schedule, search Gmail with a query you define (sender, subject, labels), evaluate messages in JavaScript, and call Gmail again to archive, label, or trash matches. Latenode stays the policy engine—no Zapier-shaped glue in the integration list.

Updated May 8, 2026Est. run: 9sEst. cost: $0.0006
How Latenode estimates time and cost

Latenode bills workflow runs in credits: 1 credit = 30 seconds of processing. Minimum charge per run depends on your plan. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how credits work →
Email

Workflow preview

What this template does

  • Keeps destructive logic in JavaScript you can review in git.
  • Gmail OAuth scopes can be minimized to what the rule needs.
  • Tools documents when automation touches mail.

How it works

1
Trigger

Timer

Tools starts the job.

2
Action

Fetch candidates

Gmail returns message ids matching the query.

3
Logic

Decide

JavaScript drops false positives.

4
Action

Apply

Second Gmail call mutates messages.

Setup guide

1

Connect Gmail

Scopes for read + modify as required.

2

Test query in UI

Paste the same query the node will use.

3

Pilot with archive

Before trashing, archive for a week.

Requirements

Google Workspace / Gmail account with API access
Clear written policy for what may be deleted
Backup mindset—irreversible trash should be gated

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.

More templates

You might also like

Browse all templates →
Email

Automatically sync IMAP emails to a Google Sheets spreadsheet

This automation allows users to monitor an IMAP email account for new messages and automatically add the data from each incoming email as a new row in a Google Sheets spreadsheet. It is designed to help individuals and teams stay on top of their email communications and easily track and organize email data in a structured spreadsheet format. The automation integrates the IMAP email service and the Google Sheets spreadsheet to streamline this common email management task.

6s$0.0003
Email

Sync Outlook calendar events to Harvest for automated time tracking

This automation template allows users to automatically create a corresponding time entry in Harvest, a time tracking and invoicing application, whenever a new calendar event is scheduled in Microsoft Outlook. The automation pulls in key details from the calendar event, such as the title, date, and duration, and uses this information to populate the Harvest time entry. This integration streamlines the process of logging work time, ensuring that billable hours are accurately tracked and recorded. The primary user for this automation would be professionals who rely on both Outlook and Harvest to manage their schedules and finances, seeking a seamless way to bridge these two tools.

7s$0.0004
Email

Streamline Outlook email management with ChatGPT-powered replies

This automation allows Outlook users to generate AI-based email replies by processing incoming messages with ChatGPT. The solution integrates with Microsoft Outlook, analyzing each incoming email and then drafting a personalized response using the power of large language models. Once the AI-generated reply is ready, the automation can either automatically send the message or present it to the user for review before sending. This streamlines the email management process, enabling users to quickly and intelligently respond to a high volume of messages with minimal effort.

19s$0.0012