{
  "nodes": [
    {
      "id": "66c32da3-373c-42a9-bf51-5bec1fd6c4cd",
      "name": "Trigger manuell",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        1240,
        1360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e206b173-eb8a-4721-8251-8b0ebb2aa38f",
      "name": "Beim Formularabsenden",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1300,
        1760
      ],
      "parameters": {
        "options": {
          "ignoreBots": true,
          "buttonLabel": "Absenden",
          "respondWithOptions": {
            "values": {
              "redirectUrl": "=https://docs.google.com/spreadsheets/u/0/",
              "respondWith": "redirect"
            }
          },
          "formTitle": "LinkedIn Kommentar-Extraktor",
          "formFields": {
            "values": [
              {
                "fieldType": "textarea",
                "fieldLabel": "Post IDs/URLs",
                "placeholder": "z.B. 7334385757769416704, https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/",
                "requiredField": true
              },
              {
                "fieldType": "number",
                "fieldLabel": "Anzahl der zu extrahierenden Kommentare",
                "placeholder": "Standard: 100"
              }
            ]
          },
          "responseMode": "lastNode",
          "formDescription": "<div>Fügen Sie die LinkedIn-Post URLs hinzu.</div>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d90f3510-b326-4352-90f4-772eca3d5b9b",
      "name": "Setze APIFY Token",
      "type": "n8n-nodes-base.set",
      "position": [
        1820,
        1460
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "20febbcc-0a59-4a89-8932-9bbb34b0e9f9",
              "name": "APIFY_TOKEN",
              "type": "string",
              "value": "$env.APIFY_TOKEN"
            },
            {
              "id": "291758a3-c73f-4db5-a2b3-5f88664a8b53",
              "name": "limit",
              "type": "number",
              "value": "={ { $json.limit } }"
            },
            {
              "id": "921b72d5-3688-4324-9d36-50668548344e",
              "name": "postIds",
              "type": "array",
              "value": "={ { $json.postIds } }"
            }
          ]
        },
        "includeOtherFields": true
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "fdbf8690-b517-4773-819a-e8bd92ddcd25",
      "name": "Apify Kommentar Scraper ausführen",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2180,
        1460
      ],
      "parameters": {
        "url": "={ { 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' + $json.APIFY_TOKEN } }",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "postIds",
              "value": "={ { $json.postIds } }"
            },
            {
              "name": "page_number",
              "value": "={ { 1 } }"
            },
            {
              "name": "limit",
              "value": "={ { $json.limit } }"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2876c38b-ed23-4d6b-9a65-97c1b70d245a",
      "name": "Erstelle ein einzigartiges Lead",
      "type": "n8n-nodes-base.code",
      "position": [
        4180,
        1480
      ],
      "parameters": {
        "jsCode": "// Verarbeitung zum Extrahieren einzigartiger Profile"
      },
      "typeVersion": 2
    },
    {
      "id": "33928b41-e209-4240-a636-41874b87b2f8",
      "name": "Erstelle Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5920,
        1640
      ],
      "parameters": {
        "title": "=LinkedIn-Posts-Comments-Leads-{ { $now.format('yyyy-MM-dd') } }",
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "Leads"
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    }
  ],
  "connections": {
    "Add Leads": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set APIFY Token": {
      "main": [
        [
          {
            "node": "Apify Kommentar Scraper ausführen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Beim Formularabsenden": {
      "main": [
        [
          {
            "node": "Setze APIFY Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}