n8n-backup/workflows/Shopify <--> Mautic.json

561 lines
14 KiB
JSON
Raw Normal View History

{
"active": true,
"connections": {
"Email suchen": {
"main": [
[
{
"node": "Kontakt gefunden?",
"type": "main",
"index": 0
}
]
]
},
"Webhook1": {
"main": [
[
{
"node": "Move Binary Data",
"type": "main",
"index": 0
}
]
]
},
"Email vorhanden?": {
"main": [
[
{
"node": "Segment hinzufügen",
"type": "main",
"index": 0
}
],
[
{
"node": "Aus Segment entfernen",
"type": "main",
"index": 0
}
]
]
},
"GraphQL": {
"main": [
[
{
"node": "IF1",
"type": "main",
"index": 0
}
]
]
},
"IF1": {
"main": [
[
{
"node": "Abonniert",
"type": "main",
"index": 0
}
],
[
{
"node": "GraphQL2",
"type": "main",
"index": 0
}
]
]
},
"Mautic": {
"main": [
[
{
"node": "Email vorhanden?",
"type": "main",
"index": 0
}
]
]
},
"Kontakt gefunden?": {
"main": [
[
{
"node": "Email vorhanden?",
"type": "main",
"index": 0
}
],
[
{
"node": "Marketing Einwilligung?",
"type": "main",
"index": 0
}
]
]
},
"Marketing Einwilligung?": {
"main": [
[
{
"node": "Mautic",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Shopify Trigger": {
"main": [
[
{
"node": "Email suchen",
"type": "main",
"index": 0
}
]
]
},
"Crypto": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "GraphQL",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
]
]
},
"Move Binary Data": {
"main": [
[
{
"node": "Crypto",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2023-08-25T09:30:15.825Z",
"id": "4",
"meta": null,
"name": "Shopify <--> Mautic",
"nodes": [
{
"parameters": {
"authentication": "oAuth2",
"operation": "getAll",
"limit": 1,
"options": {
"search": "={{ $json.email }}"
}
},
"id": "2ab62e7d-70aa-444e-a4a3-d5b6f4db23e4",
"name": "Email suchen",
"type": "n8n-nodes-base.mautic",
"typeVersion": 1,
"position": [
-360,
300
],
"alwaysOutputData": true,
"credentials": {
"mauticOAuth2Api": {
"id": "6",
"name": "Mautic account"
}
}
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "contactSegment",
"operation": "remove",
"contactId": "={{ $json.id }}",
"segmentId": 1
},
"id": "830fd450-d149-47b1-afd0-5999ecdcdf54",
"name": "Aus Segment entfernen",
"type": "n8n-nodes-base.mautic",
"typeVersion": 1,
"position": [
780,
400
],
"credentials": {
"mauticOAuth2Api": {
"id": "6",
"name": "Mautic account"
}
}
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "contactSegment",
"contactId": "={{ $json.id }}",
"segmentId": 1
},
"id": "a1f319db-2e89-42d7-a018-a5f008e918dc",
"name": "Segment hinzufügen",
"type": "n8n-nodes-base.mautic",
"typeVersion": 1,
"position": [
780,
160
],
"credentials": {
"mauticOAuth2Api": {
"id": "6",
"name": "Mautic account"
}
}
},
{
"parameters": {
"httpMethod": "POST",
"path": "c83eb6ce-40dd-418c-952a-ed62a051a00b",
"options": {
"rawBody": true
}
},
"id": "98653876-b909-4416-a8ee-aa5857078b48",
"name": "Webhook1",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-560,
1140
],
"webhookId": "c83eb6ce-40dd-418c-952a-ed62a051a00b"
},
{
"parameters": {
"authentication": "headerAuth",
"endpoint": "https://lana-kk.myshopify.com/admin/api/2023-04/graphql.json",
"query": "={\n customers(first: 1, query: \"email:'{{ $json[\"body\"][\"mautic.lead_channel_subscription_changed\"][0][\"contact\"][\"fields\"][\"core\"][\"email\"][\"value\"] }}'\" ) {\n edges {\n node {\n id\n email\n marketingOptInLevel\n }\n }\n }\n}"
},
"id": "08ea065c-cc8d-4020-89c0-0aa35d99a373",
"name": "GraphQL",
"type": "n8n-nodes-base.graphql",
"typeVersion": 1,
"position": [
340,
1000
],
"credentials": {
"httpHeaderAuth": {
"id": "5",
"name": "lanakk.com - Shopify"
}
}
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "= {{ $node.Webhook1.json.body[\"mautic.lead_channel_subscription_changed\"][0].new_status }}",
"operation": "regex",
"value2": "=contactable"
}
]
},
"combineOperation": "any"
},
"id": "107bae94-57b1-4991-a8eb-41e85e5f85af",
"name": "IF1",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
580,
1000
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $node[\"Shopify Trigger\"].json[\"accepts_marketing\"] }}",
"value2": "={{ true }}"
}
]
}
},
"id": "b83cfae2-25dc-4ed6-8133-73ee7bb94b29",
"name": "Email vorhanden?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
540,
280
]
},
{
"parameters": {
"authentication": "headerAuth",
"endpoint": "https://lana-kk.myshopify.com/admin/api/2023-04/graphql.json",
"requestFormat": "json",
"query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"UNSUBSCRIBED\" } }}"
},
"id": "4815d1b0-2455-4bb0-8dd3-717b216e60a1",
"name": "GraphQL2",
"type": "n8n-nodes-base.graphql",
"typeVersion": 1,
"position": [
820,
1140
],
"credentials": {
"httpHeaderAuth": {
"id": "5",
"name": "lanakk.com - Shopify"
}
}
},
{
"parameters": {
"authentication": "headerAuth",
"endpoint": "https://lana-kk.myshopify.com/admin/api/2023-04/graphql.json",
"requestFormat": "json",
"query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"SUBSCRIBED\" } }}"
},
"id": "52d46a11-f459-449c-b93e-2890a94b1e65",
"name": "Abonniert",
"type": "n8n-nodes-base.graphql",
"typeVersion": 1,
"position": [
820,
860
],
"credentials": {
"httpHeaderAuth": {
"id": "5",
"name": "lanakk.com - Shopify"
}
}
},
{
"parameters": {
"authentication": "oAuth2",
"email": "={{ $('Shopify Trigger').item.json[\"email\"] }}",
"firstName": "={{ $('Shopify Trigger').item.json[\"first_name\"] }}",
"lastName": "={{ $('Shopify Trigger').item.json[\"last_name\"] }}",
"company": "=",
"additionalFields": {},
"options": {}
},
"id": "cb999a33-6849-4e36-8141-b5e80c19b175",
"name": "Mautic",
"type": "n8n-nodes-base.mautic",
"typeVersion": 1,
"position": [
340,
440
],
"credentials": {
"mauticOAuth2Api": {
"id": "6",
"name": "Mautic account"
}
}
},
{
"parameters": {},
"id": "614139b6-28fa-4983-9732-9cfaad82067a",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
340,
640
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.id }}",
"operation": "isNotEmpty"
}
]
}
},
"id": "2e6cebc8-94ce-473c-9248-f5cc359ee300",
"name": "Kontakt gefunden?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
-140,
300
],
"alwaysOutputData": false
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $('Shopify Trigger').item.json[\"accepts_marketing\"] }}",
"value2": "={{ true }}"
}
]
}
},
"id": "f6faee14-d93d-4b85-b8fa-9f4d8c127594",
"name": "Marketing Einwilligung?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
60,
460
]
},
{
"parameters": {
"authentication": "accessToken",
"topic": "customers/update"
},
"id": "b20ef5e3-b002-4d29-bacf-cb731237803b",
"name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger",
"typeVersion": 1,
"position": [
-560,
300
],
"webhookId": "ebce58fc-45cf-4c1c-8427-3ffbaccdb440",
"credentials": {
"shopifyAccessTokenApi": {
"id": "11",
"name": "Shopify Access Token account"
}
}
},
{
"parameters": {
"action": "hmac",
"type": "SHA256",
"value": "={{ $json.data }}",
"dataPropertyName": "=key",
"secret": "0a9dcfe4f362625efc5a38bc709598c61869552fcfc1aceb8fc08edad8dd3825",
"encoding": "base64"
},
"id": "2c64dae7-5409-4767-92ab-43239bb038f0",
"name": "Crypto",
"type": "n8n-nodes-base.crypto",
"typeVersion": 1,
"position": [
-140,
1140
]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json[\"headers\"][\"webhook-signature\"] }}",
"value2": "={{ $json.key }}"
}
]
}
},
"id": "d16fae8c-6b13-42cb-831b-437c41919b1b",
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
80,
1140
]
},
{
"parameters": {
"setAllData": false,
"options": {}
},
"id": "2677101f-c550-4748-afef-e41fe1af0604",
"name": "Move Binary Data",
"type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1,
"position": [
-360,
1140
]
},
{
"parameters": {},
"id": "6cb7bd1f-939d-43af-966e-171a1ba3d7da",
"name": "No Operation, do nothing1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
340,
1300
]
},
{
"parameters": {
"endpoint": "https://swapi-graphql.netlify.app/.netlify/functions/index",
"query": "query Query { allFilms { films { title director releaseDate speciesConnection { species { name classification homeworld { name } } } } } }"
},
"id": "49c0a40f-d1a2-453a-ac5b-37230206772f",
"name": "GraphQL1",
"type": "n8n-nodes-base.graphql",
"typeVersion": 1,
"position": [
180,
160
]
}
],
"pinData": {},
"settings": {},
"staticData": {
"node:Shopify Trigger": {
"webhookId": 1312155762953
}
},
"tags": [],
"triggerCount": 2,
"updatedAt": "2023-11-14T13:26:40.000Z",
"versionId": "6f7a68f7-7b82-48d6-ad81-32f0a75e5954"
}