Skip to content

On a schedule

Back up workflows to GitHub and document them in Notion

Each week your workflow definitions are saved to GitHub, and every changed workflow gets a plain-language description in your Notion database.

Runs
On a schedule
Apps
GitHub, Notion
AI
Yes, uses the built-in AI allowance
Access
GitHub contents:write; Notion read+write

Send this to your assistant

Create a ClickRuntime automation: every Sunday, fetch our workflow definitions, commit changed ones to acme/workflows, have AI describe each changed workflow, update its page in my Notion Workflows database, and tell #ops in Slack.

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

An operations team runs dozens of internal workflows built by different people over the years. Nobody is sure what half of them do, and when a builder leaves, their workflows become a mystery that nobody dares touch.

Backing up each workflow to GitHub and keeping a plain description of it in Notion gives the team both a safety net and a manual. New staff can read what each workflow does, and any change is recorded with its history.

What you get out of it

  • Workflows are documented

    Every workflow has a Notion page explaining what it does in plain words. Knowledge does not leave with the person who built it.

  • Descriptions stay current

    When a workflow changes, its description is rewritten. The documentation does not drift out of date.

  • History and recovery

    GitHub keeps every version. A broken change can be compared and rolled back.

  • The team hears about changes

    A Slack message lists what changed each week. Unexpected changes get questioned.

How it works

What happens, step by step

  1. Every week, ClickRuntime fetches your workflow definitions.

  2. It compares each with the copy in your GitHub repository and saves the ones that changed.

  3. AI writes a plain-language description of each changed workflow.

  4. The workflow's page in your Notion database is created or updated with the description and GitHub link.

  5. A summary is posted to your #ops Slack channel.

Before it runs live

  • Connect GitHub
  • Connect Notion and share the database you want it to use

What you get

RunsOn a schedule
Back up workflows to GitHub and document them in Notiontoday, 9:00Succeeded
Slack · #opsWorkflows backed up and documented: New customer welcome, Invoice reminder

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 GitHub and Notion 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_workflows_to_github_and_document_them_in_notion.pyexample
import base64, json
from clickruntime import on_trigger, credentials, http, notify, ai

def gh(method, path, **kw):
    resp = http.request(method, f"https://api.github.com{path}", headers={
        "Authorization": f"Bearer {credentials.connection('github', 'work')}", "Accept": "application/vnd.github+json"}, **kw)
    return resp.raise_for_status() or (resp.json() if resp.content else None)
def notion(method, path, **kw):
    resp = http.request(method, f"https://api.notion.com/v1{path}", headers={
        "Authorization": f"Bearer {credentials.secret('NOTION_TOKEN')}", "Notion-Version": "2022-06-28"}, **kw)
    return resp.raise_for_status() or resp.json()

REPO, DB, EXPORT_URL = "acme/workflows", "your-notion-database-id", "https://tools.acme.example/api/workflows"

@on_trigger
def run(event):
    changed = []
    for wf in http.get(EXPORT_URL, headers={"Authorization": f"Bearer {credentials.secret('EXPORT_TOKEN')}"}).json():
        path, content = f"workflows/{wf['id']}.json", json.dumps(wf, indent=2, sort_keys=True) + "\n"
        try:
            current = gh("GET", f"/repos/{REPO}/contents/{path}")
        except Exception:
            current = None
        if current and base64.b64decode(current["content"]).decode() == content:
            continue
        gh("PUT", f"/repos/{REPO}/contents/{path}", json={"message": f"Update {wf['name']}", "content": base64.b64encode(content.encode()).decode(), **({"sha": current["sha"]} if current else {})})
        desc = ai.generate(content[:12000], system="Describe what this workflow does in 3 plain sentences for a new team member.", max_output_tokens=200).text
        props = {"Name": {"title": [{"text": {"content": wf["name"]}}]}, "Description": {"rich_text": [{"text": {"content": desc}}]},
                 "GitHub": {"url": f"https://github.com/{REPO}/blob/main/{path}"}}
        found = notion("POST", f"/databases/{DB}/query", json={"filter": {"property": "Name", "title": {"equals": wf["name"]}}})["results"]
        notion("PATCH", f"/pages/{found[0]['id']}", json={"properties": props}) if found else notion("POST", "/pages", json={"parent": {"database_id": DB}, "properties": props})
        changed.append(wf["name"])
    if changed:
        notify.slack("Workflows backed up and documented: " + ", ".join(changed), channel="#ops")
    return {"changed": changed}

FAQ

Common questions

What does the Notion database need?
A title property for the workflow name, a text property for the description, and a URL property for the GitHub link. You can add others, such as owner.
Are unchanged workflows described again?
No. Only new or changed workflows are sent to AI and updated in Notion, which keeps it quick.
Can my team edit the descriptions?
Yes, but a later change to the workflow will replace the description. Put your own notes in a separate property to keep them.
What permissions does it need?
GitHub contents:write; Notion read+write. 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 (on a schedule). 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 workflows to GitHub and document them in Notion” from your assistant

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