n8n Workflow Builder

A free, open-source Python library for building, managing, and deploying n8n workflows with a configuration-driven approach. This package provides the core tooling while allowing you to maintain your own private repository of workflows and templates.

🚀 Quick Start

pip install n8n-workflow-builder
n8n-workflow-builder build config.yaml
n8n-workflow-builder push config.yaml

Key Features

  • Config-driven workflow management using YAML configuration files
  • Template system for parameterized workflows using Jinja2
  • Secure secrets management with .env file integration
  • CLI interface with build, pull, push, and compare commands
  • Workflow comparison to track differences between local and remote workflows
  • n8n API integration for seamless workflow deployment

Why Use n8n Workflow Builder?

Managing n8n workflows manually through the UI becomes challenging as your automation grows. This library solves that by providing:

  • Version Control - Track your workflows in git like code
  • Reusable Templates - Create parameterized workflows for different environments
  • Team Collaboration - Share workflow configurations across your team
  • Environment Management - Deploy the same workflow to dev, staging, and production
  • Backup & Recovery - Never lose your workflows again

Installation & Setup

Install from PyPI

pip install n8n-workflow-builder

Install from Source

git clone https://github.com/ferrants/n8n-workflow-builder.git
cd n8n-workflow-builder
pip install -e .

CLI Commands

Build Workflows

n8n-workflow-builder build config.yaml

Build all workflows defined in your configuration

Push to n8n

n8n-workflow-builder push config.yaml

Upload built workflows to your n8n instance

Pull from n8n

n8n-workflow-builder pull config.yaml

Download workflows from your n8n instance

Compare Workflows

n8n-workflow-builder compare config.yaml

Compare built workflows with deployed workflows

Template System

Create reusable workflow templates using Jinja2 syntax. Templates allow you to:

  • Parameterize API endpoints, credentials, and configuration values
  • Deploy the same workflow logic to multiple environments
  • Share common patterns across your team
  • Maintain DRY (Don't Repeat Yourself) principles in your automation

Example Template Configuration

workflows:
  - name: "data-sync-customers"
    template: "templates/data-sync.yaml"
    description: "Syncs customer data between systems"
    parameters:
      source_system: "salesforce"
      target_system: "hubspot"
      sync_interval: "hourly"
      fields: ["name", "email", "company"]

GitHub Repository

The complete source code, documentation, and examples are available on GitHub:

Need Help with n8n Automation?

If you need assistance implementing n8n workflows, setting up automation, or want custom development work, I offer consulting services to help you get the most out of your n8n automation.

Features in Detail

Configuration-Driven Approach

Define all your workflows in a single YAML configuration file. This makes it easy to:

  • See all your workflows at a glance
  • Manage parameters and settings centrally
  • Version control your entire automation setup

Secure Secrets Management

Keep your API keys and sensitive data secure with built-in .env file support. Never commit secrets to your repository.

Workflow Comparison

Before deploying changes, compare your local workflows with what's currently deployed to n8n. This helps prevent accidental overwrites and gives you confidence in your deployments.

Team Collaboration

Share workflow templates and configurations across your team. Everyone can work with the same base templates while customizing parameters for their specific needs.

Getting Started

  1. Install the library: pip install n8n-workflow-builder
  2. Create your workflow repository with the recommended directory structure
  3. Set up your configuration file with your n8n instance details
  4. Create your first template or import existing workflows
  5. Build and deploy your workflows with the CLI commands

Check out the GitHub repository for detailed documentation, examples, and contribution guidelines.