If you have explored our cloud storage integrations, you know that you can be very specific about which folders and which subfolders to sync files from (or not).
However, to be that specific, you need a good understanding of Glob Patterns.
In Tofu, Glob Patterns are used for Directory Filters, to determine which folders to sync your files from in your cloud storage.
Below, we compiled a very clear guide of these patterns that should help you achieve perfection of your cloud storage directory filters!
Quick reference Glob Patterns Table
Pattern | What it includes |
| Everything inside your connected folder, no matter how deep it is (files in the folder and in the subfolders) |
| Any single folder that sits one level inside your connected folder. |
| Only the “Folder” itself (files directly inside it, not its subfolders). |
| Only the “Sub” folder inside “Folder” (files directly inside “Sub”). |
| Any single subfolder inside “Folder” (files directly inside those subfolders). |
| “Folder” and every subfolder inside it at any depth. |
| Any folder named “Folder” that sits exactly one level inside your connected folder (for example, |
| That “Folder” one level in, plus everything under it. |
| Any folder named “Folder” anywhere inside your connected folder. Files directly inside each one. |
| Any folder named “Folder” anywhere, plus everything under each one. |
| A folder named “B” that is two levels below “A” (one folder in between). Files directly inside “B.” |
| That “B” two levels below “A,” plus everything under it. |
| A folder named “B” somewhere under “A” (any depth). Files directly inside “B.” |
| That “B” under “A,” plus everything under it. |
| Folders exactly two levels below “A.” Files directly inside those folders. |
| Folders exactly two levels below “A,” plus anything deeper under them. |
See it with an example
**/Invoices→ files directly inside bothFinance/InvoicesandSales/Invoices.**/Invoices/**→ everything inside both Invoices folders, including2024and2025.*/Invoices/**→ only Invoices folders that are one level inside the connected folder (here:Finance/InvoicesandSales/Invoices, not deeper ones).Finance/**→ everything under Finance.Sales/*→ only the first-level folders inside Sales (Invoices,Regions).Sales/*/**→ those first-level folders and everything under them.
Another Example: subfolder of multiple folders
In this GDrive integration example, the accounting firm wants to sync all files in the AP invoices folders inside every year's folder.
They do not want to sync
Files directly in the Client A folder
Files directly in the 2024 or 2025 folder
Files inthe AR folders in 2024 and 2025.
Using Tofie AI assistance to set up folder directories, this is the result
Common requests (what to type in directory filters)
“Use everything I connected” →
**“Use just this one folder (no subfolders)” →
Folder“Use this folder and all subfolders” →
Folder/**“Use every folder named ‘Reports’ anywhere (just the files inside each ‘Reports’)” →
**/Reports“Use every ‘Reports’ folder and their subfolders” →
**/Reports/**“Use folders exactly two levels below ‘Projects’ (not deeper)” →
Projects/*/*“Use those same folders plus everything deeper” →
Projects/*/*/**
Example: “I want files in any ‘Invoices’ folder anywhere (including its subfolders).”
Type: **/Invoices/**
If you only want the files directly in each “Invoices” (not its subfolders), type: **/Invoices
Do’s and Don’ts
Do
Start specific (e.g.,
Team/ClientA/**).If you don’t see enough files, make it a little broader (e.g.,
Team/**).
Don’t
Don’t add file names or extensions (like
.pdforreport.docx).Don’t try to exclude folders (no
!patternsupported).Don’t use partial-name wildcards (like
Q*1). Only use*and**as shown.
Notes and limits (simple)
Patterns pick folders. All files inside matched folders are included.
No exclusions and no partial-name matches—just
*(one level) and**(any depth).Keep patterns as specific as possible to avoid pulling in folders you don’t want.
Where do I put the pattern?
In your client entity





