{ "name": "My workflow 5", "nodes": [ { "parameters": { "operation": "extractHtmlContent", "dataPropertyName": "body", "extractionValues": { "values": [ { "key": "title", "cssSelector": "title" }, { "key": "body", "cssSelector": "body" } ] }, "options": { "trimValues": true } }, "type": "n8n-nodes-base.html", "typeVersion": 1.2, "position": [ 420, 0 ], "id": "5af35a8b-149d-47f8-8a89-30fe7bab489d", "name": "HTML" }, { "parameters": { "formTitle": "Top deals", "formDescription": "This form returns top deals by your preferences in the same page.\n\nYou can schedule your future deals once per day at the end of this test.", "formFields": { "values": [ { "fieldLabel": "Category", "fieldType": "dropdown", "fieldOptions": { "values": [ { "option": "Appliances" }, { "option": "Cameras, CamCorders & Drones" }, { "option": "Car Electronics " }, { "option": "Cell Phones" }, { "option": "Computers & Tablets" }, { "option": "TV & Home Theater" }, { "option": "Video Games" } ] }, "multiselect": true, "requiredField": true }, { "fieldLabel": "Email", "fieldType": "email", "placeholder": "Complete your email", "requiredField": true } ] }, "responseMode": "lastNode", "options": { "buttonLabel": "Get Deals", "path": "get-top-deals", "ignoreBots": true } }, "type": "n8n-nodes-base.formTrigger", "typeVersion": 2.2, "position": [ 0, 0 ], "id": "6e039d0b-2b2e-43b6-be8f-540e6d084f04", "name": "On form submission", "webhookId": "33e8f7c3-82fb-4339-9c91-4b19aa6c14ba" }, { "parameters": { "modelId": { "__rl": true, "value": "gpt-4o-mini", "mode": "list", "cachedResultName": "GPT-4O-MINI" }, "messages": { "values": [ { "content": "Generate a list of recommended deals in json list. Classify items by category. Generate the next properties: name, description, price, link and category. All properties will be in a property called: results. Translate texts to english if required.", "role": "system" }, { "content": "=The input text is:\n{{ $json.body }}" }, { "content": "=Categories to filter: {{ $('On form submission').item.json.Category.join(',') }}" } ] }, "jsonOutput": true, "options": {} }, "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1.8, "position": [ -340, 260 ], "id": "b6d16585-a991-47ba-94c7-9681e581c541", "name": "OpenAI1", "credentials": { "openAiApi": { "id": "oKzfvOwieOm4upQ2", "name": "OpenAi account" } } }, { "parameters": { "operation": "completion", "completionTitle": "Our recommended deals!", "completionMessage": "=We have sent {{ $('Split Out').all().length }} recommended deals to your email!", "options": {} }, "type": "n8n-nodes-base.form", "typeVersion": 1, "position": [ 660, 260 ], "id": "018c6f15-f0a8-409f-832f-ea6d70bd818a", "name": "Form", "webhookId": "a67843b4-3ab9-427b-8e52-dfc42831065d" }, { "parameters": { "oneTemplate": true, "template": "
\nThese are our recommended deals today:
\n\n
" }, "type": "n8n-nodes-document-generator.documentGenerator", "typeVersion": 1, "position": [ 240, 260 ], "id": "89097434-ad6a-4de6-8191-37c94aa8207f", "name": "DocumentGenerator" }, { "parameters": { "fieldToSplitOut": "message.content.results", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 40, 260 ], "id": "2d880f5e-2f21-4d1d-a806-129ff7a358ab", "name": "Split Out" }, { "parameters": { "fromEmail": "deals@n8nhackers.com", "toEmail": "={{ $('On form submission').first().json.Email}}", "subject": "Your last deals!", "html": "=Hi!\n
\n{{ $json.text }}\n\nBest,\n
\nThe n8nhackers team!", "options": {} }, "type": "n8n-nodes-base.emailSend", "typeVersion": 2.1, "position": [ 460, 260 ], "id": "4db0ba38-8d5e-49ee-8080-adc63848f010", "name": "Send Email", "webhookId": "626001db-5451-4225-bf98-cd74c3952754", "credentials": { "smtp": { "id": "z3kiLWNZTH4wQaGy", "name": "SMTP account" } } }, { "parameters": { "zone": { "__rl": true, "value": "web_unlocker1", "mode": "list", "cachedResultName": "web_unlocker1" }, "country": { "__rl": true, "value": "es", "mode": "list", "cachedResultName": "es" }, "url": "https://www.mediamarkt.es/es/campaign/campanas-y-ofertas", "format": "json", "requestOptions": {} }, "type": "n8n-nodes-brightdata.brightData", "typeVersion": 1, "position": [ 220, 0 ], "id": "f05283a9-281d-4e5b-9f2d-6b604faad147", "name": "BrightData", "credentials": { "brightdataApi": { "id": "jk945kIuAFAo9bcg", "name": "BrightData account" } } } ], "pinData": {}, "connections": { "HTML": { "main": [ [ { "node": "OpenAI1", "type": "main", "index": 0 } ] ] }, "OpenAI1": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "DocumentGenerator": { "main": [ [ { "node": "Send Email", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "DocumentGenerator", "type": "main", "index": 0 } ] ] }, "Send Email": { "main": [ [ { "node": "Form", "type": "main", "index": 0 } ] ] }, "On form submission": { "main": [ [ { "node": "BrightData", "type": "main", "index": 0 } ] ] }, "BrightData": { "main": [ [ { "node": "HTML", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "5b448645-20e7-463c-bbe9-d15149c41296", "meta": { "templateCredsSetupCompleted": true, "instanceId": "b1f85eae352fde76d801a1a612661df6824cc2e68bfd6741e31305160a737e6e" }, "id": "lE9vXok0PA2AME2C", "tags": [] }