Automatic Typebot Flow Synchronization with GitHub Backup - n8n Workflow

This sophisticated n8n workflow automates two-way synchronization, backing up Typebot flows to GitHub and handling deletions. Use this powerful n8n template for reliable data versioning and cleanup.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Technical users running self-hosted Typebot instances needing reliable backup strategies.
DevOps engineers looking for a seamless integration between application data and Git version control.
n8n users seeking advanced synchronization examples using recursion and complex comparison logic.
Anyone needing robust n8n templates for API data management and cleanup operations.

Overview

This powerful n8n workflow serves as a comprehensive synchronization mechanism for Typebot flows, ensuring that your chatbot definitions are constantly backed up and versioned in a dedicated GitHub repository. The primary challenge this n8n template solves is managing the life cycle of the flows—not only backing up new or modified Typebots but also cleaning up corresponding files in GitHub when a Typebot is deleted from the source workspace. This two-pronged approach, enabled by custom JavaScript logic within the n8n node structure, provides a reliable and memory-efficient solution, perfect for scaling Typebot usage while maintaining data integrity. The logic utilizes a recursive pattern via the Execute Workflow n8n node to handle numerous Typebot flows without straining the main n8n instance's memory. This ensures the n8n workflow is robust for high-volume environments.

How it Works

The synchronization is initiated by the Schedule Trigger n8n node, typically running daily, or manually via the On clicking 'execute' n8n trigger.


  1. Configuration and Data Collection: The n8n workflow first retrieves configuration variables (Typebot URL, workspace ID, GitHub owner/repo) from the Globals n8n node. It then uses two simultaneous HTTP requests: one to list all active Typebot flows and another using the GitHub n8n node to list all current backup files in the repository.

  2. Item Processing Loop: The Split Out n8n node separates the list of Typebots into individual items. The Loop Over Items n8n node manages the iterative processing, calling the workflow recursively via the Execute Workflow n8n node for each item to manage memory efficiently.

  3. Sub-Workflow Routing: The recursive execution starts with the Execute Workflow Trigger n8n node, which feeds into a Switch n8n node that checks the item's origin (Typebot or GitHub).

  4. Typebot Backup Path (Origin: Typebot): The flow fetches the detailed Typebot JSON and attempts to fetch the existing GitHub file data. A Code n8n node (isDiffOrNew) compares the JSON content. This custom n8n node ensures stability by ordering JSON keys before comparison. A subsequent Check Status Switch n8n node routes the flow to either Create new file, Edit existing file, or Return (if content is "same").

  5. GitHub Cleanup Path (Origin: GitHub): This path verifies if a file present in GitHub corresponds to an actively existing Typebot. The isDeleted Code n8n node checks the filename (ID) against the list of active Typebots. If the Typebot has been deleted, an If n8n node directs the flow to the Delete a file GitHub n8n node, maintaining a clean backup repository. This robust dual-path approach makes this an effective n8n workflow for maintenance.

Installation Guide


  1. Import the n8n template: Copy the provided JSON code and import it directly into your n8n instance.

  2. Configure Credentials:

Typebot: You will need a Generic HTTP Bearer Token credential to authenticate the List Typebots and Get Typebot HTTP Request n8n node.
GitHub: Configure an OAuth2 credential for GitHub. This credential must have permissions to read, write, and delete files in your target repository.

  1. Update Global Variables: Locate the Globals Set n8n node (indicated by a sticky note). Update the following values:

typebot.url: Your Typebot instance URL (e.g., https://typebot.io).
typebot.workspace.id: The specific workspace ID you wish to back up.
repo.owner: Your GitHub username.
repo.name: The name of the GitHub repository designated for these backups.

  1. Activation: Once credentials and globals are set, activate the n8n workflow. The Schedule Trigger n8n trigger will handle automated runs, but you can also execute it manually via the On clicking 'execute' n8n node.

Node Details

Schedule Trigger / Manual Trigger: These n8n triggers initiate the synchronization process based on time or manual input.
Globals (Set n8n node): Holds essential configuration parameters (API keys, URLs, repository names) for the entire n8n workflow.
List Typebots (HTTP Request n8n node): Fetches the list of all currently active Typebot flows from the Typebot API.
List files (GitHub n8n node): Retrieves the list of files currently backed up in the GitHub repository.
Execute Workflow (n8n node): A crucial component enabling recursive execution of the n8n workflow on itself for processing items one by one, optimizing memory management.
Get Typebot (HTTP Request n8n node): Retrieves the full, detailed JSON content for a specific Typebot flow using its ID.
isDiffOrNew (Code n8n node): A custom n8n node that compares the Typebot JSON payload with the existing GitHub backup data (which is base64 encoded) to determine if the flow is "new," "different," or "same" based on content hash/string comparison.
Check Status (Switch n8n node): Routes the n8n workflow based on the synchronization status provided by the isDiffOrNew n8n node.
Create new file / Edit existing file / Delete a file (GitHub n8n node): Performs the necessary Git operations (create, update, delete) to maintain synchronization integrity in the GitHub repository.
isDeleted (Code n8n node): A custom n8n node responsible for comparing the list of GitHub files against the list of active Typebot IDs to identify and mark files that need deletion.

Related n8n Workflows

Free

Nodes: 15 Nodes
Updated: December 26 2025
View all
Created by

Featured*