feat: add folder support for workflows (fixes #70)
This commit is contained in:
169
workflows/Github/0135_GitHub_Cron_Create_Scheduled.json
Normal file
169
workflows/Github/0135_GitHub_Cron_Create_Scheduled.json
Normal file
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Get latest release",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
540,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 1,
|
||||
"resource": "release",
|
||||
"operation": "getAll"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Cron",
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
240,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyWeek"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
740,
|
||||
420
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "No issue for release?",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
920,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "const _ = require('lodash')\n\n// differentiate merged inputs (didnt find a way to get both inputs into one function invocation)\nconst releases = _.filter(items, i => _.has(i, 'json.assets'))\nif (releases.length != 1) throw new Error(`Invalid release count: ${releases.length}`)\nconst release = releases[0]\nconst issues = _.without(items, release)\n//console.log({release,issues})\n\n// check if there's an issue for the release\nconst matchingIssue = _.find(issues, i => i.json.title.includes(release.json.tag_name))\n//console.log({release,issues,matchingIssue})\n\nif (matchingIssue)\n return []\nelse\n return [release]"
|
||||
},
|
||||
"executeOnce": false,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Create issue",
|
||||
"type": "n8n-nodes-base.gitlab",
|
||||
"position": [
|
||||
1100,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"body": "={{$json[\"url\"]}}\n\n{{$json[\"body\"]}}",
|
||||
"owner": "txlab",
|
||||
"title": "=Upstream release: {{$json[\"tag_name\"]}}",
|
||||
"labels": [],
|
||||
"repository": "docker-linkcheck",
|
||||
"assignee_ids": []
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "List issues",
|
||||
"type": "n8n-nodes-base.gitlab",
|
||||
"position": [
|
||||
540,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "txlab",
|
||||
"resource": "repository",
|
||||
"repository": "docker-linkcheck",
|
||||
"getRepositoryIssuesFilters": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Cron": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get latest release",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "List issues",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "No release for issue?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Start": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get latest release",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "List issues",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"List issues": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get latest release": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"No release for issue?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
359
workflows/Github/0264_GitHub_Stickynote_Create_Triggered.json
Normal file
359
workflows/Github/0264_GitHub_Stickynote_Create_Triggered.json
Normal file
@@ -0,0 +1,359 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0bd18974-8414-4b83-b3fb-85d2f6a74164",
|
||||
"name": "Create database page",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1220,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"title": "={{$json[\"body\"][\"issue\"][\"title\"]}}",
|
||||
"resource": "databasePage",
|
||||
"databaseId": "5026700b-6693-473a-8100-8cc6ddef62a6",
|
||||
"propertiesUi": {
|
||||
"propertyValues": [
|
||||
{
|
||||
"key": "Issue ID|number",
|
||||
"numberValue": "={{$node[\"Trigger on issues\"].json[\"body\"][\"issue\"][\"id\"]}}"
|
||||
},
|
||||
{
|
||||
"key": "Link|url",
|
||||
"urlValue": "={{$node[\"Trigger on issues\"].json[\"body\"][\"issue\"][\"html_url\"]}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "dfce23fd-7ff8-42d1-9544-694345156080",
|
||||
"name": "Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1220,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## IF & Switch\nDepends on what action was taken on an issue in GitHub."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "577e0d7a-0539-414f-8ec8-00ce12807d5b",
|
||||
"name": "Find database page",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1400,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "databasePage",
|
||||
"operation": "getAll",
|
||||
"returnAll": true,
|
||||
"databaseId": "5026700b-6693-473a-8100-8cc6ddef62a6",
|
||||
"filterJson": "={{$node[\"Create custom Notion filters\"].json[\"notionfilter\"]}}",
|
||||
"filterType": "json"
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "91b0586c-eb08-41d0-bbb0-8a03c4a0ac3a",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1580,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"rules": [
|
||||
{
|
||||
"value2": "edited"
|
||||
},
|
||||
{
|
||||
"output": 1,
|
||||
"value2": "deleted"
|
||||
},
|
||||
{
|
||||
"output": 2,
|
||||
"value2": "closed"
|
||||
},
|
||||
{
|
||||
"output": 3,
|
||||
"value2": "reopened"
|
||||
}
|
||||
]
|
||||
},
|
||||
"value1": "={{$node[\"Trigger on issues\"].json[\"body\"][\"action\"]}}",
|
||||
"dataType": "string"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5262e14e-adc2-45d1-9e3f-c0eba013077a",
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1040,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$node[\"Trigger on issues\"].json[\"body\"][\"action\"]}}",
|
||||
"value2": "opened"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "735ef0b3-70c3-4a88-ad02-35edf8f749c4",
|
||||
"name": "Edit issue",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1760,
|
||||
360
|
||||
],
|
||||
"parameters": {
|
||||
"pageId": "={{ $node[\"Find database page\"].json[\"id\"] }}",
|
||||
"resource": "databasePage",
|
||||
"operation": "update",
|
||||
"propertiesUi": {
|
||||
"propertyValues": [
|
||||
{
|
||||
"key": "Issue|title",
|
||||
"title": "={{$node[\"Trigger on issues\"].json[\"body\"][\"issue\"][\"title\"]}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "39b75e78-bd62-40e4-9e88-12c6a1901c34",
|
||||
"name": "Delete issue",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1760,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"pageId": "={{$node[\"Find database page\"].json[\"id\"]}}",
|
||||
"operation": "archive"
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d8fee72d-c19d-4b99-85c2-dcc5d4fa6756",
|
||||
"name": "Create custom Notion filters",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
1220,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "const new_items = [];\nfor (item of $items(\"Trigger on issues\")) {\n\n // do not process this item if action is created\n if (item.json[\"body\"][\"action\"] == \"opened\") {\n continue;\n }\n\n // build the output template\n var new_item = {\n \"json\": {\n \"notionfilter\": \"\"\n }\n };\n new_item = JSON.stringify(new_item);\n new_item = JSON.parse(new_item);\n new_items.push(new_item);\n\n // create Notion filter to find specific database page by issue ID\n notionfilter = {\n or: [],\n }\n\n const filter = {\n property: 'Issue ID',\n number: {\n equals: parseInt(item.json[\"body\"][\"issue\"][\"id\"])\n }\n }\n notionfilter[\"or\"].push(filter);\n\n new_item.json.notionfilter = JSON.stringify(notionfilter); \n}\n\nreturn new_items;"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "99c69200-d932-4379-9a36-96cd8420f21c",
|
||||
"name": "Close issue",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"pageId": "={{$node[\"Find database page\"].json[\"id\"]}}",
|
||||
"resource": "databasePage",
|
||||
"operation": "update",
|
||||
"propertiesUi": {
|
||||
"propertyValues": [
|
||||
{
|
||||
"key": "Closed|checkbox",
|
||||
"checkboxValue": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "3f4b27d3-33ae-44f8-ab18-1c23ae7cf890",
|
||||
"name": "Reopen issue",
|
||||
"type": "n8n-nodes-base.notion",
|
||||
"position": [
|
||||
1760,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"pageId": "={{$node[\"Find database page\"].json[\"id\"]}}",
|
||||
"resource": "databasePage",
|
||||
"operation": "update",
|
||||
"propertiesUi": {
|
||||
"propertyValues": [
|
||||
{
|
||||
"key": "Closed|checkbox"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"notionApi": {
|
||||
"id": "9",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "62e1a9d3-3fc6-46de-a048-cf8176f30f94",
|
||||
"name": "Trigger on issues",
|
||||
"type": "n8n-nodes-base.githubTrigger",
|
||||
"position": [
|
||||
860,
|
||||
500
|
||||
],
|
||||
"webhookId": "bc0a0a44-00db-473b-8746-b60b3b36039c",
|
||||
"parameters": {
|
||||
"owner": "John-n8n",
|
||||
"events": [
|
||||
"issues"
|
||||
],
|
||||
"repository": "DemoRepo"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "20",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create database page",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Create custom Notion filters",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Delete issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Close issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Reopen issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Trigger on issues": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Find database page": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create custom Notion filters": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Find database page",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
108
workflows/Github/0289_GitHub_Stickynote_Update_Triggered.json
Normal file
108
workflows/Github/0289_GitHub_Stickynote_Update_Triggered.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "161c2837-6a3c-4492-93d0-c094b8788362",
|
||||
"name": "On any update in repository",
|
||||
"type": "n8n-nodes-base.githubTrigger",
|
||||
"position": [
|
||||
620,
|
||||
520
|
||||
],
|
||||
"webhookId": "9f16fefe-dacf-48b8-a576-48ed0599e911",
|
||||
"parameters": {
|
||||
"owner": "dummydavid",
|
||||
"events": [
|
||||
"*"
|
||||
],
|
||||
"repository": "DemoRepo"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "20",
|
||||
"name": "[UPDATE ME]"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2703e869-60e0-4906-9fd2-35a5e54aae1f",
|
||||
"name": "Turn a light red",
|
||||
"type": "n8n-nodes-base.homeAssistant",
|
||||
"position": [
|
||||
840,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"domain": "light",
|
||||
"service": "turn_on",
|
||||
"resource": "service",
|
||||
"operation": "call",
|
||||
"serviceAttributes": {
|
||||
"attributes": [
|
||||
{
|
||||
"name": "entity_id",
|
||||
"value": "light.lamp"
|
||||
},
|
||||
{
|
||||
"name": "rgb_color",
|
||||
"value": "={{[255,0,0]}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"homeAssistantApi": {
|
||||
"id": "21",
|
||||
"name": "home.davidsha.me"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bbbd01eb-9409-414e-bc85-c615add05580",
|
||||
"name": "Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
160,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"width": 378,
|
||||
"height": 351,
|
||||
"content": "## Turn on a light to a specific color on any update in GitHub repository\nThis workflow turns a light red when an update is made to a GitHub repository. By default, updates include pull requests, issues, pushes just to name a few.\n\n### How it works\n1. Triggers off on the `On any update in repository` node.\n2. Uses Home Assistant to turn on a light and then configure the light to turn red."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "33dfde3b-a4b5-468d-8d13-9d3577563f9b",
|
||||
"name": "Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
840,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"width": 315,
|
||||
"height": 248,
|
||||
"content": "### Configure light here\nIt is likely the name of the light that you want to turn a specific colour is not called `light.lamp`. In which case, please head to your Home Assistant instance and find the light taking note of it's `entity_id`. See discussion [here](https://community.home-assistant.io/t/find-the-entity-id-of-a-yeelight-light-in-manual-mode-or-automatic-mode-doesnt-work/165557) for help.\n\nIf you would also like to change the colour the light turns to, do so with an [RGB color picker](https://www.google.com/search?q=rgb+color+picker&oq=rgb+colo&aqs=chrome.0.0i67i433j69i57j0i67l4j0i512l4.6248j0j7&sourceid=chrome&ie=UTF-8). Default colour is red (255,0,0)."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"On any update in repository": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Turn a light red",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
856
workflows/Github/0876_GitHub_Aggregate_Create_Webhook.json
Normal file
856
workflows/Github/0876_GitHub_Aggregate_Create_Webhook.json
Normal file
@@ -0,0 +1,856 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b0224d75-763d-4f06-8aa3-3f1b4c5ca96d",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
800,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "operation"
|
||||
},
|
||||
{
|
||||
"name": "repo"
|
||||
},
|
||||
{
|
||||
"name": "issueNumber"
|
||||
},
|
||||
{
|
||||
"name": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "dd0e2ff0-af31-4503-a276-65682a3009a8",
|
||||
"name": "Operation",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
980,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "getLatestIssues",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "81b134bc-d671-4493-b3ad-8df9be3f49a6",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.operation }}",
|
||||
"rightValue": "getLatestIssues"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "getIssueComments",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "8d57914f-6587-4fb3-88e0-aa1de6ba56c1",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.operation }}",
|
||||
"rightValue": "getIssueComments"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "addIssueComment",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "7c38f238-213a-46ec-aefe-22e0bcb8dffc",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.operation }}",
|
||||
"rightValue": "addIssueComment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "bc35f181-e3a4-4aa4-8132-26cd4a6ced8a",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 680,
|
||||
"height": 660,
|
||||
"content": "## 1. Set up an MCP Server Trigger\n[Read more about the MCP Server Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e4c8d338-08ad-4c47-935b-b5ea53dc59d7",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
700,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 560,
|
||||
"height": 300,
|
||||
"content": "## 2. Build Simple Support Tools with Github Node\n[Read more about the Github Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.github)\n\nWhilst it may be easier to just let the Agent provide the full raw SQL statement,\nit may expose you or your organisation to a real security risk where in the worst\ncase, data may be unknowingly leaked or deleted.\n\nForcing the agent to provide only the parameters of the query\nmeans we can guard somewhat against this risk and also allows\nuse of query parameters as best practice against SQL injection attacks.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5d6a5f6d-24e8-48ed-8409-8cd24cc2e668",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 380,
|
||||
"height": 100,
|
||||
"content": "### Always Authenticate Your Server!\nBefore going to production, it's always advised to enable authentication on your MCP server trigger."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fd11a97d-cd3d-4356-81d3-4266f65ef606",
|
||||
"name": "Github MCP Server",
|
||||
"type": "@n8n/n8n-nodes-langchain.mcpTrigger",
|
||||
"position": [
|
||||
160,
|
||||
300
|
||||
],
|
||||
"webhookId": "61848df7-3619-4ccf-831b-d6408e0d6519",
|
||||
"parameters": {
|
||||
"path": "61848df7-3619-4ccf-831b-d6408e0d6519"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b8fd8431-71fa-44d1-abdb-b50e6a8a940f",
|
||||
"name": "Get Latest Issues",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
160,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"name": "getLatestIssues",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Retrieves the latest issues from the github respository.",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"repo": "n8n-io/n8n",
|
||||
"text": "null",
|
||||
"operation": "getLatestIssues",
|
||||
"issueNumber": "null"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "operation",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "operation",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "repo",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "repo",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "issueNumber",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "issueNumber",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "text",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "text",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "a11f7b8a-aaa9-41de-a693-6d0463e48d10",
|
||||
"name": "Add Issue Comment",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
480,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"name": "addIssueComment",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Call this tool to add a comment to the github issue.",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"repo": "n8n-io/n8n",
|
||||
"text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', ``, 'string') }}",
|
||||
"operation": "addIssueComment",
|
||||
"issueNumber": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('issueNumber', ``, 'string') }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "operation",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "operation",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "repo",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "repo",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "issueNumber",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "issueNumber",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "text",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "text",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "57e8370b-caf0-4632-98e3-78316b2cb262",
|
||||
"name": "Simplify Issues",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1500,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "6d5eb037-7e52-4595-a2da-bb183674ea2a",
|
||||
"name": "issue_number",
|
||||
"type": "number",
|
||||
"value": "={{ $json.number }}"
|
||||
},
|
||||
{
|
||||
"id": "3d365039-f012-444c-a383-c6c70fb93e9d",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $json.title }}"
|
||||
},
|
||||
{
|
||||
"id": "20a1b658-c56c-4578-9b1f-350b454da2d2",
|
||||
"name": "url",
|
||||
"type": "string",
|
||||
"value": "={{ $json.url }}"
|
||||
},
|
||||
{
|
||||
"id": "0eb6930d-2ea9-4a83-bab7-5f673e79c1d1",
|
||||
"name": "reported_by",
|
||||
"type": "string",
|
||||
"value": "={{ $json.user.login }}"
|
||||
},
|
||||
{
|
||||
"id": "2d71c6de-ab54-4721-9e1c-5193350a5110",
|
||||
"name": "state",
|
||||
"type": "string",
|
||||
"value": "={{ $json.state }}"
|
||||
},
|
||||
{
|
||||
"id": "474166aa-4bfa-4230-bce4-28df2de47bed",
|
||||
"name": "created_at",
|
||||
"type": "string",
|
||||
"value": "={{ $json.created_at }}"
|
||||
},
|
||||
{
|
||||
"id": "e4784fc1-4438-4d7a-a2f5-86be077ae7ae",
|
||||
"name": "updated_at",
|
||||
"type": "string",
|
||||
"value": "={{ $json.updated_at }}"
|
||||
},
|
||||
{
|
||||
"id": "e0639b60-4a08-406a-be8e-c3565a519f0c",
|
||||
"name": "body",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "632b1286-7e4a-457b-8544-6ca8f2affb9f",
|
||||
"name": "Aggregate Results",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1680,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "447327bc-0b42-47ec-80c0-14d6f521d047",
|
||||
"name": "Get Issue Comments",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
320,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"name": "getIssueComments",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $workflow.id }}"
|
||||
},
|
||||
"description": "Retrieves the issue and associated comments and discussion",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"repo": "n8n-io/n8n",
|
||||
"text": "null",
|
||||
"operation": "getIssueComments",
|
||||
"issueNumber": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('issueNumber', ``, 'string') }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "operation",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "operation",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "repo",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "repo",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "issueNumber",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "issueNumber",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "text",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "text",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "f5c59a05-54e4-4aa5-bef3-192e07adffb0",
|
||||
"name": "Get Comments",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1500,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.comments_url }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "githubApi"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "kA70YRmLeHDqZbXA",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "3fe80456-9fb5-47bb-80d9-484123571a8f",
|
||||
"name": "Simplify Comments",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1680,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "6e09ed44-a72c-4915-84f4-0796b45158a7",
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
{
|
||||
"id": "76c34251-7f40-42bc-bb98-17e7fe52d9ed",
|
||||
"name": "issue_url",
|
||||
"type": "string",
|
||||
"value": "={{ $json.issue_url }}"
|
||||
},
|
||||
{
|
||||
"id": "1094dd36-d18d-4ada-ac49-5347f0f245ae",
|
||||
"name": "user",
|
||||
"type": "string",
|
||||
"value": "={{ $json.user.login }}"
|
||||
},
|
||||
{
|
||||
"id": "59b50536-4e0a-46bc-919b-685066253f45",
|
||||
"name": "author_association",
|
||||
"type": "string",
|
||||
"value": "={{ $json.author_association }}"
|
||||
},
|
||||
{
|
||||
"id": "6253bae9-aaff-4a88-9e5a-64126ed80cc4",
|
||||
"name": "body",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body }}"
|
||||
},
|
||||
{
|
||||
"id": "3944598d-8204-45a0-9e0b-448d3cfa5a87",
|
||||
"name": "created_at",
|
||||
"type": "string",
|
||||
"value": "={{ $json.created_at }}"
|
||||
},
|
||||
{
|
||||
"id": "3f395b51-6e57-4d07-9cf9-9a03e7a40c51",
|
||||
"name": "updated_at",
|
||||
"type": "string",
|
||||
"value": "={{ $json.updated_at }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "7926ae2d-5408-4b10-88f3-e6ebfe5f9619",
|
||||
"name": "Aggregate Comments",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1860,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af2b4c0f-4a83-44a2-bae8-b3c45861d820",
|
||||
"name": "Get Many Issues",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
1320,
|
||||
320
|
||||
],
|
||||
"webhookId": "e08dcf3e-66bb-4ba5-a868-d8c41a98bc95",
|
||||
"parameters": {
|
||||
"limit": 10,
|
||||
"owner": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[0] }}"
|
||||
},
|
||||
"resource": "repository",
|
||||
"repository": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[1] }}"
|
||||
},
|
||||
"getRepositoryIssuesFilters": {
|
||||
"sort": "created"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "kA70YRmLeHDqZbXA",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "50568171-5f46-4338-a799-a1854ebc425e",
|
||||
"name": "Get Single Issue",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
1320,
|
||||
500
|
||||
],
|
||||
"webhookId": "e08dcf3e-66bb-4ba5-a868-d8c41a98bc95",
|
||||
"parameters": {
|
||||
"owner": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[0] }}"
|
||||
},
|
||||
"operation": "get",
|
||||
"repository": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[1] }}"
|
||||
},
|
||||
"issueNumber": "={{ $json.issueNumber }}"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "kA70YRmLeHDqZbXA",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "1a12fadd-e436-4731-ad66-b9d9cdb9c61c",
|
||||
"name": "Create Comment",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
1320,
|
||||
680
|
||||
],
|
||||
"webhookId": "e08dcf3e-66bb-4ba5-a868-d8c41a98bc95",
|
||||
"parameters": {
|
||||
"body": "={{ $json.text }}",
|
||||
"owner": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[0] }}"
|
||||
},
|
||||
"operation": "createComment",
|
||||
"repository": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.split('/')[1] }}"
|
||||
},
|
||||
"issueNumber": "={{ $json.issueNumber }}"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "kA70YRmLeHDqZbXA",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "b90acf56-c871-49de-95d0-1c6ceb1799f7",
|
||||
"name": "Get Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1500,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "65631bfa-7448-4188-8cc1-b812361ae9b1",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "da360f61-4251-4f0f-8081-3b502e9981c9",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-460,
|
||||
-480
|
||||
],
|
||||
"parameters": {
|
||||
"width": 440,
|
||||
"height": 1260,
|
||||
"content": "## Try It Out!\n### This n8n demonstrates how to build your own Github MCP server to personalise it to your organisation's repositories, issues and pull requests.\n\nThis n8n implementation, though not as fully featured as the official MCP server offered by Github, allows you to control precisely what access and/or functionality is granted to users which can make MCP use simpler and in some cases, more secure. The use-case in this template is to simply view and comment on issues within a specific repository but can be extended to meet the needs of your team.\n\nThis MCP example is based off an official MCP reference implementation which can be found here https://github.com/modelcontextprotocol/servers/tree/main/src/github\n\n### How it works\n* A MCP server trigger is used and connected to 3 custom workflow tools. We're using custom workflow tools as there is quite a few nodes required for each task.\n* Behind these tools are regular Github nodes although preconfigured with credentials and targeted repository.\n* The \"Get Issue Comments\" and \"Create Issue Comment\" tools depend on obtaining an Issue Number first. The agent should call the \"Get Latest Issues\" tool for this.\n\n### How to use\n* This Github MCP server allows any compatible MCP client to view and comment on Github Issues. You will need to have a Github account and repository access available before you can use this server.\n* Connect your MCP client by following the n8n guidelines here - https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/#integrating-with-claude-desktop\n* Try the following queries in your MCP client:\n * \"Can you get me the latest issues about MCP?\"\n * \"What is the current progress on Issue 12345?\"\n * \"Please can you add a comment to Issue 12345 that they should try installing the latest version and see if that works?\"\n\n### Requirements\n* Github for account and repository access. The repository need not be your own but you'll still need to ensure you have the correct permissions.\n* MCP Client or Agent for usage such as Claude Desktop - https://claude.ai/download\n\n### Customising this workflow\n* Extend this template to interactive with pull requests or workflows within your own company's Github repositories. Alternatively, pull in metrics and generate reports for programme managers.\n* Remember to set the MCP server to require credentials before going to production and sharing this MCP server with others!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Operation": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Many Issues",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Get Single Issue",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Create Comment",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Comments": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify Comments",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Comment": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Many Issues": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify Issues",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify Issues": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate Results",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Single Issue": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Comments",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Issue Comment": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Github MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Latest Issues": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Github MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify Comments": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate Comments",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Issue Comments": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Github MCP Server",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Operation",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
123
workflows/Github/0973_GitHub_Slack_Create_Triggered.json
Normal file
123
workflows/Github/0973_GitHub_Slack_Create_Triggered.json
Normal file
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Github Trigger",
|
||||
"type": "n8n-nodes-base.githubTrigger",
|
||||
"position": [
|
||||
500,
|
||||
350
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "n8n-io",
|
||||
"events": [
|
||||
"star"
|
||||
],
|
||||
"repository": "n8n"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
700,
|
||||
350
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$node[\"Github Trigger\"].data[\"body\"][\"action\"]}}",
|
||||
"value2": "created"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Slack - Add",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
900,
|
||||
250
|
||||
],
|
||||
"parameters": {
|
||||
"channel": "#general",
|
||||
"attachments": [
|
||||
{
|
||||
"text": "=The project has now: {{$node[\"Github Trigger\"].data[\"body\"][\"repository\"][\"stargazers_count\"]}} Stars",
|
||||
"color": "#88FF00",
|
||||
"title": "=Got new star from: {{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"login\"]}}",
|
||||
"image_url": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"avatar_url\"]}}",
|
||||
"title_link": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"html_url\"]}}"
|
||||
}
|
||||
],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Slack - Remove",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
900,
|
||||
450
|
||||
],
|
||||
"parameters": {
|
||||
"channel": "#general",
|
||||
"attachments": [
|
||||
{
|
||||
"text": "=The project has now: {{$node[\"Github Trigger\"].data[\"body\"][\"repository\"][\"stargazers_count\"]}} Stars",
|
||||
"color": "#ff0000",
|
||||
"title": "=Star got removed by: {{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"login\"]}}",
|
||||
"image_url": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"avatar_url\"]}}",
|
||||
"title_link": "={{$node[\"Github Trigger\"].data[\"body\"][\"sender\"][\"html_url\"]}}"
|
||||
}
|
||||
],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack - Add",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Slack - Remove",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Github Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
25
workflows/Github/0997_GitHub_Automate_Triggered.json
Normal file
25
workflows/Github/0997_GitHub_Automate_Triggered.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Github Trigger",
|
||||
"type": "n8n-nodes-base.githubTrigger",
|
||||
"position": [
|
||||
260,
|
||||
410
|
||||
],
|
||||
"webhookId": "887a6b2b-dfc3-48b5-86e3-fc414613baee",
|
||||
"parameters": {
|
||||
"owner": "n8n-io",
|
||||
"events": [
|
||||
"*"
|
||||
],
|
||||
"repository": "n8n-docs"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": "github_creds"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {}
|
||||
}
|
||||
59
workflows/Github/1068_GitHub_Slack_Automation_Triggered.json
Normal file
59
workflows/Github/1068_GitHub_Slack_Automation_Triggered.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"id": "5ec2322573f7590007802e1f",
|
||||
"name": "Extranet Releases",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
560,
|
||||
550
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=New release is available in {{$node[\"Github Trigger\"].json[\"body\"][\"repository\"][\"full_name\"]}} !\n{{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"tag_name\"]}} Details:\n{{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"body\"]}}\n\nLink: {{$node[\"Github Trigger\"].json[\"body\"][\"release\"][\"html_url\"]}}",
|
||||
"as_user": true,
|
||||
"channel": "extranet-md",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": "Extranet-md"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Github Trigger",
|
||||
"type": "n8n-nodes-base.githubTrigger",
|
||||
"position": [
|
||||
350,
|
||||
550
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "Mesdocteurs",
|
||||
"events": [
|
||||
"release"
|
||||
],
|
||||
"repository": "mda-admin-partner-api"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": "Github API"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"Github Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
452
workflows/Github/1149_GitHub_Manual_Create_Scheduled.json
Normal file
452
workflows/Github/1149_GitHub_Manual_Create_Scheduled.json
Normal file
@@ -0,0 +1,452 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "On clicking 'execute'",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
0,
|
||||
150
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "dataArray",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "const newItems = [];\nfor (item of items[0].json.data) {\n newItems.push({json: item});\n}\nreturn newItems;"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "N8N Workflows",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
300,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"url": "http://localhost:8443/rest/workflows",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "GitHub",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
800,
|
||||
130
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
|
||||
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$json[\"name\"]}}.json",
|
||||
"resource": "file",
|
||||
"operation": "get",
|
||||
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
|
||||
"asBinaryProperty": false
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": "GitHub"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"continueOnFail": true,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1000,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "N8N Workflow Detail",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
800,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=http://localhost:8443/rest/workflows/{{$json[\"id\"]}}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "github_status",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1300,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"rules": [
|
||||
{
|
||||
"value2": "same"
|
||||
},
|
||||
{
|
||||
"output": 1,
|
||||
"value2": "different"
|
||||
},
|
||||
{
|
||||
"output": 2,
|
||||
"value2": "new"
|
||||
}
|
||||
]
|
||||
},
|
||||
"value1": "={{$json[\"github_status\"]}}",
|
||||
"dataType": "string"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "same",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1500,
|
||||
130
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "different",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1500,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "new",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1500,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "GitHub Edit",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
1700,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
|
||||
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json",
|
||||
"resource": "file",
|
||||
"operation": "edit",
|
||||
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
|
||||
"fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}",
|
||||
"commitMessage": "=[N8N Backup] {{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json ({{$json[\"github_status\"]}})"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": "GitHub"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "GitHub Create",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
1700,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
|
||||
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json",
|
||||
"resource": "file",
|
||||
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
|
||||
"fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}",
|
||||
"commitMessage": "=[N8N Backup] {{$node[\"N8N Workflow Detail\"].json[\"data\"][\"name\"]}}.json ({{$json[\"github_status\"]}})"
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": "GitHub"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "isDiffOrNew",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
1150,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "// File Returned with Content\nif (Object.keys(items[0].json).includes(\"content\")) {\n // Get JSON Objects\n var origWorkflow = eval(\"(\"+Buffer.from(items[0].json.content, 'base64').toString()+\")\");\n var n8nWorkflow = (items[1].json.data);\n \n // Order JSON Objects\n var orderedOriginal = {}\n var orderedActual = {}\n \n Object.keys(origWorkflow).sort().forEach(function(key) {\n orderedOriginal[key] = origWorkflow[key];\n });\n \n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n \n // Determine Difference\n if ( JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual) ) {\n items[0].json.github_status = \"same\";\n items[0].json.content_decoded = orderedOriginal;\n } else {\n items[0].json.github_status = \"different\";\n items[0].json.content_decoded = orderedOriginal;\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n }\n// No File Returned / New Workflow\n} else {\n // Order JSON Object\n var n8nWorkflow = (items[1].json.data);\n var orderedActual = {}\n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n \n // Proper Formatting\n items[0].json.github_status = \"new\";\n items[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n}\n\n// Return Items\nreturn items;"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Daily @ 20:00",
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
0,
|
||||
450
|
||||
],
|
||||
"parameters": {
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"hour": 20,
|
||||
"minute": 11
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "OneAtATime",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
600,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"batchSize": 1
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Globals",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
150,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "repo.owner",
|
||||
"value": "octocat"
|
||||
},
|
||||
{
|
||||
"name": "repo.name",
|
||||
"value": "Hello-World"
|
||||
},
|
||||
{
|
||||
"name": "repo.path",
|
||||
"value": "my-team/n8n/workflows/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"new": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GitHub Create",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"same": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OneAtATime",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "isDiffOrNew",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GitHub": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Globals": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "N8N Workflows",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"dataArray": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OneAtATime",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"different": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GitHub Edit",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OneAtATime": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GitHub",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "N8N Workflow Detail",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GitHub Edit": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OneAtATime",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"isDiffOrNew": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "github_status",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Daily @ 20:00": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Globals",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GitHub Create": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OneAtATime",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"N8N Workflows": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "dataArray",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"github_status": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "same",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "different",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "new",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"N8N Workflow Detail": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On clicking 'execute'": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Globals",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
505
workflows/Github/1988_GitHub_Manual_Automate_Triggered.json
Normal file
505
workflows/Github/1988_GitHub_Manual_Automate_Triggered.json
Normal file
@@ -0,0 +1,505 @@
|
||||
{
|
||||
"id": "uoBZx3eMvLMxlHCS",
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "[OPS] Restore workflows from GitHub to n8n",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "540d147a-8185-4f3e-b2f4-522a19eb6b10",
|
||||
"name": "On clicking 'execute'",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-700,
|
||||
780
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7040674c-57b4-453d-acd4-69cbeff64180",
|
||||
"name": "Globals",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-500,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "repo.owner",
|
||||
"value": "n8n-io"
|
||||
},
|
||||
{
|
||||
"name": "repo.name",
|
||||
"value": "n8n-backups"
|
||||
},
|
||||
{
|
||||
"name": "repo.path",
|
||||
"value": "workflows/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2b3a2856-4024-4fb0-b068-6bace0e6592c",
|
||||
"name": "Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1140,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 389.78906250000017,
|
||||
"height": 464.79920462713443,
|
||||
"content": "## Workflow - Restore Backups\nThis workflow will restore backed-up workflows from Github. \nIt is launch by testing the workflow\n\n### Setup\nOpen Globals and update the values below\n**repo.owner:** This is your Github username\n**repo.name:** This is the name of your repository\n**repo.path:** This is the folder where your workflows are saved, within the repository.\n\nIf your username was `n8n-io` and your repository was called `n8n-backups` and you wanted the workflows to go into a `workflows` folder you would set:\n\nrepo.owner - n8n-io\nrepo.name - n8n-backups\nrepo.path - workflows"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ba2d3355-df53-43e2-a4b2-2e031b71d687",
|
||||
"name": "Workflow name already exists",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
1180,
|
||||
880
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f012be7a-fb56-4a92-b2e5-e5ec316624e8",
|
||||
"name": "If workflow already exists",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
860,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "063d51c7-0b7a-48a4-82b3-76b370fc4265",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $('Merge Github and n8n workflows - Keep only non existing workflows based on the name').item.json.name }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d1d698f2-0ccf-4865-9ecd-9e10e725d12d",
|
||||
"name": "Set n8n existing workflows names",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
320,
|
||||
880
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "6be8c184-8fb7-47a9-ad42-d0dc3db1eea4",
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"value": "={{ $json.name }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "d9c58650-ca2d-47c8-a887-59407fa70e1d",
|
||||
"name": "GitHub - get all files",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
-280,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"owner": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}"
|
||||
},
|
||||
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}",
|
||||
"resource": "file",
|
||||
"operation": "list",
|
||||
"repository": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "vL0n4BqAk6e4zDd7",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7bff36b1-d526-402b-bff8-7ce2af050e2d",
|
||||
"name": "n8n - get all workflows",
|
||||
"type": "n8n-nodes-base.n8n",
|
||||
"position": [
|
||||
-500,
|
||||
880
|
||||
],
|
||||
"parameters": {
|
||||
"filters": {}
|
||||
},
|
||||
"credentials": {
|
||||
"n8nApi": {
|
||||
"id": "RzT15uIVuSWu3ioX",
|
||||
"name": "n8n account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "277f6400-409a-4ba0-8ad7-1241768b669a",
|
||||
"name": "GitHub - get each file",
|
||||
"type": "n8n-nodes-base.github",
|
||||
"position": [
|
||||
140,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"owner": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.owner }}"
|
||||
},
|
||||
"filePath": "={{ $json.path }}",
|
||||
"resource": "file",
|
||||
"operation": "get",
|
||||
"repository": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "={{ $json.repo.name }}"
|
||||
},
|
||||
"asBinaryProperty": false,
|
||||
"additionalParameters": {}
|
||||
},
|
||||
"credentials": {
|
||||
"githubApi": {
|
||||
"id": "vL0n4BqAk6e4zDd7",
|
||||
"name": "GitHub account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b59f5e23-729a-41fb-be4b-1aebc573393b",
|
||||
"name": "Set name and content",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
340,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "714b0cfd-9f06-4e2f-b73d-30ef39dc40e3",
|
||||
"name": "content",
|
||||
"type": "string",
|
||||
"value": "={{ $json.content.base64Decode() }}"
|
||||
},
|
||||
{
|
||||
"id": "6f48ed58-d55a-4ee4-8cf2-373941aaa341",
|
||||
"name": "name",
|
||||
"type": "string",
|
||||
"value": "={{ $json.name.replace(\".json\", \"\") }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "6f642a8c-9997-42b2-b9d7-3c1f02e0e26a",
|
||||
"name": "n8n - create workflow",
|
||||
"type": "n8n-nodes-base.n8n",
|
||||
"position": [
|
||||
1180,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "create",
|
||||
"workflowObject": "={{ $('Set name and content').item.json.content }}"
|
||||
},
|
||||
"credentials": {
|
||||
"n8nApi": {
|
||||
"id": "RzT15uIVuSWu3ioX",
|
||||
"name": "n8n account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b4ce8bdb-8c76-4c10-bf48-3664ec2f924b",
|
||||
"name": "Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-360,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 861.4145066375679,
|
||||
"height": 478.9952882299376,
|
||||
"content": "## Get all Github files\n1. List all the files from your repository\n2. Get each file as a JSON. \n3. The content, retrieved as base64, is converted in the \"Set Name and Content\" node\n\n\nThe \"Set Name and Content\" node creates a list of workflows with name and content, in order to compare it with the existing n8n workflows in the workspace."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5ff560b9-8c43-401c-869f-2b4a2e13cacc",
|
||||
"name": "Merge globals and files",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
-60,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "multiplex"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "008d21d9-007b-44da-8d1a-bd334ba54d61",
|
||||
"name": "Merge Github and n8n workflows - Keep only non existing workflows based on the name",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
640,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"joinMode": "keepNonMatches",
|
||||
"mergeByFields": {
|
||||
"values": [
|
||||
{
|
||||
"field1": "name",
|
||||
"field2": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputDataFrom": "input1"
|
||||
},
|
||||
"typeVersion": 2.1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "c7ffe214-1d7b-4f4f-87c1-36d9cb8e43a9",
|
||||
"name": "Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 260.44696745223945,
|
||||
"height": 196.65095879641083,
|
||||
"content": "## Merge Github and n8n workflows\n\nHere, we only keep the workflows from Github that doesn't already exist in n8n workspace, based on the name"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3d84fd1c-c49b-4db0-951a-e38d50dae47b",
|
||||
"name": "Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1360,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 344.0461264465236,
|
||||
"height": 237.66186698228626,
|
||||
"content": "## Create n8n workflow\n\nCreate the n8n workflow using:\n- Content saved in Github\n- Name of the file in Github\n\n\nIf the workflow name already exist in n8n, then the workflow is not created - to avoid duplicates."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "144a0b2e-d7b2-443d-91a5-96c09ef16b8e",
|
||||
"name": "Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-280,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 378.7476641422645,
|
||||
"height": 182.45487519360773,
|
||||
"content": "## Get existing n8n workflows\n\n1. Get all workflows\n2. Prepare a list of workflows in order to compare it with the workflows saved in the Github repo."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "b7a0e558-1c40-4ff8-aaed-b6e3a8ab6b8c",
|
||||
"connections": {
|
||||
"Globals": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GitHub - get all files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge globals and files",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set name and content": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Github and n8n workflows - Keep only non existing workflows based on the name",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On clicking 'execute'": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Globals",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "n8n - get all workflows",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GitHub - get all files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge globals and files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"GitHub - get each file": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set name and content",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge globals and files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "GitHub - get each file",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"n8n - get all workflows": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set n8n existing workflows names",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If workflow already exists": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "n8n - create workflow",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Workflow name already exists",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set n8n existing workflows names": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Github and n8n workflows - Keep only non existing workflows based on the name",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Github and n8n workflows - Keep only non existing workflows based on the name": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If workflow already exists",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user