Skip to content

Instantly share code, notes, and snippets.

@commandodev
Created January 25, 2023 11:37
Show Gist options
  • Save commandodev/885b062be977e3f7816d11a722819333 to your computer and use it in GitHub Desktop.
Save commandodev/885b062be977e3f7816d11a722819333 to your computer and use it in GitHub Desktop.
{
"meta": {
"instanceId": "33aae00cb24017833bc61c57772daa66c5112ef5783d3779ec022240a070a520"
},
"nodes": [
{
"parameters": {},
"id": "1df3550a-7ff0-4072-bbf1-ce8d7ebe99f7",
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
180,
780
]
},
{
"parameters": {
"teamId": "47e05431-ae73-4206-8a4d-acd72431d1d2",
"resources": [
"issue"
]
},
"id": "b06a6b99-4665-456e-a2f9-7dad7b985734",
"name": "Linear Trigger",
"type": "n8n-nodes-base.linearTrigger",
"typeVersion": 1,
"position": [
300,
600
],
"webhookId": "55562a64-a2ec-42c6-85f7-2185b3ffe927",
"credentials": {
"linearApi": {
"id": "19",
"name": "MC Linear"
}
}
},
{
"parameters": {
"operation": "getAll",
"calendar": "c_6rai0934fphreoj4f36p6qeegg%40group.calendar.google.com",
"options": {
"query": "={{ $json[\"data\"][\"id\"] }}"
}
},
"id": "7fc162ae-d89c-4a45-9a20-4149320b3e99",
"name": "Google Calendar",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
600,
600
],
"alwaysOutputData": true,
"credentials": {
"googleCalendarOAuth2Api": {
"id": "20",
"name": "MC Ben Google Calendar"
}
},
"continueOnFail": true
},
{
"parameters": {
"value": "={{new Date()}}",
"options": {}
},
"id": "36c60793-dd47-4705-bb18-5088dded51b3",
"name": "Date & Time",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
460,
460
]
},
{
"parameters": {
"operation": "update",
"calendar": "c_6rai0934fphreoj4f36p6qeegg%40group.calendar.google.com",
"eventId": "={{ $json[\"id\"] }}",
"updateFields": {
"description": "={{ $node[\"Set Description\"].json[\"description\"] }}",
"location": "={{ $node[\"Linear Trigger\"].json[\"url\"] }}",
"summary": "={{$node[\"Linear Trigger\"].json[\"data\"][\"title\"]}}"
}
},
"id": "14f8608a-7837-4eee-bdad-3f836a17f5ed",
"name": "Update Existing",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
980,
580
],
"credentials": {
"googleCalendarOAuth2Api": {
"id": "20",
"name": "MC Ben Google Calendar"
}
}
},
{
"parameters": {
"calendar": "c_6rai0934fphreoj4f36p6qeegg%40group.calendar.google.com",
"start": "={{$node[\"Linear Trigger\"].json[\"data\"][\"dueDate\"] + \" 09:00\"}}",
"end": "={{$node[\"Linear Trigger\"].json[\"data\"][\"dueDate\"] + \" 10:00\"}}",
"additionalFields": {
"description": "={{ $node[\"Set Description\"].json[\"description\"] }}",
"location": "={{ $node[\"Linear Trigger\"].json[\"url\"] }}",
"summary": "={{$node[\"Linear Trigger\"].json[\"data\"][\"title\"]}}"
}
},
"id": "9eedc861-db7b-421e-9558-510332cb431d",
"name": "Create Event",
"type": "n8n-nodes-base.googleCalendar",
"typeVersion": 1,
"position": [
1200,
700
],
"credentials": {
"googleCalendarOAuth2Api": {
"id": "20",
"name": "MC Ben Google Calendar"
}
}
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$node[\"Linear Trigger\"].json[\"data\"][\"dueDate\"] !== null}}",
"value2": true
}
]
}
},
"id": "07c7a745-4f6b-4edb-bba3-03c2079513a5",
"name": "Has Due Date",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
980,
720
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{Object.keys($items()[0].json).length !== 0}}",
"value2": true
}
]
}
},
"id": "41af75bb-36f5-4185-8387-3f4b059553e1",
"name": "Has Existing Event",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
760,
600
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "description",
"value": "={{$json[\"data\"][\"description\"] || \"\"}}\nLinear ID: {{$json[\"data\"][\"id\"]}}\nLinear ticket: {{$json[\"url\"]}}"
}
]
},
"options": {}
},
"id": "7bd94720-1fe9-4f92-ac2f-327c107801d8",
"name": "Set Description",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
460,
600
]
}
],
"connections": {
"Linear Trigger": {
"main": [
[
{
"node": "Set Description",
"type": "main",
"index": 0
}
]
]
},
"Google Calendar": {
"main": [
[
{
"node": "Has Existing Event",
"type": "main",
"index": 0
}
]
]
},
"Date & Time": {
"main": [
[
{
"node": "Google Calendar",
"type": "main",
"index": 0
}
]
]
},
"Has Due Date": {
"main": [
[
{
"node": "Create Event",
"type": "main",
"index": 0
}
]
]
},
"Has Existing Event": {
"main": [
[
{
"node": "Update Existing",
"type": "main",
"index": 0
}
],
[
{
"node": "Has Due Date",
"type": "main",
"index": 0
}
]
]
},
"Set Description": {
"main": [
[
{
"node": "Google Calendar",
"type": "main",
"index": 0
}
]
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment