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,71 @@
{
"nodes": [
{
"name": "Twitter",
"type": "n8n-nodes-base.twitter",
"position": [
720,
-220
],
"parameters": {
"text": "=Hey there, my design is now on a new product ✨\nVisit my {{$json[\"vendor\"]}} shop to get this cool{{$json[\"title\"]}} (and check out more {{$json[\"product_type\"]}}) 🛍️",
"additionalFields": {}
},
"credentials": {
"twitterOAuth1Api": "twitter"
},
"typeVersion": 1
},
{
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
720,
-20
],
"parameters": {
"text": "=Hey there, my design is now on a new product!\nVisit my {{$json[\"vendor\"]}} shop to get this cool{{$json[\"title\"]}} (and check out more {{$json[\"product_type\"]}})",
"chatId": "123456",
"additionalFields": {}
},
"credentials": {
"telegramApi": "telegram_habot"
},
"typeVersion": 1
},
{
"name": "product created",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
540,
-110
],
"webhookId": "2a7e0e50-8f09-4a2b-bf54-a849a6ac4fe0",
"parameters": {
"topic": "products/create"
},
"credentials": {
"shopifyApi": "shopify_nodeqa"
},
"typeVersion": 1
}
],
"connections": {
"product created": {
"main": [
[
{
"node": "Twitter",
"type": "main",
"index": 0
},
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,59 @@
{
"id": 13,
"name": "Creating an Onfleet Task for a new Shopify Fulfillment",
"nodes": [
{
"name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
240,
440
],
"webhookId": "576e8785-bbb4-426b-a922-da671efced68",
"parameters": {
"topic": "fulfillments/create"
},
"credentials": {
"shopifyApi": {
"id": "6",
"name": "Shopify account"
}
},
"typeVersion": 1
},
{
"name": "Onfleet",
"type": "n8n-nodes-base.onfleet",
"position": [
460,
440
],
"parameters": {
"operation": "create",
"additionalFields": {}
},
"credentials": {
"onfleetApi": {
"id": "2",
"name": "Onfleet API Key"
}
},
"typeVersion": 1
}
],
"active": false,
"settings": {},
"connections": {
"Shopify Trigger": {
"main": [
[
{
"node": "Onfleet",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,49 @@
{
"name": "Updating Shopify tags on Onfleet events",
"nodes": [
{
"name": "Onfleet Trigger",
"type": "n8n-nodes-base.onfleetTrigger",
"position": [
460,
300
],
"webhookId": "6d6a2bee-f83e-4ebd-a1d5-8708c34393dc",
"parameters": {
"triggerOn": "taskDelayed",
"additionalFields": {}
},
"typeVersion": 1
},
{
"name": "Shopify",
"type": "n8n-nodes-base.shopify",
"position": [
680,
300
],
"parameters": {
"operation": "update",
"updateFields": {
"tags": ""
}
},
"typeVersion": 1
}
],
"active": false,
"settings": {},
"connections": {
"Onfleet Trigger": {
"main": [
[
{
"node": "Shopify",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,250 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "5cb9cd37-a73d-4f3f-b4dd-4b56e79f4056",
"name": "On order updated",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
380,
200
],
"webhookId": "0972ce92-d800-4049-ab60-7c71898ecbfa",
"parameters": {
"topic": "orders/updated"
},
"credentials": {
"shopifyApi": {
"id": "10",
"name": "Shopify account"
}
},
"typeVersion": 1
},
{
"id": "720e35c7-387e-428a-8930-0dfb67536382",
"name": "Keep only userId",
"type": "n8n-nodes-base.set",
"position": [
860,
280
],
"parameters": {
"values": {
"number": [
{
"name": "userId",
"value": "={{ $json[\"vid\"] }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "3bb1f676-6733-4c1f-b3d0-4604f8baa0c8",
"name": "New Order, deal not found",
"type": "n8n-nodes-base.if",
"position": [
1560,
220
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{$json}}",
"operation": "isEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "7f4b86a1-9ea7-4c5d-a336-eea2ec6dc341",
"name": "Do Nothing",
"type": "n8n-nodes-base.noOp",
"position": [
1800,
320
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f60c88f1-8dab-498e-9f18-d7842dfa60c6",
"name": "Create new deal",
"type": "n8n-nodes-base.hubspot",
"position": [
1800,
120
],
"parameters": {
"stage": "closedwon",
"authentication": "oAuth2",
"additionalFields": {
"amount": "={{ $node[\"Add Hubspot userId to data\"].json[\"current_total_price\"] }}",
"dealName": "={{ $node[\"Add Hubspot userId to data\"].json[\"name\"] }}",
"closeDate": "={{ $node[\"Add Hubspot userId to data\"].json[\"created_at\"] }}",
"associatedVids": "={{ $node[\"Add Hubspot userId to data\"].json[\"userId\"] }}"
}
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"typeVersion": 1
},
{
"id": "3d9de7e0-8cd4-4cea-a78c-8a862c32edeb",
"name": "Find if order already exists as deal",
"type": "n8n-nodes-base.hubspot",
"position": [
1340,
220
],
"parameters": {
"operation": "search",
"authentication": "oAuth2",
"additionalFields": {
"query": "={{ $json[\"name\"] }}"
}
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "f85b698a-872a-477b-9466-e35622b381a2",
"name": "Add Hubspot userId to data",
"type": "n8n-nodes-base.merge",
"position": [
1140,
220
],
"parameters": {
"mode": "mergeByIndex"
},
"typeVersion": 1
},
{
"id": "11502ac7-1e57-4614-9dd5-31f5fc62c91c",
"name": "Create or update contact",
"type": "n8n-nodes-base.hubspot",
"position": [
640,
280
],
"parameters": {
"email": "={{ $json[\"contact_email\"] }}",
"resource": "contact",
"authentication": "oAuth2",
"additionalFields": {
"city": "={{ $json[\"customer\"][\"default_address\"][\"city\"] }}",
"country": "={{ $json[\"customer\"][\"default_address\"][\"country\"] }}",
"lastName": "={{ $json[\"customer\"][\"default_address\"][\"last_name\"] }}",
"firstName": "={{ $json[\"customer\"][\"default_address\"][\"first_name\"] }}"
}
},
"credentials": {
"hubspotOAuth2Api": {
"id": "21",
"name": "HubSpot account"
}
},
"typeVersion": 1
}
],
"connections": {
"Keep only userId": {
"main": [
[
{
"node": "Add Hubspot userId to data",
"type": "main",
"index": 1
}
]
]
},
"On order updated": {
"main": [
[
{
"node": "Add Hubspot userId to data",
"type": "main",
"index": 0
},
{
"node": "Create or update contact",
"type": "main",
"index": 0
}
]
]
},
"Create or update contact": {
"main": [
[
{
"node": "Keep only userId",
"type": "main",
"index": 0
}
]
]
},
"New Order, deal not found": {
"main": [
[
{
"node": "Create new deal",
"type": "main",
"index": 0
}
],
[
{
"node": "Do Nothing",
"type": "main",
"index": 0
}
]
]
},
"Add Hubspot userId to data": {
"main": [
[
{
"node": "Find if order already exists as deal",
"type": "main",
"index": 0
}
]
]
},
"Find if order already exists as deal": {
"main": [
[
{
"node": "New Order, deal not found",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,286 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "94fc73af-a35d-4d5c-a192-6190d2a731ff",
"name": "Keep only UserId and email",
"type": "n8n-nodes-base.set",
"position": [
1200,
260
],
"parameters": {
"values": {
"number": [
{
"name": "ZendeskUserId",
"value": "={{ $json[\"id\"] }}"
}
],
"string": [
{
"name": "ZendeskEmail",
"value": "={{ $json[\"email\"] }}"
},
{
"name": "ZendeskPhone",
"value": "={{ $json[\"phone\"] }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "6decc852-d5b9-40c4-b51e-832283637027",
"name": "User exists in Zendesk",
"type": "n8n-nodes-base.if",
"position": [
1660,
140
],
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json[\"ZendeskUserId\"] }}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "70fa2ad7-c43c-4d22-ba6d-89495f8b5794",
"name": "Add Zendesk contact Id to Shopify data",
"type": "n8n-nodes-base.merge",
"position": [
1420,
140
],
"parameters": {
"mode": "mergeByKey",
"propertyName1": "email",
"propertyName2": "ZendeskEmail"
},
"typeVersion": 1
},
{
"id": "346d3e04-433c-4b43-868f-729d3ee67ee2",
"name": "On customer updated",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
740,
120
],
"webhookId": "a0d5e8ea-3f53-496e-a41b-cb022f715b43",
"parameters": {
"topic": "customers/update"
},
"credentials": {
"shopifyApi": {
"id": "10",
"name": "Shopify account"
}
},
"typeVersion": 1
},
{
"id": "a2ff1fa3-d67a-4abb-94ae-f22cad7de359",
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"position": [
2160,
180
],
"parameters": {},
"typeVersion": 1
},
{
"id": "41418930-0898-4602-88a3-cf4238f32890",
"name": "Contact data is modified",
"type": "n8n-nodes-base.if",
"position": [
1940,
80
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"phone\"] }}",
"value2": "={{ $json[\"ZendeskPhone\"] }}",
"operation": "notEqual"
}
]
}
},
"typeVersion": 1
},
{
"id": "ee1791fb-eaa0-4829-af3b-e72d7b3e80d5",
"name": "Create contact in Zendesk",
"type": "n8n-nodes-base.zendesk",
"position": [
1940,
240
],
"parameters": {
"name": "={{ $json[\"first_name\"] }} {{ $json[\"last_name\"] }}",
"resource": "user",
"additionalFields": {
"email": "={{ $json[\"email\"] }}",
"phone": "={{ $json[\"phone\"] ?? ' ' }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "67dc85c6-39af-43cc-951e-bcfd31b73e46",
"name": "Update contact in Zendesk",
"type": "n8n-nodes-base.zendesk",
"position": [
2160,
-20
],
"parameters": {
"id": "={{ $json[\"ZendeskUserId\"] }}",
"resource": "user",
"operation": "update",
"updateFields": {
"phone": "={{ $json[\"phone\"] ?? 0}}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
},
{
"id": "9ab30a51-e599-4361-b170-b18b9d4021cb",
"name": "Search contact by email adress",
"type": "n8n-nodes-base.zendesk",
"position": [
1000,
260
],
"parameters": {
"limit": 1,
"filters": {
"query": "={{ $json[\"email\"] }}"
},
"resource": "user",
"operation": "search"
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1,
"alwaysOutputData": true
}
],
"connections": {
"On customer updated": {
"main": [
[
{
"node": "Add Zendesk contact Id to Shopify data",
"type": "main",
"index": 0
},
{
"node": "Search contact by email adress",
"type": "main",
"index": 0
}
]
]
},
"User exists in Zendesk": {
"main": [
[
{
"node": "Contact data is modified",
"type": "main",
"index": 0
}
],
[
{
"node": "Create contact in Zendesk",
"type": "main",
"index": 0
}
]
]
},
"Contact data is modified": {
"main": [
[
{
"node": "Update contact in Zendesk",
"type": "main",
"index": 0
}
],
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
},
"Keep only UserId and email": {
"main": [
[
{
"node": "Add Zendesk contact Id to Shopify data",
"type": "main",
"index": 1
}
]
]
},
"Search contact by email adress": {
"main": [
[
{
"node": "Keep only UserId and email",
"type": "main",
"index": 0
}
]
]
},
"Add Zendesk contact Id to Shopify data": {
"main": [
[
{
"node": "User exists in Zendesk",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,216 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "1b1fd43f-5acb-45e7-bd98-e4774754cdfe",
"name": "On order updated",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
180,
520
],
"webhookId": "0972ce92-d800-4049-ab60-7c71898ecbfa",
"parameters": {
"topic": "orders/updated"
},
"credentials": {
"shopifyApi": {
"id": "10",
"name": "Shopify account"
}
},
"typeVersion": 1
},
{
"id": "d96cde15-f810-4302-aa45-554f6675b505",
"name": "Order exists in Zendesk",
"type": "n8n-nodes-base.if",
"position": [
1220,
540
],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"ZendeskTicketId\"] }}",
"operation": "isNotEmpty"
}
]
}
},
"typeVersion": 1
},
{
"id": "62c09ef2-55c8-4269-9869-c15e8a955169",
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"position": [
1500,
460
],
"parameters": {},
"typeVersion": 1
},
{
"id": "68f867c3-842c-478a-8afd-c7299e12b98d",
"name": "Find if order already has a ticket in Zendesk",
"type": "n8n-nodes-base.zendesk",
"position": [
480,
660
],
"parameters": {
"options": {
"query": "external_id:1027",
"status": "open"
},
"operation": "getAll"
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "01d4acba-8641-43e8-b333-e4494a2594d1",
"name": "Keep only ticket Id",
"type": "n8n-nodes-base.set",
"position": [
720,
660
],
"parameters": {
"values": {
"string": [
{
"name": "external_Id",
"value": "={{ $json[\"external_id\"] }}"
},
{
"name": "ZendeskTicketId",
"value": "={{ $json[\"id\"] }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
},
{
"id": "63099ec6-7ae5-4d88-881b-a6a8ae3a64b8",
"name": "Add ticket info to order data",
"type": "n8n-nodes-base.merge",
"position": [
960,
540
],
"parameters": {
"mode": "mergeByKey",
"propertyName1": "order_number",
"propertyName2": "external_Id"
},
"typeVersion": 1
},
{
"id": "79bf059e-d3b9-4323-88e5-7887deae74f7",
"name": "Create new ticket for new orders",
"type": "n8n-nodes-base.zendesk",
"position": [
1500,
640
],
"parameters": {
"description": "=Order #{{ $json[\"order_number\"] }} - {{$json[\"line_items\"].length}} item(s)\n\nOrder:\nCustomer: {{$json[\"customer\"][\"first_name\"]}} {{$json[\"customer\"][\"last_name\"]}} \nemail: {{$json[\"customer\"][\"email\"]}}\nStatus: New order",
"additionalFields": {
"status": "open",
"subject": "=Order #{{ $json[\"order_number\"] }} - {{$json[\"line_items\"].length}} item(s)",
"externalId": "={{ $json[\"order_number\"] }}"
}
},
"credentials": {
"zendeskApi": {
"id": "5",
"name": "Zendesk account"
}
},
"typeVersion": 1
}
],
"connections": {
"On order updated": {
"main": [
[
{
"node": "Find if order already has a ticket in Zendesk",
"type": "main",
"index": 0
},
{
"node": "Add ticket info to order data",
"type": "main",
"index": 0
}
]
]
},
"Keep only ticket Id": {
"main": [
[
{
"node": "Add ticket info to order data",
"type": "main",
"index": 1
}
]
]
},
"Order exists in Zendesk": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
],
[
{
"node": "Create new ticket for new orders",
"type": "main",
"index": 0
}
]
]
},
"Add ticket info to order data": {
"main": [
[
{
"node": "Order exists in Zendesk",
"type": "main",
"index": 0
}
]
]
},
"Find if order already has a ticket in Zendesk": {
"main": [
[
{
"node": "Keep only ticket Id",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,79 @@
{
"meta": {
"instanceId": "237600ca44303ce91fa31ee72babcdc8493f55ee2c0e8aa2b78b3b4ce6f70bd9"
},
"nodes": [
{
"id": "a5f74e05-acea-4ff4-b3b2-5997850be036",
"name": "On new customer",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
180,
420
],
"webhookId": "8efd263c-73fb-481b-90d8-8ae0db929548",
"parameters": {
"topic": "customers/create",
"authentication": "accessToken"
},
"credentials": {
"shopifyAccessTokenApi": {
"id": "37",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "5b4a9e71-3aa7-40d8-a439-79a504c60a46",
"name": "Create contact",
"type": "n8n-nodes-base.mautic",
"position": [
400,
420
],
"parameters": {
"email": "={{$node[\"On new customer\"].json[\"email\"]}}",
"options": {},
"lastName": "={{$node[\"On new customer\"].json[\"last_name\"]}}",
"firstName": "={{$node[\"On new customer\"].json[\"first_name\"]}}",
"additionalFields": {}
},
"credentials": {
"mauticApi": {
"id": "34",
"name": "[UPDATE ME]"
}
},
"typeVersion": 1
},
{
"id": "4b7b306e-1b4c-464f-b8f0-373167ded16f",
"name": "Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
400,
600
],
"parameters": {
"width": 332,
"height": 116,
"content": "### Add more fields to Mautic\nBy default, the first name, last name and email are pushed to Mautic. If you require more fields, add it in the `Create contact` node."
},
"typeVersion": 1
}
],
"connections": {
"On new customer": {
"main": [
[
{
"node": "Create contact",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,189 @@
{
"id": "44PIIGwPzUe9dGfb",
"meta": {
"instanceId": "6b3e8c6c30cdfbf06283a3fa57016932c6b4ec959896c5c546ef5865ff697ff1"
},
"name": "Sync New Shopify Products to Odoo Product",
"tags": [],
"nodes": [
{
"id": "5ad7f941-4146-4897-ad30-dcdccab85e82",
"name": "Odoo6",
"type": "n8n-nodes-base.odoo",
"position": [
320,
0
],
"parameters": {
"limit": 1,
"options": {},
"resource": "custom",
"operation": "getAll",
"filterRequest": {
"filter": [
{
"value": "={{ $('Shopify Trigger').all()[0].json.variants[0].product_id }}",
"fieldName": "default_code"
}
]
},
"customResource": "product.product"
},
"credentials": {
"odooApi": {
"id": "0qIK4Cq1BwOSbxT8",
"name": "Odoo 148.66.157.208:8069"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "1b1a3753-e645-465c-8155-ad8c006f3e13",
"name": "Filter2",
"type": "n8n-nodes-base.filter",
"position": [
740,
0
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.existing }}"
}
]
}
},
"typeVersion": 1
},
{
"id": "5b388afc-de9a-4246-85a8-0ef4ec8ac0bc",
"name": "Odoo7",
"type": "n8n-nodes-base.odoo",
"position": [
920,
0
],
"parameters": {
"resource": "custom",
"customResource": "product.product",
"fieldsToCreateOrUpdate": {
"fields": [
{
"fieldName": "name",
"fieldValue": "={{ $json.product_detail.title }}"
},
{
"fieldName": "default_code",
"fieldValue": "={{ $json.product_detail.variants[0].product_id }}"
},
{
"fieldName": "description",
"fieldValue": "={{ $json.product_detail.body_html }}"
},
{
"fieldName": "list_price",
"fieldValue": "={{ $json.product_detail.variants[0].price }}"
}
]
}
},
"credentials": {
"odooApi": {
"id": "0qIK4Cq1BwOSbxT8",
"name": "Odoo 148.66.157.208:8069"
}
},
"typeVersion": 1,
"alwaysOutputData": false
},
{
"id": "765aeea5-bfe8-4d6c-96a4-ebbc192a9d60",
"name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
80,
0
],
"webhookId": "30b89f06-e54c-4461-9e1e-9ef7f221e08b",
"parameters": {
"topic": "products/create",
"authentication": "accessToken"
},
"credentials": {
"shopifyAccessTokenApi": {
"id": "zkXzZzc97XyALfN8",
"name": "Evozard - Shopify"
}
},
"typeVersion": 1
},
{
"id": "e1b2f842-0b54-4f55-9c69-a4d40777fd0c",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
560,
0
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "var product_detail = $('Shopify Trigger').first().json\nconsole.log('-------product_detail--------',product_detail)\nvar existing_product = $('Odoo6').item.json\nreturn {existing:existing_product.id ? true:false,product_detail:product_detail}\n"
},
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "5dc6f917-daa8-4819-b8ff-1c46ab75b680",
"connections": {
"Code": {
"main": [
[
{
"node": "Filter2",
"type": "main",
"index": 0
}
]
]
},
"Odoo6": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Filter2": {
"main": [
[
{
"node": "Odoo7",
"type": "main",
"index": 0
}
]
]
},
"Shopify Trigger": {
"main": [
[
{
"node": "Odoo6",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,21 @@
{
"nodes": [
{
"name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
450,
450
],
"webhookId": "fd11b3d8-ff82-4902-89cc-c93b36ae38e7",
"parameters": {
"topic": "orders/create"
},
"credentials": {
"shopifyApi": "shopify_creds"
},
"typeVersion": 1
}
],
"connections": {}
}

View File

@@ -0,0 +1,202 @@
{
"id": "Zp0R3I1dUjZOIz2l",
"meta": {
"instanceId": "6b3e8c6c30cdfbf06283a3fa57016932c6b4ec959896c5c546ef5865ff697ff1",
"templateCredsSetupCompleted": true
},
"name": "Sync New Shopify Customers to Odoo Contacts",
"tags": [],
"nodes": [
{
"id": "ae072919-4f88-4722-b139-2628e24b89ba",
"name": "Filter",
"type": "n8n-nodes-base.filter",
"position": [
-420,
-40
],
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.existing }}"
}
]
}
},
"typeVersion": 1
},
{
"id": "a36747d5-3381-43b8-9def-e3dbc8942dbd",
"name": "Search Odoo Contact",
"type": "n8n-nodes-base.odoo",
"position": [
-800,
-40
],
"parameters": {
"limit": 1,
"options": {},
"resource": "custom",
"operation": "getAll",
"filterRequest": {
"filter": [
{
"value": "={{ $('Shopify Trigger').item.json.email }}",
"fieldName": "email"
}
]
},
"customResource": "res.partner"
},
"credentials": {
"odooApi": {
"id": "0qIK4Cq1BwOSbxT8",
"name": "Odoo 148.66.157.208:8069"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "a52d6acf-e8c2-48cd-b44c-903617c23e9e",
"name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger",
"position": [
-1060,
-40
],
"webhookId": "30b89f06-e54c-4461-9e1e-9ef7f221e08b",
"parameters": {
"topic": "customers/create",
"authentication": "accessToken"
},
"credentials": {
"shopifyAccessTokenApi": {
"id": "zkXzZzc97XyALfN8",
"name": "Evozard - Shopify"
}
},
"typeVersion": 1
},
{
"id": "f3023805-dc0b-4745-ab7b-77b2d81137e3",
"name": "Create Contact",
"type": "n8n-nodes-base.odoo",
"position": [
-240,
-40
],
"parameters": {
"resource": "custom",
"customResource": "res.partner",
"fieldsToCreateOrUpdate": {
"fields": [
{
"fieldName": "name",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].name }}"
},
{
"fieldName": "email",
"fieldValue": "={{ $('Shopify Trigger').item.json.email }}"
},
{
"fieldName": "street",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].address1 }}"
},
{
"fieldName": "street2",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].address2 }}"
},
{
"fieldName": "city",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].city }}"
},
{
"fieldName": "zip",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].zip }}"
},
{
"fieldName": "phone",
"fieldValue": "={{ $('Shopify Trigger').item.json.addresses[0].phone }}"
}
]
}
},
"credentials": {
"odooApi": {
"id": "0qIK4Cq1BwOSbxT8",
"name": "Odoo 148.66.157.208:8069"
}
},
"typeVersion": 1,
"alwaysOutputData": false
},
{
"id": "4cef59ef-0ba4-4eee-83b6-27254ffd5974",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
-600,
-40
],
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "\n\nvar contact_detail = $('Shopify Trigger').item.json\nconsole.log('-------contact_detail--------',contact_detail)\nvar existing_contact = $('Search Odoo Contact').item.json\nconsole.log('-------existing_contact--------',existing_contact,existing_contact.valueOf)\nreturn {existing:existing_contact.id ? true:false,contact_detail:contact_detail}\n"
},
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4c04743a-c0c3-4900-9963-3ca05b65908c",
"connections": {
"Code": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"Filter": {
"main": [
[
{
"node": "Create Contact",
"type": "main",
"index": 0
}
]
]
},
"Shopify Trigger": {
"main": [
[
{
"node": "Search Odoo Contact",
"type": "main",
"index": 0
}
]
]
},
"Search Odoo Contact": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
}
}
}