New to Kestra?
Use blueprints to kickstart your first workflows.
Automatically push Kestra flows and namespace files to a Git repository on a schedule for GitOps version control, audit history, and backups.
Keep your Git repository in sync with what is actually running in Kestra. This flow automatically pushes flow definitions and namespace files to GitHub every 15 minutes, giving you continuous version control, audit history, and a reliable backup of your orchestration code without anyone remembering to commit. It closes the gap between the code editing in the Kestra UI and a Git-backed GitOps workflow, so every change is tracked, reviewable, and recoverable.
A io.kestra.plugin.core.trigger.Schedule trigger fires on the cron */15 * * * *, running the flow every 15 minutes. On each run:
push_flows task (io.kestra.plugin.git.PushFlows) exports all flows (flows: "*") from the dev source namespace, including child namespaces, and commits them to the _flows directory on the kestra branch. It can retarget them to a prod namespace via targetNamespace, with a commit message stamped using {{ now() }}.push_namespace_files task (io.kestra.plugin.git.PushNamespaceFiles) exports all namespace files (files: "*") from the dev namespace into the _files directory and commits them on the dev branch.Both tasks authenticate to https://github.com/kestra-io/scripts with a username and a token stored in {{ secret('GITHUB_ACCESS_TOKEN') }}. They run with dryRun: true so you can preview the exact diff before flipping to real commits.
dryRun preview before any real pushGit itself has no scheduler and no awareness of your Kestra instance: it cannot decide when to snapshot your flows or pull them out of the platform. Kestra fills that gap. Event and schedule triggers drive the sync automatically, retries handle transient network or auth failures, and execution history gives you lineage for every push. Everything is declared in plain YAML, so the backup pipeline is itself versioned and reproducible. You can swap the schedule for an event trigger, fan out to multiple repositories, or gate pushes behind approvals, none of which a raw git cron job can express cleanly.
dev namespacekestra-io/scripts)plugin-git plugin available (bundled with Kestra)GITHUB_ACCESS_TOKEN: a GitHub personal access token (or fine-grained token) with write access to the target repository.GITHUB_ACCESS_TOKEN secret to Kestra.url, username, branch, and the source/target namespaces to match your setup.dryRun: true and inspect the planned commit in the logs.dryRun: false on both tasks to start pushing for real.cron if 15 minutes is too frequent or not frequent enough.Schedule trigger with a flow trigger to push only after deployments.push_flows at additional namespaces or pin specific flows instead of "*".io.kestra.plugin.git.SyncFlows to build a full two-way GitOps loop.