HTTP Request node
Slack node
Webhook node
+4

Monitor Multiple Github Repos via Webhook

Published 19 days ago

Created by

jay
Jay Hartley

Template description

What this workflow does

This workflow allows you to monitor multiple Github repos simultaneously without polling due to use of Webhooks. It programmatically allows for adding and deleting of repos to your watchlist to make management convenient.

Description

  • Can monitor multiple repos simultaneously.
  • Programmatically register or unregister repos from a list. No need for manual work.
  • Webhook notification means no constant polling necessary.

Setup

1. Creating Credentials on Github

Generate a personal access token on github by following these esteps;

  • Right hand side of page -> Settings -> scroll to bottom -> Developer Settings > Personal Access Token > Tokens (classic) > Generate New Token
  • Give scopes:
    admin:repo_hook
    repo (if you want to use it for your own private repo)

if you need more help, see here:
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

2. Setting Credentials in n8n

In Register Github Webhook
Authenticaion > Generic Credential Type
Generic Auth Type > Header Auth
Header Auth > Create New Credential with Name set to 'Authorization' and Value set to 'Bearer <YOUR GITHUB TOKEN HERE>'.
(You can reuse this for Delete Github Webhook and Get Existing Webhooks).
Now in Register Github Webhook, scroll down to Send Body > JSON and inside the JSON, change the value of "url" to the webhook address given as Production URL in the node Webhook Trigger.

3. Notification settings

In the third row, link up the Webhook Trigger to any API of your choice. Slack and Telegram are given as examples.
You can also format the notification message as you wish.

Setup time: roughly 10 minutes.

Instructions Video:

https://vimeo.com/1013473758

Test

1. Register Webhooks

  • In Repos to Monitor, add any repo you want to monitor changes for.
  • Disable Webhook Trigger, Click Test Workflow and if your Github credentials were set correctly, it will automatically register the webhooks. - You can test this by running the single node Get Existing Webhook and confirming it outputs the repo addresses.

2. Handle Github Events

  • Now that you have registered the webhooks, re-enable Webhook Trigger and activate the workflow.
  • Make a commit to any of the registered repos.
  • Confirm that the notification went through.
    That's it!

Share Template

More Engineering workflow templates

Webhook node
Respond to Webhook node

Creating an API endpoint

Task: Create a simple API endpoint using the Webhook and Respond to Webhook nodes Why: You can prototype or replace a backend process with a single workflow Main use cases: Replace backend logic with a workflow
jon-n8n
Jonathan
Merge node

Joining different datasets

Task: Merge two datasets into one based on matching rules Why: A powerful capability of n8n is to easily branch out the workflow in order to process different datasets. Even more powerful is the ability to join them back together with SQL-like joining logic. Main use cases: Appending data sets Keep only new items Keep only existing items
jon-n8n
Jonathan
GitHub node
Merge node
+6

Back Up Your n8n Workflows To Github

This workflow will backup your workflows to Github. It uses the public api to export all of the workflow data using the n8n node. It then loops over the data checks in Github to see if a file exists that uses the workflow name. Once checked it will then update the file on Github if it exists, Create a new file if it doesn't exist and if it's the same it will ignore the file. Config Options repo.owner - Github owner repo.name - Github repository name repo.path - Path within the Github repository &gt;This workflow has been updated to use the n8n node and the code node so requires at least version 0.198.0 of n8n
jon-n8n
Jonathan

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

More IT Ops workflow templates

HTTP Request node
Merge node
+3

Backup n8n workflows to Google Drive

Temporary solution using the undocumented REST API for backups using Google drive. Please note that there are issues with this workflow. It does not support versioning, so please know that it will create multiple copies of the workflows so if you run this daily it will make the folder grow quickly. Once I figure out how to version in Gdrive I'll update it here.
djangelic
Angel Menendez
HTTP Request node
Redis node
+8

Advanced Telegram Bot, Ticketing System, LiveChat, User Management, Broadcasting

A robust n8n workflow designed to enhance Telegram bot functionality for user management and broadcasting. It facilitates automatic support ticket creation, efficient user data storage in Redis, and a sophisticated system for message forwarding and broadcasting. How It Works Telegram Bot Setup: Initiate the workflow with a Telegram bot configured for handling different chat types (private, supergroup, channel). User Data Management: Formats and updates user data, storing it in a Redis database for efficient retrieval and management. Support Ticket Creation: Automatically generates chat tickets for user messages and saves the corresponding topic IDs in Redis. Message Forwarding: Forwards new messages to the appropriate chat thread, or creates a new thread if none exists. Support Forum Management: Handles messages within a support forum, differentiating between various chat types and user statuses. Broadcasting System: Implements a broadcasting mechanism that sends channel posts to all previous bot users, with a system to filter out blocked users. Blocked User Management: Identifies and manages blocked users, preventing them from receiving broadcasted messages. Versatile Channel Handling: Ensures that messages from verified channels are properly managed and broadcasted to relevant users. Set Up Steps Estimated Time**: Around 30 minutes. Requirements**: A Telegram bot, a Redis database, and Telegram group/channel IDs are necessary. Configuration**: Input the Telegram bot token and relevant group/channel IDs. Configure message handling and user data processing according to your needs. Detailed Instructions**: Sticky notes within the workflow provide extensive setup information and guidance. Live Demo Workflow Bot: Telegram Bot Link (Click here) Support Group: Telegram Group Link (Click here) Broadcasting Channel: Telegram Channel Link (Click here) Keywords: n8n workflow, Telegram bot, chat ticket system, Redis database, message broadcasting, user data management, support forum automation
nskha
Nskha
GitHub node
HTTP Request node
Merge node

Backup workflows to GitHub

Note: This workflow uses the internal API which is not official. This workflow might break in the future. The workflow executes every night at 23:59. You can configure a different time bin the Cron node. Configure the GitHub nodes with your username, repo name, and the file path. In the HTTP Request nodes (making a request to localhost:5678), create Basic Auth credentials with your n8n instance username and password.
harshil1712
ghagrawal17

More SecOps workflow templates

HTTP Request node
Merge node
Slack node
+4

Phishing Analysis - URLScan.io and VirusTotal

This n8n workflow automates the analysis of email messages received in a Microsoft Outlook inbox to identify indicators of compromise (IOCs), specifically suspicious URLs. It can be triggered manually or scheduled to run daily at midnight. The workflow begins by retrieving up to 100 read email messages from the Outlook inbox. However, there seems to be a configuration issue as it should retrieve unread messages, not read ones. It then marks these messages as read to avoid processing them again in the future. The messages are then split into individual items using the Split In Batches node for sequential processing. For each email, the workflow analyzes its content to find URLs, which are considered potential IOCs. If URLs are found, the workflow proceeds to check these URLs for potential threats using two services, URLScan.io and VirusTotal, in parallel. In the first path, URLScan.io scans each URL, and if there are no errors, the results from URLScan.io and VirusTotal are merged. If there are errors, the workflow waits 1 minute before attempting to retrieve the URLScan results again. The loop then continues for the next email. In the second path, VirusTotal is used to scan the URLs, and the results are retrieved. Finally, the workflow checks if the data field is not empty, filtering out items where no data was found. It then sends a summarized Slack message to report details about the analyzed email, including the subject, sender, date, URLScan report URL, and VirusTotal verdict for URLs that were reported as malicious. Potential issues during setup include configuring the Outlook node to retrieve unread messages, resolving a configuration issue in the VirusTotal node, and handling authentication and API keys for both URLScan.io and VirusTotal nodes. Additionally, proper error handling and testing with various email content types and URLs are essential to ensure the workflow accurately identifies IOCs and reports them to the Slack channel.
n8n-team
n8n Team
Cortex node
TheHive node

Analyze emails with S1EM

With workflow, you analyze Email with TheHive/Cortex https://github.com/V1D1AN/S1EM/wiki/Soar-guide
v1d1an
v1d1an
HTTP Request node
Merge node
Slack node
+7

URL and IP lookups through Greynoise and VirusTotal

This n8n workflow serves as a powerful cybersecurity and threat intelligence tool to look up URLs or IP addresses through industry standard threat intelligence vendors. It starts with either a form submission or a webhook trigger, allowing users to input data, URLs or IPs that require analysis. The workflow then splits into two paths depending on whether the input data is an IP or URL. If an IP was given, it sets the ip variable to the IP; however if a URL was given the workflow will perform a DNS lookup using Google Public DNS and sets the ip variable based on the results from Google. The workflow then checks the obtained IP addresses against GreyNoise services, with one branch utilizing GreyNoise RIOT IP Lookup to assess IP reputation and association with known benign services, and the other using GreyNoise IP Context to evaluate potential threats. The results from both GreyNoise services are merged to create a comprehensive analysis which includes the IP, classification (benign, malicious, or unknown), IP location, tags to identify activity or malware, category, and trust level. In parallel, a VirusTotal scan is initiated for the URL/IP to identify if it is malicious. A 5-second wait ensures proper processing, and the workflow subsequently polls the scan result to determine when the analysis is complete. The workflow then summarizes the analysis including the overall security vendor analysis results, blockList analysis, OpenPhish analysis, the URL, and the IP. Finally, the workflow combines the summarized intelligence from both GreyNoise and VirusTotal to provide a thorough analysis of the URL/IP. This summarized intelligence can then be emailed to the user that filled out the form via Gmail or it can be sent to the user via a Slack message. Setting up this workflow may require proper configuration of the form submission or webhook trigger, and ensuring that the GreyNoise and VirusTotal API credentials are correctly integrated. Users should also consider the potential volume of data and API rate limits, as excessive requests could lead to issues. Proper documentation and validation of input data are crucial to ensure accurate and meaningful results in the final report.
n8n-team
n8n Team

Implement complex processes faster with n8n

red icon yellow icon red icon yellow icon