Skip to content

Daily

Commit nightly config backups to GitLab

Exports from your tools are saved to a repo each night, with a commit only when something changed.

Runs
Daily
Apps
GitLab
AI
Yes, uses the built-in AI allowance
Access
api (write_repository)

Send this to your assistant

Create a ClickRuntime automation: every night at 3am, export my configurations from this API, commit any files that changed to the backups repo in GitLab, and email me a short summary.

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

Operations teams often keep valuable work in tools that have no real version control: automation workflows, dashboards, form definitions, saved queries. One careless edit overwrites a flow that took a week to build, and the vendor's own history, if any, goes back only a few versions. When something breaks, nobody can say what the working version looked like.

Each night the items are fetched and each is compared with the matching file in your GitLab repository. Changed files are created or updated together in a single commit, so the history shows one clean entry per night. If you wish, ClickRuntime's built-in AI writes a short README for each file, and an email summarizes what changed.

It fits teams that self-host GitLab, agencies that archive client configurations and operations leads who want a restore point they control.

What you get out of it

  • One commit per night keeps history tidy

    Bundling all changed files into a single commit means the log reads as one entry per night, which makes it easy to find the day something broke and compare it with the day before.

  • Restoring is a copy and paste

    When a workflow is damaged, the last good JSON is already in your repository, so recovery takes minutes and does not depend on rebuilding from memory or screenshots. That speed matters most when a client or manager is waiting.

  • Your backups stay in your own system

    Keeping copies in a GitLab repository you control, perhaps on your own server, avoids relying on a vendor's retention policy or an export button that someone has to remember. Retention and access then follow your own rules.

  • README files explain what you saved

    The optional AI-written README for each file describes what the item does, so a colleague who finds the backup a year later can understand it without opening the original tool.

  • The email flags unexpected changes

    A summary of changed files shows when something was edited outside a planned change, which is often the first sign of an accidental or unauthorized edit. Early notice limits how long a bad change can go unnoticed.

How it works

What happens, step by step

  1. Every night ClickRuntime exports the configuration from your tools.

  2. It compares each export with the copy already in your GitLab repository.

  3. Only when something has changed does it save the new or updated files together in one commit.

  4. AI can add a short readme describing each file, and you get an email summing up what changed.

Before it runs live

  • Connect GitLab

What you get

RunsDaily
Commit nightly config backups to GitLabtoday, 9:00Succeeded
Email · Nightly backupBackup committed: 3 files Two workflows were updated and one new configuration, billing-sync, was added.

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
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other GitLab 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.
back_up_files_to_a_gitlab_repository_on_a_schedule.pyexample
from urllib.parse import quote
import json
from clickruntime import on_trigger, credentials, http, notify, ai

GITLAB = "https://gitlab.com/api/v4"

def gl_headers():
    return {"PRIVATE-TOKEN": credentials.secret("GITLAB_TOKEN")}

PROJECT = quote("acme/backups", safe="")
SOURCE = "https://api.example.com/v1/configurations"

@on_trigger
def run(event):
    configs = http.get(SOURCE, headers={"Authorization": f"Bearer {credentials.secret('SOURCE_API_KEY')}"}).json()
    actions = []
    for item in configs:
        path, content = f"configs/{item['id']}.json", json.dumps(item, indent=2)
        current = http.get(f"{GITLAB}/projects/{PROJECT}/repository/files/{quote(path, safe='')}/raw",
                           headers=gl_headers(), params={"ref": "main"})
        if current.status_code == 404 or current.text != content:
            actions.append({"action": "create" if current.status_code == 404 else "update", "file_path": path, "content": content})
    if not actions:
        return {"changed": 0}
    http.post(f"{GITLAB}/projects/{PROJECT}/repository/commits", headers=gl_headers(),
              json={"branch": "main", "commit_message": f"Backup: {len(actions)} files changed", "actions": actions}).raise_for_status()
    summary = ai.generate("Summarise these backup changes in two sentences:\n" + "\n".join(f"{a['action']} {a['file_path']}" for a in actions),
                          max_output_tokens=120).text
    notify.email_me(f"Backup committed: {len(actions)} files", summary)
    return {"changed": len(actions)}

FAQ

Common questions

Does it only commit files that changed?
Yes. Each fetched item is compared with the existing file in the repository, and only differences are written. A night with no changes produces no commit, so the history never fills with identical copies. Only genuine differences are committed.
Do I need a self-hosted GitLab?
No. It works with GitLab.com or a self-managed instance. You provide the project and an access token that can write to the repository, and the token is stored as a secret in ClickRuntime. Nothing needs to be installed on the server.
What will the AI README contain?
A short plain-language description of each saved item, such as what a workflow does and what it connects to. It is optional, and you can leave it off if you only want the raw files committed.
What permissions does it need?
api (write_repository). Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it runs (daily). 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 “Commit nightly config backups to GitLab” from your assistant

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