GitOps for n8n - version your workflows in Git, let AI agents create automations

Hey everyone!

I built n8n-starter, a Docker Compose setup that adds GitOps to n8n.

The problem

n8n has no native workflow versioning. If your instance dies, your workflows die with it. And there’s no way for AI agents to programmatically create workflows.

What it does

  • Git as source of truth — every workflow and credential is a JSON file in your repo
  • Two-way sync — save in the n8n UI → auto-exports to disk via external hooks. Deploy from Git → auto-imports on startup
  • AI agent integration — Claude Code, GPT, or any agent can create workflows by writing a JSON file to workflows/ and committing. No n8n UI needed
  • Docker Compose ready — n8n + workers + Postgres + Redis, scalable with docker compose up -d --scale n8n-worker=5
  • Dev and prod modes — dev has live sync, prod is import-only with read-only credentials

How AI agents work with it

Any AI agent just writes a valid n8n workflow JSON file to the workflows/ folder and commits. On next deploy, the init container picks it up. Branch = environment (main → prod, feature branches → staging).

This makes n8n workflows fully programmable — an agent can design, test, and ship automations without ever touching the UI.

Quick start

git clone https://github.com/gabry-ts/n8n-starter.git
cp .env.example .env
docker compose up -d

Would love feedback from the community. Anyone else doing GitOps with n8n?