{ "navn": "Multiforumindlæg med cookies", "nodes": [ { "parametre": {}, "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [-1000, 0], "navn": "Manuel udløser" }, { "parametre": { "documentId": "1Utw9tm5Yi8WA8lsnVL03A6lbGhCKkVzry7bqvmS1gmg", "sheetName": "Sheet1" }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.6, "position": [-800, 0], "navn": "Hent forumdata", "legitimationsoplysninger": { "googleSheetsOAuth2Api": "Google Sheets-konto 3" } }, { "parametre": { "batchSize": 1, "options": {} }, "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [-600, 0], "name": "Loop Forums" }, { "parametre": { "modelId": "models/gemini-2.0-flash-exp", "messages": [ { "content": "Skriv et forumindlæg for '{{ $json.forumName }}' om 'Fordele ved AI i skrivning' på under 200 ord. Inkluder et backlink til {{ $json.backlinkUrl }} med ankerteksten '{{ $json.backlinkAnchor }}'. Separate title and body with ---"
}
]
},
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"typeVersion": 1,
"position": [-400, 0],
"name": "Generate Forum Post",
"credentials": {
"googlePalmApi": "Google Gemini(PaLM) Api account 4"
}
},
{
"parameters": {
"assignments": [
{
"name": "posttitle",
"value": "={{ $json.content.split('---')[0] }}"
},
{
"name": "postbody",
"value": "={{ $json.content.split('---')[1] }}"
}
]
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [-200, 0],
"name": "Format Post"
},
{
"parameters": {
"method": "POST",
"url": "={{ $json.loginUrl }}",
"sendBody": true,
"bodyParameters": [
{
"name": "username",
"value": "={{ $json.username }}"
},
{
"name": "password",
"value": "={{ $json.password }}"
}
],
"options": {
"fullResponse": true
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [0, 0],
"name": "Login to Forum"
},
{
"parameters": {
"assignments": [
{
"name": "cookie",
"value": "={{ $json.headers['set-cookie'][0].split(';')[0] }}"
}
]
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [200, 0],
"name": "Extract Cookie"
},
{
"parameters": {
"method": "POST",
"url": "={{ $json.postUrl }}",
"sendBody": true,
"bodyParameters": [
{
"name": "posttitle",
"value": "={{ $('Format Post').item.json.posttitle }}"
},
{
"name": "body",
"value": "={{ $('Format Post').item.json.postbody }}"
}
],
"options": {
"headers": {
"Cookie": "={{ $('Extract Cookie').item.json.cookie }}"
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [400, 0],
"name": "Submit Post (With Cookie)"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [600, 0],
"name": "Next Forum"
}
],
"connections": {
"Manual Trigger": {
"main": [[{ "node": "Get Forum Data", "type": "main", "index": 0 }]]
},
"Get Forum Data": {
"main": [[{ "node": "Loop Forums", "type": "main", "index": 0 }]]
},
"Loop Forums": {
"main": [[{ "node": "Generate Forum Post", "type": "main", "index": 0 }]]
},
"Generate Forum Post": {
"main": [[{ "node": "Format Post", "type": "main", "index": 0 }]]
},
"Format Post": {
"main": [[{ "node": "Login to Forum", "type": "main", "index": 0 }]]
},
"Login to Forum": {
"main": [[{ "node": "Extract Cookie", "type": "main", "index": 0 }]]
},
"Extract Cookie": {
"main": [[{ "node": "Submit Post (With Cookie)", "type": "main", "index": 0 }]]
},
"Submit Post (With Cookie)": {
"main": [[{ "node": "Next Forum", "type": "main", "index": 0 }]]
},
"Next Forum": {
"main": [[{ "node": "Loop Forums", "type": "main", "index": 0 }]]
}
}
}