GitLab node
+6

Save your workflows into a Gitlab repository

Published 3 months ago

Categories

Template description

This template is inspired by Save your workflows into a GitHub repository by hikerspath and Back Up Your n8n Workflows To Github by jon-n8n.

Basic

Retrieve all workflows from an n8n instance and save it on a gitlab project. If the workflow exist, il will only save the changes.

Flow

What the workflow does :

  1. Sets custom parameters
  2. Gets workflows
  3. Iterates through each workflow one by one
    1. Get the file from Gitlab if exists
    2. Compare the files as objects (not as strings)
    3. Return a status on the workflow
  4. Create, Edit or ignore the file depending on the status
  5. Return a list of status for each workflow

Configuration

Select a credential in each Gitlab nodes.

Edit the data in node "Globals" :

  • repo.owner : slug of the user or team owning the repo
  • repo.name : slug of the repository
  • repo.branch : branch to commit on
  • repo.path : from root of the repository. Should end with /

Comments

Error on gitlab nodes will not stop the run but will list the current workflow as error in the results

Some fields are ignored to determined if there is changes :

  • updatedAt : should be ignored if only ignores fields are changed
  • globals : it's running information, no need to follow the changes

Share Template

More DevOps workflow templates

Git backup of workflows and credentials

This creates a git backup of the workflows and credentials. It uses the n8n export command with git diff, so you can run as many times as you want, but only when there are changes they will create a commit. Setup You need some access to the server. Create a repository in some remote place to host your project, like Github, Gitlab, or your favorite private repo. Clone the repository in the server in a place that the n8n has access. In the example, it's the ., and the repository name is repo. Change it in the commands and in the workflow commands (you can set it as a variable in the wokflow). Checkout to another branch if you won't use the master one. cd . git clone repository Or you could git init and then add the remote (git remote add origin YOUR_REPO_URL), whatever pleases you more. As the server, check if everything is ok for beeing able to commit. Very likely you'll need to setup the user email and name. Try to create a commit, and push it to upstream, and everything you need (like config a user to comit) will appear in way. I strong suggest testing with exporting the commands to garantee it will work too. cd ./repo git commit -c "Initial commmit" --allow-empty -u is the same as --set-upstream git push -u origin master Testing to push to upstream with the first exported data npx n8n export:workflow --backup --output ./repo/workflows/ npx n8n export:credentials --backup --output repo/credentials/ cd ./repo git add . git commit -c "manual backup: first export" git push After that, if everything is ok, the workflow should work just fine. Adjustments Adjust the path in used in the workflow. See the the git -C PATH command is the same as cd PATH; git .... Also, adjust the cron to run as you need. As I said in the beginning, you can run it even for every minute, but it will create commits only when there are changes. Credentials encryption The default for exporting the credentials is to do them encrypted. You can add the flag --decrypted to the n8n export:credentials command if you need to save them in plain. But as general rule, it's better to save the encryption key, that you only need to do that once, and them export it safely encrypted.
allandaemon
Allan Daemon
Google Sheets node
HTTP Request node
Slack node
+4

Host your own Uptime Monitoring with Scheduled Triggers

This n8n workflow demonstrates how to build a simple uptime monitoring service using scheduled triggers. Useful for webmasters with a handful of sites who want a cost-effective solution without the need for all the bells and whistles. How it works Scheduled trigger reads a list of website urls in a Google Sheet every 5 minutes Each website url is checked using the HTTP node which determines if the website is either in the UP or DOWN state. An email and Slack message are sent for websites which are in the DOWN state. The Google Sheet is updated with the website's state and a log created. Logs can be used to determine total % of UP and DOWN time over a period. Requirements Google Sheet for storing websites to monitor and their states Gmail for email alerts Slack for channel alerts Customising the workflow Don't use Google Sheets? This can easily be exchanged with Excel or Airtable.
jimleuk
Jimleuk
Merge node
Webhook node
+10

πŸ¦… Get a bird's-eye view of your n8n instance with the Workflow Dashboard!

Using n8n a lot? Soar above the limitations of the default n8n dashboard! This template gives you an overview of your workflows, nodes, and tags – all in one place. πŸ’ͺ Built using XML stylesheets and the Bootstrap 5 library, this workflow is self-contained and does not depend on any third-party software. πŸ™Œ It generates a comprehensive overview JSON that can be easily integrated with other BI tools for further analysis and visualization. πŸ“Š Reach out to Eduard if you need help adapting this workflow to your specific use-case! πŸš€ Benefits: Workflow Summary** πŸ“ˆ: Instant overview of your workflows, active counts, and triggers. Left-Side Panel** πŸ“‹: Quick access to all your workflows, nodes, and tags for seamless navigation. Workflow Details** πŸ”¬: Deep dive into each workflow's nodes, timestamps, and tags. Node Analysis** 🧩: Identify the most frequently used nodes across your workflows. Tag Organization** πŸ—‚οΈ: Workflows are grouped according to their tags. Visually Stunning** 🎨: Clean, intuitive, and easy-to-navigate dashboard design. XML & Bootstrap 5** πŸ› οΈ: Built using XML stylesheets and Bootstrap 5, ensuring a self-contained and responsive dashboard. No Dependencies** πŸ”’: The workflow does not rely on any third-party software. Bootstrap 5 files are loaded via CDN but can be delivered directly from your server. ⚠️ Important note for cloud users Since the cloud version doesn't support environmental variables, please make the following changes: get-nodes-via-jmespath node. Update the instance_url variable: enter your n8n URL instead of {{$env["N8N_PROTOCOL"]}}://{{$env["N8N_HOST"]}} Create HTML node. Please provide the n8n instance URL instead of {{ $env.WEBHOOK_URL }} 🌟Example: Check out our other workflows: n8n.io/creators/eduard n8n.io/creators/yulia
eduard
Eduard
GitHub node
HTTP Request node
Merge node
+10

Backup your credentials to GitHub

Based on Jonathan's work. Check out his templates. This workflow will backup your credentials to GitHub. It uses a CLI command to export all credentials. It then loops over the data, checks in GitHub to see if a file exists that uses the credential's ID. Once checked it will: update the file on GitHub if it exists; create a new file if it doesn't exist; ignore if it's the same. Config Options repo.owner - Github owner repo.name - Github repository name repo.path - Path within the Github repository ⚠ The credentials are all decrypted. Make sure you save them safely or tweak the CLI command to store them encrypted.== Check out my other templates πŸ‘‰ https://n8n.io/creators/solomon/
solomon
Solomon
Airtable node
Google Sheets node
Gmail node
+2

Streamline data from an n8n form into Google Sheet, Airtable and Email Sending

Streamline data from an n8n form into Google Sheet Airtable and and Email Sending Video for workflow process This workflow facilitates efficient data collection and management by leveraging the capabilities of various nodes within the n8n platform. It commences with the n8n Form Trigger node, where users provide their name, location, and email address. Subsequently, the data seamlessly flows through nodes like Google Sheets, Code, Set, Airtable, Gmail, and Gmail1 for processing and storage. n8n Form Trigger:** Gathers user input data, including Name, City, and Email. Google Sheets:** Manages data operations related to Google Sheets. Code:** Executes JavaScript code to manipulate data fields. Set:** Formats and sets data values for further processing. Airtable:** Facilitates data operations specific to Airtable. Gmail:** Sends custom emails to the provided Email address. Gmail:** Sends additional emails using different templates. Each node within the workflow performs specialized tasks such as extracting date and time fields, formatting data, appending it to Google Sheets and Airtable, and sending personalized emails to the submitter. This streamlined process ensures effective handling of collected information and enhances overall data management efficiency. Workflow Description: n8n Form Trigger: A trigger node that initiates the workflow upon form submission. Captures essential user details like Name, City, and Email. Extracting Date and Time Fields from 'submittedAt' Field: Utilizes a code node to extract Date and Time information from the submitted data. Format the Fields: Standardizes the format of extracted fields (Name, City, Date, Time, Email) for consistency. Airtable: Creates a new record in Airtable with the formatted data. Includes columns for Name, City, Email, Time, and Date. Google Sheets: Appends the formatted data to a designated Google Sheet. Includes columns for Name, City, Email, Date, and Time. Gmail: Sends an email to the provided Email address with a customized message. Subject: "Testing Text Message Delivery" Message: Personalized content with a Name placeholder. Gmail1: Sends another email using a different template. Subject incorporates the Date field for variation. Message content tailored to the subject line. Workflow Connections: n8n Form Trigger -> Extracting Date and Time Fields -> Format the Fields -> Google Sheets & Airtable -> Gmail Google Sheets -> Gmail1 This comprehensive workflow efficiently collects user data, processes it to extract Date and Time fields, stores the formatted information in Google Sheets and Airtable, and delivers tailored emails to the recipients. Copy these templates to get started : Google Sheet Airtable Links to Node Documentation: n8n Form Trigger Documentation Code Node Documentation Set Node Documentation Airtable Node Documentation Google Sheets Node Documentation Gmail Node Documentation
omar
AlQaisi
Merge node
MySQL node
+9

Generate SQL queries from schema only - AI-powered

This workflow is a modification of the previous template on how to create an SQL agent with LangChain and SQLite. The key difference – the agent has access only to the database schema, not to the actual data. To achieve this, SQL queries are made outside the AI Agent node, and the results are never passed back to the agent. This approach allows the agent to generate SQL queries based on the structure of tables and their relationships, without having to access the actual data. This makes the process more secure and efficient, especially in cases where data confidentiality is crucial. πŸš€ Setup To get started with this workflow, you’ll need to set up a free MySQL server and import your database (check Step 1 and 2 in this tutorial). Of course, you can switch MySQL to another SQL database such as PostgreSQL, the principle remains the same. The key is to download the schema once and save it locally to avoid repeated remote connections. Run the top part of the workflow once to download and store the MySQL chinook database schema file on the server. With this approach, we avoid the need to repeatedly connect to a remote db4free database and fetch the schema every time. As a result, we reach greater processing speed and efficiency. πŸ—£οΈ Chat with your data Start a chat: send a message in the chat window. The workflow loads the locally saved MySQL database schema, without having the ability to touch the actual data. The file contains the full structure of your MySQL database for analysis. The Langchain AI Agent receives the schema, your input and begins to work. The AI Agent generates SQL queries and brief comments based solely on the schema and the user’s message. An IF node checks whether the AI Agent has generated a query. When: Yes: the AI Agent passes the SQL query to the next MySQL node for execution. No: You get a direct answer from the Agent without further action. The workflow formats the results of the SQL query, ensuring they are convenient to read and easy to understand. Once formatted, you get both the Agent answer and the query result in the chat window. 🌟 Example queries Try these sample queries to see the schema-driven AI Agent in action: Would you please list me all customers from Germany? What are the music genres in the database? What tables are available in the database? Please describe the relationships between tables. - In this example, the AI Agent does not need to create the SQL query. And if you prefer to keep the data private, you can manually execute the generated SQL query in your own environment using any database client or tool you trust πŸ—„οΈ πŸ’­ The AI Agent memory node does not store the actual data as we run SQL-queries outside the agent. It contains the database schema, user questions and the initial Agent reply. Actual SQL query results are passed to the chat window, but the values are not stored in the Agent memory.
yulia
Yulia

Implement complex processes faster with n8n

red icon yellow icon red icon yellow icon