Signal Loader

    Shared 3/14/2026

    2 views

    Visual Workflow

    JSON Code

    {
      "id": "1yHnNFfG9hkxV5h9",
      "meta": {
        "instanceId": "c50940bda9da53d2602c4c7adf07f005d9283225ebeb521baa004003e4df8e95",
        "templateCredsSetupCompleted": true
      },
      "name": "Signal Loader",
      "tags": [],
      "nodes": [
        {
          "id": "b32769bc-5a13-415d-8dd4-5e44cf8e98c4",
          "name": "Manual trigger",
          "type": "n8n-nodes-base.manualTrigger",
          "position": [
            0,
            0
          ],
          "parameters": {},
          "typeVersion": 1
        },
        {
          "id": "4f93a526-49e4-4ef4-b75d-04456bda198b",
          "name": "Read VOC CSV",
          "type": "n8n-nodes-base.googleDrive",
          "position": [
            752,
            -208
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": "1P1pISurumIs2VLI88JmINbbYqeonHjtf",
              "cachedResultUrl": "https://drive.google.com/file/d/1P1pISurumIs2VLI88JmINbbYqeonHjtf/view?usp=drivesdk",
              "cachedResultName": "voc_sample.csv"
            },
            "options": {},
            "operation": "download"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "f2ynaFjal5K6vFFq",
              "name": "Google Drive OAuth2 API"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "bae8fbe8-d945-4383-b218-d3b9d22d7f43",
          "name": "Read Clickstream CSV",
          "type": "n8n-nodes-base.googleDrive",
          "position": [
            752,
            -16
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": "17sPsI9jo4P9tfQAa1UzOR1s1uwbEeyC4",
              "cachedResultUrl": "https://drive.google.com/file/d/17sPsI9jo4P9tfQAa1UzOR1s1uwbEeyC4/view?usp=drivesdk",
              "cachedResultName": "clickstream_sample.csv"
            },
            "options": {},
            "operation": "download"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "f2ynaFjal5K6vFFq",
              "name": "Google Drive OAuth2 API"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "fd43e5f3-f4ff-4154-83aa-9c1b257b7729",
          "name": "Read SIRT CSV",
          "type": "n8n-nodes-base.googleDrive",
          "position": [
            768,
            208
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": "1xIDqvTL1AtEbT1tpxLy0WJ3Vd00e95RS",
              "cachedResultUrl": "https://drive.google.com/file/d/1xIDqvTL1AtEbT1tpxLy0WJ3Vd00e95RS/view?usp=drivesdk",
              "cachedResultName": "sirt_sample.csv"
            },
            "options": {},
            "operation": "download"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "f2ynaFjal5K6vFFq",
              "name": "Google Drive OAuth2 API"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "78ef7da9-d125-4547-ba68-5a3314076652",
          "name": "query test input",
          "type": "n8n-nodes-base.set",
          "position": [
            416,
            0
          ],
          "parameters": {
            "options": {},
            "assignments": {
              "assignments": [
                {
                  "id": "75e7bcd6-29dd-414e-9468-a048ca1f3d5d",
                  "name": "input_type",
                  "type": "string",
                  "value": "query"
                },
                {
                  "id": "8203bb7d-f86d-4c91-baa5-37df54355ba3",
                  "name": "search_value",
                  "type": "string",
                  "value": "shoes"
                }
              ]
            },
            "includeOtherFields": true
          },
          "typeVersion": 3.4,
          "alwaysOutputData": false
        },
        {
          "id": "15fa5601-dd4e-4987-b986-475d6fde71fb",
          "name": "Filter Datasets",
          "type": "n8n-nodes-base.code",
          "position": [
            1376,
            -16
          ],
          "parameters": {
            "jsCode": "// This code reads all 3 data sources and combines them by query\n\n// Grab data from all 3 inputs\nconst clickstream = $input.all().filter(i => i.json.clicks !== undefined);\nconst sirt        = $input.all().filter(i => i.json.incident_description !== undefined);\nconst voc         = $input.all().filter(i => i.json.review_text !== undefined);\n\n// Find all unique query names across all 3 files\nconst allQueries = [...new Set([\n  ...clickstream.map(i => i.json.query),\n  ...sirt.map(i => i.json.query),\n  ...voc.map(i => i.json.query)\n])];\n\n// For each query, collect all its signals\nreturn allQueries.map(query => {\n  const cs   = clickstream.filter(i => i.json.query === query);\n  const si   = sirt.filter(i => i.json.query === query);\n  const vo   = voc.filter(i => i.json.query === query);\n\n  // Calculate conversion rate from clickstream\n  const totalClicks    = cs.reduce((s, i) => s + Number(i.json.clicks), 0);\n  const totalPurchases = cs.reduce((s, i) => s + Number(i.json.purchases), 0);\n  const convRate       = totalClicks > 0\n    ? ((totalPurchases / totalClicks) * 100).toFixed(1) + '%'\n    : 'N/A';\n\n  // Gather review texts for AI (used in W2)\n  const reviewTexts = vo.map(i => i.json.review_text).join(' | ');\n\n  return { json: {\n    query,\n    category:         cs[0]?.json.category || si[0]?.json.category || 'unknown',\n    conversion_rate:  convRate,\n    total_clicks:     totalClicks,\n    voc_count:        vo.length,\n    sirt_count:       si.length,\n    sirt_themes:      [...new Set(si.map(i => i.json.theme))].join(', '),\n    voc_themes:       [...new Set(vo.map(i => i.json.theme))].join(', '),\n    review_texts:     reviewTexts,\n    is_high_signal:   vo.length >= 2 || si.length >= 2\n  }};\n});"
          },
          "executeOnce": false,
          "typeVersion": 2,
          "alwaysOutputData": true
        },
        {
          "id": "f1562d12-581b-43c6-9567-b2cd351806f3",
          "name": "VOC CSV -> JSON",
          "type": "n8n-nodes-base.extractFromFile",
          "position": [
            960,
            -208
          ],
          "parameters": {
            "options": {
              "delimiter": ","
            }
          },
          "typeVersion": 1.1
        },
        {
          "id": "48d6cf39-aed7-4ef5-841c-5cb81c1fe67e",
          "name": "Clickstream CSV -> JSON",
          "type": "n8n-nodes-base.extractFromFile",
          "position": [
            960,
            -16
          ],
          "parameters": {
            "options": {}
          },
          "typeVersion": 1.1
        },
        {
          "id": "18b09c47-0880-42e6-893c-26ef1ec25df2",
          "name": "SIRT CSV to JSON",
          "type": "n8n-nodes-base.extractFromFile",
          "position": [
            976,
            208
          ],
          "parameters": {
            "options": {}
          },
          "typeVersion": 1.1
        },
        {
          "id": "f2b0cdc2-8154-4317-ba1a-6f43bbe62c87",
          "name": "Edit Fields",
          "type": "n8n-nodes-base.set",
          "position": [
            208,
            0
          ],
          "parameters": {
            "options": {}
          },
          "typeVersion": 3.4
        }
      ],
      "active": true,
      "pinData": {},
      "settings": {
        "binaryMode": "separate",
        "callerPolicy": "any",
        "timeSavedMode": "fixed",
        "availableInMCP": false,
        "executionOrder": "v1"
      },
      "versionId": "8bbaae74-ab26-497f-a56a-3cc1097158d8",
      "connections": {
        "Edit Fields": {
          "main": [
            [
              {
                "node": "query test input",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Read VOC CSV": {
          "main": [
            [
              {
                "node": "VOC CSV -> JSON",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Read SIRT CSV": {
          "main": [
            [
              {
                "node": "SIRT CSV to JSON",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Manual trigger": {
          "main": [
            [
              {
                "node": "Edit Fields",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Filter Datasets": {
          "main": [
            []
          ]
        },
        "VOC CSV -> JSON": {
          "main": [
            [
              {
                "node": "Read Clickstream CSV",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "SIRT CSV to JSON": {
          "main": [
            [
              {
                "node": "Filter Datasets",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "query test input": {
          "main": [
            [
              {
                "node": "Read VOC CSV",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Read Clickstream CSV": {
          "main": [
            [
              {
                "node": "Clickstream CSV -> JSON",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Clickstream CSV -> JSON": {
          "main": [
            [
              {
                "node": "Read SIRT CSV",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    }