# Detect and move duplicate Google Drive files with Supabase: n8n workflow

> Started by an event in a connected app, and works across Google Drive, Slack and Supabase.

Source: https://millionrounds.com/workflow/detect-and-move-duplicate-google-drive-files-with-supabase (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Detect and move duplicate Google Drive files with Supabase

Started by an event in a connected app, and works across Google Drive, Slack and Supabase. 21 steps, 3 branches: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdetect-and-move-duplicate-google-drive-files-with-supabase)

**21 steps** Large: read it before trusting it with anything live

**3** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 1 Logic 11 Service 9

The steps in the order they run, from what starts it.

- 1 **Google Drive Trigger** Google Drive trigger *Starts it*
- 2 **Prepare File Info** Code *Logic*
- 3 **Download File** Google Drive *Service*
- 4 **Validate Binary** If *Logic*
- 5 **Crypto** Crypto *Service*
- 6 **Handle Missing Binary** Code *Logic*
- 7 **Check Hash Exists** Supabase *Service*
- 8 **Prepare Error Log Data** Code *Logic*
- 9 **Same File Re-triggered?** If *Logic*
- 10 **Log Error Event** Supabase *Service*
- 11 **No Operation, do nothing** No Op *Logic*
- 12 **Hash Matched Different File?** If *Logic*
- 13 **Move to Duplicates** Google Drive *Service*
- 14 **Prepare Hash Data** Code *Logic*
- 15 **Notify Duplicate** Slack *Service*
- 16 **Insert New Hash** Supabase *Service*
- 17 **Prepare Dup Log Data** Code *Logic*
- 18 **Handle DB Error** Code *Logic*
- 19 **Log Duplicate Event** Supabase *Service*
- 20 **Prepare Unique Log Data** Code *Logic*
- 21 **Log Unique Event** Supabase *Service*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 21, with 3 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Slack, Supabase
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Google Drive, Slack and Supabase accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdetect-and-move-duplicate-google-drive-files-with-supabase)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Supabase](https://millionrounds.com/workflows?service=Supabase#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Auto-file emailed documents to Clio matters in Google Drive** 21 steps · Email, Google Drive](https://millionrounds.com/workflow/auto-file-emailed-documents-to-clio-matters-in-google-drive)
- [**Track contract signatures and onboard clients with Airtable** 21 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/track-contract-signatures-and-onboard-clients-with-airtable)
- [**Automated database backup with Google Sheets and Slack** 20 steps · Google Sheets, Slack](https://millionrounds.com/workflow/automated-database-backup-with-google-sheets-and-slack)
- [**Extract and triage PDF documents with Claude and Gmail** 20 steps · Airtable, Gmail](https://millionrounds.com/workflow/extract-and-triage-pdf-documents-with-claude-and-gmail)
- [**Parse Google Drive documents to RAG-ready Markdown** 20 steps · Google Drive, Supabase](https://millionrounds.com/workflow/parse-google-drive-documents-to-rag-ready-markdown)
- [**AI agent to chat with OpenAI and Supabase** 22 steps · calls a model · Supabase, Supabase vectors](https://millionrounds.com/workflow/ai-agent-to-chat-with-openai-and-supabase)
