{ "meta": { "instanceId": "workflow-924af4b5", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:55.308883", "updatedAt": "2025-09-29T07:07:55.308899", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "nodes": [ { "id": "9681490a-68f1-4c6a-86ea-bf2331c3125d", "name": "When clicking \"Execute Workflow\"", "type": "n8n-nodes-base.manualTrigger", "position": [ -600, 1040 ], "parameters": {}, "typeVersion": 1, "notes": "This manualTrigger node performs automated tasks as part of the workflow." }, { "id": "f665f0c6-7694-456f-b877-5f8d69b9f503", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ -680, 920 ], "parameters": { "width": 715.3278290432247, "height": 315.32782904322477, "content": "## Get and prepare Dummy Data" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "79a9ece6-daa5-4cc0-bfb8-5cf8c9e81296", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 340, 480 ], "parameters": { "width": 520.9323109877616, "height": 577.5426854600692, "content": "## Let GPT do the heavy work\n\nFor the prompt we follow the one-shot'ish principle. Also I've decided to **_NOT_** give the AI the personal data. Keeps it simpler regarding data privacy.\n\nThe AI-Chain will generate a **Headline** and the **Text** for the Email and even **decides** if we should send the user a **Coupon**." }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "51e1bc15-0b9e-4d53-9b99-0ec8ed5e00f8", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2240, 620 ], "parameters": { "width": 358, "height": 324, "content": "## HTML Email-Template without Coupon" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "ee29375a-77fe-4d13-a453-c8b62f0884a7", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 1100, 880 ], "parameters": { "width": 447, "height": 465, "content": "## Make sure we have what we need\nWe do not want to sent empty messages to our customers" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "37e09224-3649-43e0-a40f-f8177aa93cda", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 2240, 1140 ], "parameters": { "width": 369.917435648372, "height": 330.56011245057107, "content": "## HTML Email-Template with Coupon" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "5147fe48-606d-4dad-9977-2713f40fc8e6", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1880, 1140 ], "parameters": { "width": 319.84249777513367, "height": 330.6656654860422, "content": "## Mocked: Fake a Coupon Code\nFor a real life scenario add the automated coupon generation here" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "6a3ee9b0-540e-4242-a6ac-535e2b23ea3a", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ -680, 300 ], "parameters": { "width": 534.1315466553021, "height": 566.556517486655, "content": "# Documentation\n\nThis Workflow is for the n8n AI / Langchain Competition.\n\nIt solves the Problem: Personalizing marketing emails based on customer purchase history.\n\nI've found it a bit ambiguous and decided to go the \"Convert unhappy customers with a Coupon\"-Route.\n\nSo this workflow utilizes the new LangChain Node for generating personalized E-Mail campaigns and decide if the user might need a coupon to be satisfied. Classic Rebound stuff. \n\nThere is also a Node \"Some Options...\" which can be adjusted to quickly change the direction this Campaign should go.\n\nAdditionally we use n8n to generate the HTML Mails by two different Templates. One with simple text and another for that Coupon handling.\n\n.format(\"d. MMM. y\") }} | minimum purchase amount: 20$ " } ] }, "includeOtherFields": true }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "dfa6b376-dd66-40f1-8626-0f3f04e4c4bd", "name": "Download dummy data", "type": "n8n-nodes-base.httpRequest", "position": [ -380, 1040 ], "parameters": { "url": "{{ $env.WEBHOOK_URL }}", "options": {} }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "a95ce7c4-c592-40c7-9dfa-db0e37d5b71f", "name": "AI Output + Prev Data", "type": "n8n-nodes-base.merge", "position": [ 940, 1040 ], "parameters": { "mode": "combine", "options": {}, "combineBy": "combineByPosition" }, "typeVersion": 3, "notes": "This merge node performs automated tasks as part of the workflow." }, { "id": "bb0474a1-425c-4a02-a13e-385272091189", "name": "Is the result valid?", "type": "n8n-nodes-base.if", "position": [ 1160, 1040 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "9b4ced26-dd86-4ae4-8f69-6177ec42c827", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "Headline", "rightValue": "" }, { "id": "7723102c-43d2-48df-82f6-5bb45ddf615c", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "Body", "rightValue": "" } ] } }, "typeVersion": 2.2, "notes": "This if node performs automated tasks as part of the workflow." }, { "id": "b39e0b98-6824-4265-94a0-fe12154f2ad4", "name": "Coupon them or not to Coupon them", "type": "n8n-nodes-base.if", "position": [ 1620, 1040 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "967f37a1-a600-46a2-82cf-f340dd3c7a96", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.SendCoupon }}", "rightValue": "" } ] } }, "typeVersion": 2.2, "notes": "This if node performs automated tasks as part of the workflow." }, { "id": "13c4426f-f522-4127-b899-7e6397e18182", "name": "Html Template for our Email", "type": "n8n-nodes-base.html", "position": [ 2360, 740 ], "parameters": { "html": "\n\n
\n \n{{ $json['Body'] }}
\n \n \n{{ $json.output['Body'] }}
\n \n{{ $json['Coupon Terms'] }}
\n