# Document and backup n8n workflows with OpenAI and GitHub: n8n workflow

> Started by a clock, and works across GitHub, Notion and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/document-and-backup-n8n-workflows-with-openai-and-github (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Document and backup n8n workflows with OpenAI and GitHub

Started by a clock, and works across GitHub, Notion and Slack. It hands the judgement calls to OpenAI. 17 steps, 3 branches: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdocument-and-backup-n8n-workflows-with-openai-and-github)

**17 steps** Medium: a working afternoon

**3** Branches: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 1 Model 1 Logic 5 Service 10

The steps in the order they run, from what starts it.

- 1 **Every Monday at 1am** Schedule trigger *Starts it*
- 2 **Get active workflows with internal-infra tag** N8n *Service*
- 3 **Check if updated in last 7 days** If *Logic*
- 4 **Set fields** Set *Logic*
- 5 **Get notion page with workflow id** Http Request *Service*
- 6 **Map fields** Set *Logic*
- 7 **Check that error workflow has been configured** If *Logic*
- 8 **Summarize what the Workflow does** Open Ai *Model*
- 9 **Upload changes to repo** Github *Service*
- 10 **Notify on workflow setup error** Slack *Service*
- 11 **Is this a new workflow (to Notion)?** If *Logic*
- 12 **Create new file in repo** Github *Service*
- 13 **Add to Notion** Notion *Service*
- 14 **Update in Notion** Notion *Service*
- 15 **Notify on create file in repo fail** Slack *Service*
- 16 **Notify internal-infra of push** Slack *Service*
- 17 **Notify internal-infra of update** Slack *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 17, with 3 branches
- **Size:** Medium: a working afternoon
- **Connects to:** GitHub, Notion, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own GitHub, Notion and Slack accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 17 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 17 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fdocument-and-backup-n8n-workflows-with-openai-and-github)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[GitHub](https://millionrounds.com/workflows?service=GitHub#library)[Notion](https://millionrounds.com/workflows?service=Notion#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Aggregate & update documentation from Slack, Teams & GitHub** 17 steps · calls a model · GitHub, Gmail](https://millionrounds.com/workflow/aggregate-and-update-documentation-from-slack-teams-and-gith)
- [**Airtable base backups to S3 with Slack** 17 steps · Airtable, S3](https://millionrounds.com/workflow/airtable-base-backups-to-s3-with-slack)
- [**Restore n8n workflows from GitHub JSON backups** 17 steps · GitHub, n8n data table](https://millionrounds.com/workflow/restore-n8n-workflows-from-github-json-backups)
- [**Track contract renewals with Google Sheets and Slack** 16 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/track-contract-renewals-with-google-sheets-and-slack)
- [**Classify and route email attachments with Gmail** 18 steps · Gmail, Google Drive](https://millionrounds.com/workflow/classify-and-route-email-attachments-with-gmail)
- [**Send TurboDocx e-signature contracts from Excel with Slack** 16 steps · Excel, Slack](https://millionrounds.com/workflow/send-turbodocx-e-signature-contracts-from-excel-with-slack)
