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.
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
Every night ClickRuntime exports the configuration from your tools.
It compares each export with the copy already in your GitLab repository.
Only when something has changed does it save the new or updated files together in one commit.
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
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
- 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
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?
Do I need a self-hosted GitLab?
What will the AI README contain?
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
Block merge requests that break a rule
When a merge request changes, it is checked against your rule and gets a failing commit status if it breaks it.
See how it worksGet an email for each review request
Whenever you are added as reviewer on a merge request, you get its title and link by email.
See how it worksAnnounce opened and merged MRs in Slack
Your channel hears when a merge request in your project is opened or merged.
See how it worksKeep exploring
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.