Skip to content

Weekly

Back up your Salesforce records every week

A CSV copy of your accounts, contacts and opportunities is sent to you every week.

Runs
Weekly
Apps
Salesforce
AI
Not needed
Access
api (read)

Send this to your assistant

Create a ClickRuntime automation: every Sunday at 11pm, export my Salesforce Accounts, Contacts and Opportunities to CSV and email them to me.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Salesforce holds a company's customer list, contacts and deals, yet many small teams have no copy outside it. A bad bulk update, a misconfigured import or a departing admin deleting records can damage data, and the Recycle Bin only holds items for a limited time. Salesforce's own data export service is available but runs on its own schedule and requires someone to remember to download the files. When a problem is discovered two months later, there is nothing to restore from.

Once a week the automation runs a SOQL query for each of accounts, contacts and opportunities, following the nextRecordsUrl so large objects are fully retrieved. It builds a CSV for each and emails them to you. That gives you dated files you control outside Salesforce. It suits small and mid-sized teams that want a simple safety copy and an easy way to compare data across weeks.

What you get out of it

  • A copy outside the CRM

    If records are changed or deleted by mistake, you have a recent file to compare against. Recovery starts from a known state instead of from guesses about what the data looked like.

  • Protection against bulk update errors

    A wrong mass update can overwrite thousands of rows before anyone notices. Last week's CSV lets you identify exactly which values changed and restore them, which would be very hard from memory.

  • Handy for audits and handovers

    When an accountant, auditor or new sales head asks for a customer list as of a given week, you have it. Weekly files provide a dated record without a manual export each time.

  • Large objects handled completely

    The query follows pagination, so objects with tens of thousands of rows are exported in full. A quick manual report would silently cut off at a view's row limit and give a false sense of safety.

  • Weekly rhythm without a calendar reminder

    Nobody has to remember to click Export. The backup arrives on schedule, so it exists on the day it is needed rather than being intended for next week. A weekly file from the first of the quarter is just as complete as one from yesterday.

How it works

What happens, step by step

  1. Once a week, the automation reads all your Salesforce accounts, contacts and opportunities, however many there are.

  2. Each set is turned into a CSV file with its key fields.

  3. The files are emailed to you, with the record count for each in the subject line.

Before it runs live

  • Connect Salesforce

What you get

RunsWeekly
Back up your Salesforce records every weektoday, 9:00Succeeded
Email · Salesforce backup: Accounts (1,042)Id,Name,Industry,Website,CreatedDate 0015g00000AbCdE,Northwind Traders,Wholesale,northwind.example,2025-03-14

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

  • Run it at a different time, more or less often, or only on weekdays
  • 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 Salesforce steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
weekly_csv_backup_of_key_objects.pyexample
import csv, io
from clickruntime import on_trigger, credentials, http, notify

INSTANCE = "https://yourcompany.my.salesforce.com"
QUERIES = {
    "Accounts": "SELECT Id, Name, Industry, Website, CreatedDate FROM Account",
    "Contacts": "SELECT Id, FirstName, LastName, Email, AccountId FROM Contact",
    "Opportunities": "SELECT Id, Name, StageName, Amount, CloseDate, AccountId FROM Opportunity",
}

@on_trigger
def run(event):
    headers = {"Authorization": f"Bearer {credentials.connection('salesforce', 'work')}"}
    counts = {}
    for name, soql in QUERIES.items():
        page = http.get(f"{INSTANCE}/services/data/v61.0/query", headers=headers, params={"q": soql}).json()
        rows = page["records"]
        while page.get("nextRecordsUrl"):
            page = http.get(INSTANCE + page["nextRecordsUrl"], headers=headers).json()
            rows += page["records"]
        out = io.StringIO()
        writer = csv.DictWriter(out, fieldnames=[f for f in rows[0] if f != "attributes"] if rows else ["Id"], extrasaction="ignore")
        writer.writeheader()
        writer.writerows(rows)
        notify.email_me(f"Salesforce backup: {name} ({len(rows)})", out.getvalue())
        counts[name] = len(rows)
    return counts

FAQ

Common questions

Does the CSV include every field on each object?
It includes the fields named in the query. Typically that is the standard fields plus any custom ones you list. Tell your AI assistant which fields you need, and keep sensitive fields out if the file will be emailed widely.
Will large files fit in an email?
Email attachments have size limits, often around 25 MB. For very large orgs the files may exceed that, in which case the automation can be set to send a link or split the output. Check the sizes after the first run.
Is this a replacement for Salesforce's own backup tools?
It is a lightweight copy of selected objects as flat files. It does not capture metadata, attachments or relationships the way dedicated backup products do, so treat it as a useful safety net rather than a full disaster recovery plan.
What permissions does it need?
api (read). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Back up your Salesforce records every week” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.