Every 15 minutes
File Outlook attachments in OneDrive
Attachments you receive are saved to OneDrive in a folder per sender.
- Runs
- Every 15 minutes
- Apps
- Outlook
- AI
- Not needed
- Access
- read mail + write files (Files.ReadWrite)
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, save new attachments from my Outlook inbox to OneDrive under Attachments/<sender name>.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A bookkeeper receives receipts, bank statements and contracts as email attachments throughout the day, and each one has to be saved to the right client folder. Downloading, renaming and dragging files takes a minute or two each, and during busy periods attachments sit in the inbox for weeks. When a client asks for a particular statement, she searches her mail and hopes the sender used a sensible subject line.
Every 15 minutes, new Outlook messages with attachments are listed, each attachment is downloaded, and it is placed in a OneDrive folder path you define, for example by sender or by month. The files are then available in OneDrive, backed up and shareable, regardless of what happens to the original email.
It suits bookkeepers, recruiters collecting resumes, property managers receiving certificates and anyone whose work arrives as attachments.
What you get out of it
Files are in the right place when needed
Instead of searching mail for a statement, you open the client folder and find it. The time saved on each lookup adds up over a year of busy periods. That saves effort every time a client or an auditor asks for a specific document.
Attachments survive inbox clean-ups
Once files are in OneDrive, deleting or archiving the email does not lose them. You can clear your inbox without worrying about important documents. That safety net means you can keep your mailbox small and your documents safe.
Sharing becomes simple
A OneDrive file can be shared by link with an accountant or a client, and you do not need to forward the original email and hope the attachment is intact.
Consistent folder structure
Using the same path rules every time gives you folders organized by sender or month. A tidy structure makes audits and handovers less painful. That discipline pays off when you hand the work to a colleague or an accountant during a busy period.
No more manual downloading
Saving attachments one at a time is dull, repetitive and easy to forget. Having it happen on its own gives you back minutes each day and removes a task. That also removes a recurring chore that few people enjoy and many forget.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your Outlook inbox for new emails with attachments since the last check.
It downloads each attachment.
It saves them to OneDrive under Attachments, in a folder named after the sender, so all files from one supplier end up together.
Before it runs live
- Connect Outlook
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Outlook steps into one automation
Under the hood
The code that runs this automation
import base64
from clickruntime import on_trigger, credentials, http, state, report_fetched
GRAPH = "https://graph.microsoft.com/v1.0"
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
since = state.get("since") or "2026-01-01T00:00:00Z"
msgs = http.get(f"{GRAPH}/me/messages", headers=h, params={
"$filter": f"receivedDateTime gt {since} and hasAttachments eq true",
"$orderby": "receivedDateTime asc", "$select": "id,from,receivedDateTime"}).json()["value"]
report_fetched(len(msgs))
if not msgs:
return {"summary": "Nothing new"}
saved = 0
for m in msgs:
sender = m["from"]["emailAddress"]["address"]
for att in http.get(f"{GRAPH}/me/messages/{m['id']}/attachments", headers=h).json()["value"]:
if att["@odata.type"] != "#microsoft.graph.fileAttachment":
continue
http.put(f"{GRAPH}/me/drive/root:/Attachments/{sender}/{att['name']}:/content",
headers={**h, "Content-Type": "application/octet-stream"}, data=base64.b64decode(att["contentBytes"]))
saved += 1
state.set("since", msgs[-1]["receivedDateTime"])
return {"saved": saved}FAQ
Common questions
Which attachments are saved?
What if two attachments have the same name?
Does it remove the attachment from the email?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Hear in Slack when a top client emails
Emails from the clients you name, or with words you care about, show up in Slack within minutes.
See how it worksGet warned about spoofed emails
You're alerted when a new email fails SPF, DKIM or DMARC checks.
See how it worksPull key fields from emailed invoices and POs
Purchase orders and invoices that arrive in Outlook are read for you, and the supplier, amounts and due date reach you in one summary.
See how it worksKeep exploring
Set up “File Outlook attachments in OneDrive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.