[Gmail] Delete Email
The [Gmail] Delete Email block moves a specified email to the trash in a connected Gmail account.
Move a Gmail message to trash by ID
The [Gmail] Delete Email block moves a specified email to the trash in a connected Gmail account. This is a recoverable delete operation, meaning the message is not permanently removed and can be restored from the trash. The block targets a single message at a time, identified by its Gmail message ID.
The block takes two inputs: a required messageId string representing the Gmail message to be trashed, and an optional connectionId string that references the Google OAuth connection to use. Because the output is void, the block does not return any data — it performs the action and passes control to the next step in the workflow.
This block fits into workflows that manage email inboxes programmatically, such as automated cleanup pipelines, post-processing flows that discard emails after extracting their content, or moderation workflows that remove unwanted messages based on rules or AI classification.
What you can build
Real-world workflows powered by the [Gmail] Delete Email block.
Automated Inbox Cleanup
After categorizing emails with an AI classifier, automatically trash messages that match unwanted categories like spam or promotions.
Post-Extraction Email Removal
Once a workflow extracts data from an email — such as an invoice or order confirmation — trash the original message to keep the inbox clear.
Duplicate Email Deduplication
Identify duplicate emails in a batch processing workflow and trash the redundant copies while retaining the original.
Support Ticket Archival
After a support email has been logged to a CRM or ticketing system, trash the Gmail message to signal it has been handled.
Scheduled Digest Cleanup
After a daily digest workflow aggregates newsletter content into a summary, trash the individual newsletter emails automatically.
Rule-Based Email Moderation
Evaluate incoming emails against defined criteria and trash messages that fail content or sender validation checks.
Ready to add [Gmail] Delete Email to your workflow?
Get Started FreeCommon questions about [Gmail] Delete Email
What parameters does this block require?
The block requires a messageId string, which is the Gmail message ID of the email to be trashed. The connectionId field is optional and specifies which Google OAuth connection to use when multiple connections are configured.
What does this block return?
The block returns void, meaning it produces no output data. It performs the trash action and then passes control to the next block in the workflow.
Is the delete permanent?
No. The block moves the email to the Gmail trash rather than permanently deleting it. The message remains recoverable from the trash until it is emptied.
What kinds of workflows commonly use this block?
This block is commonly used in inbox management workflows, post-processing pipelines that extract data from emails before discarding them, and automated moderation flows that remove messages based on classification or rule evaluation.
How does the block authenticate with Gmail?
The block connects to Gmail through a Google OAuth connection, referenced by the optional connectionId field. The connection must have the appropriate Gmail modify scope to perform trash operations.
Related capabilities
[Google] Create Google Doc
Create a new Google Document and optionally populate it with content.
[Google] Update Google Doc
Update the contents of an existing Google Document.
[Google] Fetch Google Doc
Fetch the contents of an existing Google Document.
[Google] Create Google Sheet
Create a new Google Spreadsheet and populate it with CSV data.
[Google] Update Google Sheet
Update a Google Spreadsheet with new data.
[Google] Fetch Google Sheet
Fetch contents of a Google Spreadsheet range.
Add [Gmail] Delete Email to your workflow
Build powerful AI workflows with drag-and-drop blocks. No coding required.