PushFlows icon
PushNamespaceFiles icon
Create icon
SlackIncomingWebhook icon

Dev to Prod: Push Flows and Files to GitHub and Create a Pull Request to merge into `main`

Automatically push Kestra flows and namespace files to a GitHub dev branch, open a Pull Request into main, and notify your team on Slack to review.

Categories
InfrastructureSystem

Promote your Kestra flows and namespace files from a development environment into version control automatically. This blueprint exports every flow YAML and internal file from a namespace, pushes them to a GitHub development branch, opens a Pull Request to merge into main, and posts the PR link to Slack so your team can review. It removes the manual export, copy, and import steps that usually sit between building flows in Kestra and getting them into Git, giving you a clean GitOps promotion path for your orchestration code.

How it works

  1. The push_flows task (io.kestra.plugin.git.PushFlows) exports all flows (flows: "*") from sourceNamespace and commits them under the _flows directory on the branch from dev_branch.
  2. The push_ns_files task (io.kestra.plugin.git.PushNamespaceFiles) pushes the namespace files (scripts, configs, and other assets) into the _files directory on the same branch.
  3. The create_pr task (io.kestra.plugin.github.pulls.Create) opens a Pull Request from sourceBranch (the dev branch) into targetBranch: main.
  4. The notify_team task (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) sends a Slack message containing {{ outputs.create_pr.pullRequestUrl }} so reviewers get the link instantly.

What you get

  • One-click promotion of flows and files from Kestra into GitHub.
  • A ready-to-review Pull Request opened automatically against main.
  • Commit messages stamped with the Kestra execution.id for traceability.
  • Slack notification linking straight to the new PR.

Who it's for

  • Platform and data engineers running a dev-to-prod GitOps workflow for Kestra.
  • Teams that require code review and PR approval before changes reach production.
  • Anyone standardizing flow promotion instead of manual exports.

Why orchestrate this with Kestra

Git itself has no scheduler or event model: it only versions code once something pushes to it. Kestra fills that gap by turning promotion into a declarative YAML workflow you can trigger on a schedule, on a webhook, or after another flow succeeds. You get automatic retries on transient Git or API failures, full execution lineage and logs for every push and PR, and a single audit trail tying the commit back to the run that produced it.

Prerequisites

  • A GitHub repository (set in the github_repo variable) with a main branch and a development branch.
  • Permission to open Pull Requests on that repository.
  • A Slack incoming webhook for notifications.

Secrets

  • GITHUB_USERNAME: GitHub username used to authenticate the push.
  • GITHUB_ACCESS_TOKEN: GitHub personal access token used to push and to open the Pull Request.
  • SLACK_WEBHOOK: Slack incoming webhook URL for the review notification.

Quick start

  1. Add the GITHUB_USERNAME, GITHUB_ACCESS_TOKEN, and SLACK_WEBHOOK secrets to your Kestra instance.
  2. Set the github_repo variable to your username/repo-name.
  3. Adjust the dev_branch and namespace inputs to match your setup.
  4. Execute the flow and review the Pull Request opened against main.

How to extend

  • Add a Schedule or Webhook trigger to promote on a cadence or on demand.
  • Filter flows to a subset instead of "*" to promote selectively.
  • Swap the Slack task for an email or Microsoft Teams notification.
  • Chain a CI validation flow before the PR is opened.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.