feat: add folder support for workflows (fixes #70)

This commit is contained in:
Praveen Mudalgeri
2025-08-05 09:40:47 +05:30
parent 307d530f9b
commit c4885eee92
2057 changed files with 985290 additions and 974268 deletions

View File

@@ -0,0 +1,221 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "1c041974-2a1f-4464-be3e-70b8a700f40d",
"name": "Get ticket",
"type": "n8n-nodes-base.zendesk",
"position": [
460,
480
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "get"
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "a4a05b2a-2382-44af-8226-a2c60bee1ce3",
"name": "Create task",
"type": "n8n-nodes-base.asana",
"position": [
1000,
580
],
"parameters": {
"name": "={{$node[\"Get ticket\"].json[\"subject\"]}}",
"workspace": "1177253494675264",
"otherProperties": {
"assignee": "1202718619090236",
"assignee_status": "inbox"
}
},
"credentials": {
"asanaApi": {
"id": "8",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "55128ee9-9210-4341-bf9a-2e4ea415b668",
"name": "IF",
"type": "n8n-nodes-base.if",
"position": [
820,
480
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$node[\"Determine\"].json[\"Asana GID\"]}}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "6319045c-7df8-4031-b738-835f8fe12d06",
"name": "Update ticket",
"type": "n8n-nodes-base.zendesk",
"notes": "Update the Zendesk ticket by adding the Jira issue key to the \"Jira Issue Key\" field.",
"position": [
1180,
580
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "update",
"updateFields": {
"customFieldsUi": {
"customFieldsValues": [
{
"id": 6707064637597,
"value": "={{$node[\"Create task\"].json[\"gid\"]}}"
}
]
}
}
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "39172e43-def7-4e05-9ce3-6d0bb1c3ff59",
"name": "Determine",
"type": "n8n-nodes-base.function",
"notes": "if issue was created already in Jira",
"position": [
640,
480
],
"parameters": {
"functionCode": "/* configure here =========================================================== */\n/* Zendesk field ID which represents the \"Jira Issue Key\" field.\n*/\nconst ISSUE_KEY_FIELD_ID = 6707064637597;\n\n/* ========================================================================== */\nnew_items = [];\n\nfor (item of $items(\"Get ticket\")) {\n \n // instantiate a new variable for status\n var custom_fields = item.json[\"custom_fields\"];\n var asana_gid = \"\";\n for (var i = 0; i < custom_fields.length; i++) {\n if (custom_fields[i].id == ISSUE_KEY_FIELD_ID) {\n asana_gid = custom_fields[i].value;\n break;\n }\n }\n\n // push the new item to the new_items array\n new_items.push({\n \"Asana GID\": asana_gid\n });\n}\n\nreturn new_items;"
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "26f2aaf3-8b21-429f-bfec-c5876792d4b9",
"name": "Create comment on existing task",
"type": "n8n-nodes-base.asana",
"position": [
1000,
380
],
"parameters": {
"id": "={{$node[\"Determine\"].json[\"Asana GID\"]}}",
"text": "=<body>{{$node[\"On new Zendesk ticket\"].json[\"body\"][\"comment\"]}}</body>",
"resource": "taskComment",
"isTextHtml": true,
"additionalFields": {}
},
"credentials": {
"asanaApi": {
"id": "8",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "bbbf0fc1-3fa7-4a15-a949-c8d9d5e32031",
"name": "On new Zendesk ticket",
"type": "n8n-nodes-base.webhook",
"position": [
280,
480
],
"webhookId": "4637a853-0b3a-43d4-9d76-92e1ce87889d",
"parameters": {
"path": "4637a853-0b3a-43d4-9d76-92e1ce87889d",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
}
],
"connections": {
"IF": {
"main": [
[
{
"node": "Create comment on existing task",
"type": "main",
"index": 0
}
],
[
{
"node": "Create task",
"type": "main",
"index": 0
}
]
]
},
"Determine": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"Get ticket": {
"main": [
[
{
"node": "Determine",
"type": "main",
"index": 0
}
]
]
},
"Create task": {
"main": [
[
{
"node": "Update ticket",
"type": "main",
"index": 0
}
]
]
},
"On new Zendesk ticket": {
"main": [
[
{
"node": "Get ticket",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,220 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "f0913aa6-4e78-4808-b828-7e9953e71764",
"name": "Get ticket",
"type": "n8n-nodes-base.zendesk",
"position": [
380,
480
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "get"
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "f8774217-bc05-4b02-8632-154654f79d5f",
"name": "IF",
"type": "n8n-nodes-base.if",
"position": [
780,
480
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$node[\"Determine\"].json[\"GitHub Issue Number\"]}}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "6ae7e40b-b75c-41e2-9ba7-bb299f12911a",
"name": "Update ticket",
"type": "n8n-nodes-base.zendesk",
"notes": "Update the Zendesk ticket by adding the Jira issue key to the \"Jira Issue Key\" field.",
"position": [
1180,
580
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "update",
"updateFields": {
"customFieldsUi": {
"customFieldsValues": [
{
"id": 6721726848029,
"value": "={{$node[\"Create issue\"].json[\"number\"]}}"
}
]
}
}
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "7959986c-cfbf-4ba2-a968-95b62d2aa819",
"name": "Determine",
"type": "n8n-nodes-base.function",
"notes": "if issue was created already in Jira",
"position": [
580,
480
],
"parameters": {
"functionCode": "/* configure here =========================================================== */\n/* Zendesk field ID which represents the \"GitHub Issue Number\" field.\n*/\nconst ISSUE_KEY_FIELD_ID = 6721726848029;\n\n/* ========================================================================== */\nnew_items = [];\n\nfor (item of $items(\"Get ticket\")) {\n \n // instantiate a new variable for status\n var custom_fields = item.json[\"custom_fields\"];\n var github_issue_number = \"\";\n for (var i = 0; i < custom_fields.length; i++) {\n if (custom_fields[i].id == ISSUE_KEY_FIELD_ID) {\n github_issue_number = custom_fields[i].value;\n break;\n }\n }\n\n // push the new item to the new_items array\n new_items.push({\n \"GitHub Issue Number\": github_issue_number\n });\n}\n\nreturn new_items;"
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "a1ca21d3-958f-498c-a896-05d4ecbc286d",
"name": "Create issue",
"type": "n8n-nodes-base.github",
"position": [
980,
580
],
"parameters": {
"owner": "John-n8n",
"title": "={{$node[\"Get ticket\"].json[\"subject\"]}}",
"labels": [],
"assignees": [],
"repository": "DemoRepo"
},
"credentials": {
"githubApi": {
"id": "20",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "1ad6f536-2cdb-4ecc-85b4-2e960fb84498",
"name": "Create comment on existing issue",
"type": "n8n-nodes-base.github",
"position": [
980,
380
],
"parameters": {
"body": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"comment\"]}}",
"owner": "John-n8n",
"operation": "createComment",
"repository": "DemoRepo",
"issueNumber": "={{$node[\"Determine\"].json[\"GitHub Issue Number\"]}}"
},
"credentials": {
"githubApi": {
"id": "20",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "73e8c380-63de-4e5a-8e57-a17956174869",
"name": "On new Zendesk ticket",
"type": "n8n-nodes-base.webhook",
"position": [
180,
480
],
"webhookId": "b4253880-b5e2-4d61-bb2a-b0ea335bee14",
"parameters": {
"path": "b4253880-b5e2-4d61-bb2a-b0ea335bee14",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
}
],
"connections": {
"IF": {
"main": [
[
{
"node": "Create comment on existing issue",
"type": "main",
"index": 0
}
],
[
{
"node": "Create issue",
"type": "main",
"index": 0
}
]
]
},
"Determine": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"Get ticket": {
"main": [
[
{
"node": "Determine",
"type": "main",
"index": 0
}
]
]
},
"Create issue": {
"main": [
[
{
"node": "Update ticket",
"type": "main",
"index": 0
}
]
]
},
"On new Zendesk ticket": {
"main": [
[
{
"node": "Get ticket",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,220 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "b374f136-0050-40ea-b889-03c1e20a161e",
"name": "IF",
"type": "n8n-nodes-base.if",
"position": [
1000,
300
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$node[\"Determine\"].json[\"Jira issue key\"]}}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "52e85300-9a2f-45e9-973e-0fda49a50bf1",
"name": "Create issue",
"type": "n8n-nodes-base.jira",
"position": [
1180,
400
],
"parameters": {
"project": "10000",
"summary": "={{$node[\"Get ticket\"].json[\"subject\"]}}",
"issueType": "10003",
"additionalFields": {
"description": "=See Zendesk issue at: https://n8n.zendesk.com/agent/tickets/{{$node[\"Get ticket\"].json[\"id\"]}}"
}
},
"credentials": {
"jiraSoftwareCloudApi": {
"id": "23",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "85c93002-95d3-434d-b9e9-10ef714432b1",
"name": "Update ticket",
"type": "n8n-nodes-base.zendesk",
"notes": "Update the Zendesk ticket by adding the Jira issue key to the \"Jira Issue Key\" field.",
"position": [
1360,
400
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "update",
"updateFields": {
"customFieldsUi": {
"customFieldsValues": [
{
"id": 6689934837021,
"value": "={{$node[\"Create issue\"].json[\"key\"]}}"
}
]
}
}
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "3aa0dff6-f4a5-47c1-9843-271b78bfbf36",
"name": "Get ticket",
"type": "n8n-nodes-base.zendesk",
"position": [
640,
300
],
"parameters": {
"id": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"id\"]}}",
"operation": "get"
},
"credentials": {
"zendeskApi": {
"id": "24",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "efd1f838-226f-4869-83f8-086d31f8a9bc",
"name": "Determine",
"type": "n8n-nodes-base.function",
"notes": "if issue was created already in Jira",
"position": [
820,
300
],
"parameters": {
"functionCode": "/* configure here =========================================================== */\n/* Zendesk field ID which represents the \"Jira Issue Key\" field.\n*/\nconst ISSUE_KEY_FIELD_ID = 6689934837021;\n\n/* ========================================================================== */\nnew_items = [];\n\nfor (item of $items(\"Get ticket\")) {\n \n // instantiate a new variable for status\n var custom_fields = item.json[\"custom_fields\"];\n var jira_issue_key = \"\";\n for (var i = 0; i < custom_fields.length; i++) {\n if (custom_fields[i].id == ISSUE_KEY_FIELD_ID) {\n jira_issue_key = custom_fields[i].value;\n break;\n }\n }\n\n // push the new item to the new_items array\n new_items.push({\n \"Jira issue key\": jira_issue_key\n });\n}\n\nreturn new_items;"
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "41a1c04b-561b-41e3-be6e-fc953319abc1",
"name": "Create comment to existing issue",
"type": "n8n-nodes-base.jira",
"position": [
1180,
200
],
"parameters": {
"comment": "={{$node[\"On new Zendesk ticket\"].json[\"body\"][\"comment\"]}}",
"options": {},
"issueKey": "={{$node[\"Determine\"].json[\"Jira issue key\"]}}",
"resource": "issueComment"
},
"credentials": {
"jiraSoftwareCloudApi": {
"id": "23",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "33e0121e-703d-4c60-b257-a89a99db771a",
"name": "On new Zendesk ticket",
"type": "n8n-nodes-base.webhook",
"position": [
460,
300
],
"webhookId": "d596c0c6-7377-4a17-9ed5-6ee953f072b9",
"parameters": {
"path": "d596c0c6-7377-4a17-9ed5-6ee953f072b9",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
}
],
"connections": {
"IF": {
"main": [
[
{
"node": "Create comment to existing issue",
"type": "main",
"index": 0
}
],
[
{
"node": "Create issue",
"type": "main",
"index": 0
}
]
]
},
"Determine": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"Get ticket": {
"main": [
[
{
"node": "Determine",
"type": "main",
"index": 0
}
]
]
},
"Create issue": {
"main": [
[
{
"node": "Update ticket",
"type": "main",
"index": 0
}
]
]
},
"On new Zendesk ticket": {
"main": [
[
{
"node": "Get ticket",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,285 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "60e3ee97-68cb-46ef-8a92-a9e8d1cdd45d",
"name": "Add Zendesk company data to Hubspot data",
"type": "n8n-nodes-base.merge",
"position": [
1120,
320
],
"parameters": {
"mode": "mergeByKey",
"propertyName1": "properties.name.value",
"propertyName2": "name"
},
"typeVersion": 1
},
{
"id": "d72c4307-c24c-494f-b5c2-57fd44ede5a5",
"name": "Set new last execution timestamp",
"type": "n8n-nodes-base.functionItem",
"position": [
1820,
300
],
"parameters": {
"functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nstaticData.lastExecution = $item(0).$node[\"Get last execution timestamp\"].executionTimeStamp;\n\nreturn item;"
},
"executeOnce": true,
"typeVersion": 1
},
{
"id": "c10e7993-4cd4-4b79-9dce-66097d797b30",
"name": "Get last execution timestamp",
"type": "n8n-nodes-base.functionItem",
"position": [
400,
300
],
"parameters": {
"functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nif(!staticData.lastExecution){\n staticData.lastExecution = new Date();\n}\n\nitem.executionTimeStamp = new Date();\nitem.lastExecution = staticData.lastExecution;\n\n\nreturn item;"
},
"typeVersion": 1
},
{
"id": "3c154d99-7984-4561-9fdf-60b0f705c5ee",
"name": "Get modified companies",
"type": "n8n-nodes-base.hubspot",
"position": [
620,
300
],
"parameters": {
"filters": {
"since": "={{ $json[\"lastExecution\"] }}"
},
"resource": "company",
"operation": "getRecentlyModified",
"authentication": "appToken"
},
"credentials": {
"hubspotAppToken": {
"id": "13",
"name": "HubSpot App Token account"
}
},
"typeVersion": 1
},
{
"id": "6f05aae1-731e-42cf-b403-baf5f86aa934",
"name": "Get all Zendesk organisations",
"type": "n8n-nodes-base.zendesk",
"position": [
880,
420
],
"parameters": {
"resource": "organization",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "a8ae65dc-0c60-42cb-9996-26e84770e299",
"name": "Company exists in Zendesk",
"type": "n8n-nodes-base.if",
"position": [
1340,
320
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"id\"] }}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "a81ff688-8639-476d-8274-383e5ff51b97",
"name": "Create organisation",
"type": "n8n-nodes-base.zendesk",
"position": [
1600,
400
],
"parameters": {
"name": "={{ $json[\"properties\"].name.value }}",
"resource": "organization",
"additionalFields": {
"domain_names": "={{ $json[\"properties\"].domain.value }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "fd2780b3-c5cc-4535-ba71-840b13578a07",
"name": "Update organisation",
"type": "n8n-nodes-base.zendesk",
"position": [
1600,
200
],
"parameters": {
"id": "={{ $json[\"id\"] }}",
"resource": "organization",
"operation": "update",
"updateFields": {
"name": "={{ $json[\"properties\"].name.value }}",
"domain_names": "={{ $json[\"properties\"].domain.value }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "7f19e5ba-e973-4e6c-a2d0-a320ac314fa6",
"name": "Every 5 minutes",
"type": "n8n-nodes-base.cron",
"position": [
180,
300
],
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"unit": "minutes",
"value": 5
}
]
}
},
"typeVersion": 1
}
],
"connections": {
"Every 5 minutes": {
"main": [
[
{
"node": "Get last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Create organisation": {
"main": [
[
{
"node": "Set new last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Update organisation": {
"main": [
[
{
"node": "Set new last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Get modified companies": {
"main": [
[
{
"node": "Get all Zendesk organisations",
"type": "main",
"index": 0
},
{
"node": "Add Zendesk company data to Hubspot data",
"type": "main",
"index": 0
}
]
]
},
"Company exists in Zendesk": {
"main": [
[
{
"node": "Update organisation",
"type": "main",
"index": 0
}
],
[
{
"node": "Create organisation",
"type": "main",
"index": 0
}
]
]
},
"Get last execution timestamp": {
"main": [
[
{
"node": "Get modified companies",
"type": "main",
"index": 0
}
]
]
},
"Get all Zendesk organisations": {
"main": [
[
{
"node": "Add Zendesk company data to Hubspot data",
"type": "main",
"index": 1
}
]
]
},
"Add Zendesk company data to Hubspot data": {
"main": [
[
{
"node": "Company exists in Zendesk",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,441 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "dcd5f025-9af9-4e3a-96fc-25a33dcc6c00",
"name": "Ticket Exists",
"type": "n8n-nodes-base.if",
"position": [
900,
320
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"external_id\"] }}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "a5e8ec4d-bc80-4153-a677-91be2e7d02b7",
"name": "Get user data of Ticket requester",
"type": "n8n-nodes-base.zendesk",
"position": [
220,
480
],
"parameters": {
"id": "={{ $json[\"requester_id\"] }}",
"resource": "user",
"operation": "get"
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "6dc07af8-d446-4704-9a08-e65f89772a9b",
"name": "Only keep needed data",
"type": "n8n-nodes-base.set",
"position": [
440,
480
],
"parameters": {
"values": {
"number": [
{
"name": "id",
"value": "={{ $json[\"id\"] }}"
},
{
"name": "contactExternalId",
"value": "={{ $json[\"external_id\"] }}"
}
],
"string": [
{
"name": "contactEmail",
"value": "={{ $json[\"email\"] }}"
},
{
"name": "contactName",
"value": "={{ $json[\"name\"] }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "c3ca22e4-ae76-49ee-b117-f6da9d90ec1a",
"name": "Add user data",
"type": "n8n-nodes-base.merge",
"position": [
640,
320
],
"parameters": {
"mode": "mergeByKey",
"propertyName1": "requester_id",
"propertyName2": "id"
},
"typeVersion": 1
},
{
"id": "713b919a-3a39-4466-b9b8-cc3575f02e45",
"name": "Update existing ticket",
"type": "n8n-nodes-base.hubspot",
"position": [
1280,
300
],
"parameters": {
"resource": "ticket",
"ticketId": "={{ $json[\"external_id\"] }}",
"operation": "update",
"updateFields": {
"ticketName": "={{ $json[\"raw_subject\"] }}",
"description": "={{ $json[\"description\"] }}"
},
"authentication": "oAuth2"
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"typeVersion": 1,
"continueOnFail": true
},
{
"id": "1eb40a93-2d36-4b3e-a39d-f19f369adc4e",
"name": "Update Zendesk ticket with External Id",
"type": "n8n-nodes-base.zendesk",
"position": [
2020,
480
],
"parameters": {
"id": "={{ $node[\"Contact Exists\"].json[\"id\"] }}",
"operation": "update",
"updateFields": {
"externalId": "={{ $json[\"objectId\"] }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "a11c8809-c22f-40f5-a019-79274eba4d70",
"name": "Get last execution timestamp",
"type": "n8n-nodes-base.functionItem",
"position": [
-260,
300
],
"parameters": {
"functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nif(!staticData.lastExecution){\n staticData.lastExecution = new Date().toISOString();\n}\n\nitem.executionTimeStamp = new Date().toISOString();\nitem.lastExecution = staticData.lastExecution;\n\n\nreturn item;"
},
"typeVersion": 1
},
{
"id": "a62685c9-f786-4e7c-9e2d-cdcb1e0a3aea",
"name": "Get tickets updated after last execution",
"type": "n8n-nodes-base.zendesk",
"position": [
-40,
300
],
"parameters": {
"options": {
"query": "=updated>{{ $json[\"lastExecution\"] }}",
"sortBy": "updated_at",
"sortOrder": "desc"
},
"operation": "getAll"
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "c1b23aa8-a9f6-4966-b1dc-fe48c203364c",
"name": "Set new last execution timestamp",
"type": "n8n-nodes-base.functionItem",
"position": [
2360,
300
],
"parameters": {
"functionCode": "// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called 'myNewField' to the JSON of the item\nconst staticData = getWorkflowStaticData('global');\n\nstaticData.lastExecution = $item(0).$node[\"Get last execution timestamp\"].executionTimeStamp;\n\nreturn item;"
},
"executeOnce": true,
"typeVersion": 1
},
{
"id": "97ae70de-bce8-4861-a256-17002625da58",
"name": "Every 5 minutes",
"type": "n8n-nodes-base.cron",
"position": [
-460,
300
],
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"unit": "minutes",
"value": 5
}
]
}
},
"typeVersion": 1
},
{
"id": "1d2dd552-175c-4405-b304-d4136dd2968b",
"name": "Create new Ticket",
"type": "n8n-nodes-base.hubspot",
"position": [
1780,
480
],
"parameters": {
"stageId": "1",
"resource": "ticket",
"pipelineId": "0",
"ticketName": "={{ $node['Ticket Exists'].json[\"raw_subject\"] }}",
"authentication": "oAuth2",
"additionalFields": {
"description": "={{ $node['Ticket Exists'].json[\"description\"] }}",
"associatedContactIds": "={{ [].concat($node[\"Create or update contact\"].json[\"vid\"]) }}"
}
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"executeOnce": false,
"typeVersion": 1
},
{
"id": "e2217f74-f1b2-4449-9937-543758a333ea",
"name": "Update External Id in Zendesk for contact",
"type": "n8n-nodes-base.zendesk",
"position": [
1520,
480
],
"parameters": {
"id": "={{ $node[\"Ticket Exists\"].json[\"requester_id\"] }}",
"resource": "user",
"operation": "update",
"updateFields": {
"external_id": "={{ $json[\"vid\"] }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "144a3395-9f61-4aad-99e0-4a689145f93d",
"name": "Create or update contact",
"type": "n8n-nodes-base.hubspot",
"position": [
1280,
480
],
"parameters": {
"email": "={{ $json[\"contactEmail\"] }}",
"resource": "contact",
"authentication": "oAuth2",
"additionalFields": {}
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"typeVersion": 1
}
],
"connections": {
"Add user data": {
"main": [
[
{
"node": "Ticket Exists",
"type": "main",
"index": 0
}
]
]
},
"Ticket Exists": {
"main": [
[
{
"node": "Update existing ticket",
"type": "main",
"index": 0
}
],
[
{
"node": "Create or update contact",
"type": "main",
"index": 0
}
]
]
},
"Every 5 minutes": {
"main": [
[
{
"node": "Get last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Create new Ticket": {
"main": [
[
{
"node": "Update Zendesk ticket with External Id",
"type": "main",
"index": 0
}
]
]
},
"Only keep needed data": {
"main": [
[
{
"node": "Add user data",
"type": "main",
"index": 1
}
]
]
},
"Update existing ticket": {
"main": [
[
{
"node": "Set new last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Create or update contact": {
"main": [
[
{
"node": "Update External Id in Zendesk for contact",
"type": "main",
"index": 0
}
]
]
},
"Get last execution timestamp": {
"main": [
[
{
"node": "Get tickets updated after last execution",
"type": "main",
"index": 0
}
]
]
},
"Get user data of Ticket requester": {
"main": [
[
{
"node": "Only keep needed data",
"type": "main",
"index": 0
}
]
]
},
"Update Zendesk ticket with External Id": {
"main": [
[
{
"node": "Set new last execution timestamp",
"type": "main",
"index": 0
}
]
]
},
"Get tickets updated after last execution": {
"main": [
[
{
"node": "Get user data of Ticket requester",
"type": "main",
"index": 0
},
{
"node": "Add user data",
"type": "main",
"index": 0
}
]
]
},
"Update External Id in Zendesk for contact": {
"main": [
[
{
"node": "Create new Ticket",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,30 @@
{
"id": "33",
"name": "Receive updates for support in Zendesk",
"nodes": [
{
"name": "Zendesk Trigger",
"type": "n8n-nodes-base.zendeskTrigger",
"position": [
690,
300
],
"webhookId": "7d01a119-83c7-43b7-8668-a2f26b95d225",
"parameters": {
"options": {},
"conditions": {
"all": [
{}
]
}
},
"credentials": {
"zendeskApi": "zendesk-token"
},
"typeVersion": 1
}
],
"active": false,
"settings": {},
"connections": {}
}