{
  "name": "Your Job Finder Companion",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -2320,
        728
      ],
      "id": "28d77024-9a0a-45c2-9cc4-6a93d7ab0ab4",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "filterDataset",
        "dataset_id": {
          "__rl": true,
          "value": "gd_lpfll7v5hcqtkxl6l",
          "mode": "list",
          "cachedResultName": "Linkedin job listings information"
        },
        "records_limit": 1,
        "filter_type": "filters_group",
        "filters_group": "={\n  \"operator\": \"and\",\n  \"filters\": [\n    {\n      \"name\": \"job_title\",\n      \"operator\": \"includes\",\n      \"value\": \"{{ $json[\"role value\"] }}\"\n    },\n    {\n      \"name\": \"country_code\",\n      \"operator\": \"=\",\n      \"value\": \"{{ $json[\"country value\"] }}\"\n    },\n    {\n      \"name\": \"application_availability\",\n      \"operator\": \"=\",\n      \"value\": true\n    },\n    {\n      \"name\": \"url\",\n      \"operator\": \"includes\",\n      \"value\": \"http\"\n    },\n    {\n      \"name\": \"job_posted_date\",\n      \"operator\": \">\",\n      \"value\": \"{{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}\"\n    }\n  ]\n}\n",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -1872,
        536
      ],
      "id": "4aedfd9c-74fc-44ea-b50d-06682427e4b6",
      "name": "Create LinkedIn Snapshot",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "filterDataset",
        "dataset_id": {
          "__rl": true,
          "value": "gd_lpfbbndm1xnopbrcr0",
          "mode": "list",
          "cachedResultName": "Glassdoor job listings information"
        },
        "records_limit": 1,
        "filter_type": "filters_group",
        "filters_group": "={\n  \"operator\": \"and\",\n  \"filters\": [\n    {\n      \"name\": \"job_title\",\n      \"operator\": \"includes\",\n      \"value\": \"{{ $json[\"role value\"] }}\"\n    }\n  ]\n}",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -1872,
        920
      ],
      "id": "14c7b3ae-4605-45e3-934d-a67d815d40ab",
      "name": "Create Glassdoor Snapshot",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "getSnapshotMetadata",
        "snapshot_id": "={{ $json.snapshot_id }}",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -1648,
        632
      ],
      "id": "33a72a2f-e756-4c80-b726-96fb4a6522ac",
      "name": "Get Snapshot Metadata",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "59bd40ef-632a-43a1-83b6-d35509d3abc0",
              "leftValue": "={{ $json.status }}",
              "rightValue": "ready",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1424,
        536
      ],
      "id": "ee735f6d-837e-4cb1-9bd5-10b60b7cea1a",
      "name": "Check if Snapshot is ready"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "b01ce2b2-1753-4927-a22a-005bbcc7732f",
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1200,
        680
      ],
      "id": "0d71c558-9f3d-40fd-9f63-e74f3a2fa4d6",
      "name": "Check Snapshot Status"
    },
    {
      "parameters": {
        "chatId": "385394465",
        "text": "\u274c _Sorry, no job listings available for the specified keyword within the last 24 hours._",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -976,
        584
      ],
      "id": "a655ae4f-f2a7-4b51-9ba2-2848e23b624b",
      "name": "No job listing found notification",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -976,
        776
      ],
      "id": "d54e2b3e-c8ed-4d51-8cef-b21a36f97c31",
      "name": "Wait 10 seconds"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  return { snapshot_id: item?.json?.id };\n});\nreturn updatedItems;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -752,
        944
      ],
      "id": "9aee3dcc-0326-4428-a5ad-867b4b35a834",
      "name": "Parse Snapshot ID"
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "getSnapshotContent",
        "snapshot_id": "={{ $json.id }}",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -1200,
        272
      ],
      "id": "2fdbb067-b9b8-4ff1-9656-611b0f61e5ca",
      "name": "Retrieve Snapshot data",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.url }}",
                    "rightValue": "linkedin",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "id": "9b856808-4cbe-47e6-8f3e-3f0e74c8e1fb"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "linkedin"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "8ba5b1d8-89e7-44b3-a5b6-e96da54e4107",
                    "leftValue": "={{ $json.url }}",
                    "rightValue": "indeed",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "indeed"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "e622832f-168c-4fb0-87fc-31fd1c4489b1",
                    "leftValue": "={{ $json.url }}",
                    "rightValue": "glassdoor",
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "glassdoor"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -752,
        328
      ],
      "id": "a3278a20-310b-483f-9aee-9e52861db10a",
      "name": "Platform Mapping"
    },
    {
      "parameters": {
        "chatId": "385394465",
        "text": "=\ud83c\udfaf **LinkedIn Job Found**\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfe2 **{{ $json.company_name }}**\n\ud83d\udcbc **{{ $json.job_title }}**\n\ud83d\udccd {{ $json.job_location }}\n\ud83d\udcb0 {{ $json.job_base_pay_range || 'Not disclosed' }}\n\n\ud83d\udc65 **Current Applicants:** {{ $json.job_num_applicants || '0' }} candidates\n\ud83d\udcc5 **Posted:** {{ $json.job_posted_time || 'Recently' }}\n\n\ud83e\udd16 **AI Analysis:**\n{{ $json.ai_analysis }}\n\n\ud83d\udd17 **Apply:** https://www.linkedin.com/jobs/view/{{ $json.url.match(/view\\/(?:.*?-)?(\\d+)(?:\\?|$)/)?.[1] || $json.url.match(/(\\d{10})/)?.[1] || $json.url.match(/(\\d+)/)?.[1] }}\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        48,
        352
      ],
      "id": "eed2dca4-c7bf-406b-9b94-221ba1e4e67a",
      "name": "Send LinkedIn Job",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "385394465",
        "text": "=\ud83d\udcbc **Indeed Job Found**\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfe2 **{{ $json.company_name || 'Company Name Not Available' }}**\n\ud83d\udcbc **{{ $json.job_title }}**\n\ud83d\udccd {{ $json.location || $json.job_location }}\n\ud83d\udcb0 {{ $json.salary_formatted || 'Not disclosed' }}\n\n\ud83e\udd16 **AI Analysis:**\n{{ $json.ai_analysis }}\n\n\ud83d\udd17 **Apply:** {{ $json.url }}\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        48,
        544
      ],
      "id": "ad03a037-4482-4c24-984d-7893f7f960c3",
      "name": "Send Indeed Job",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "385394465",
        "text": "=\ud83c\udfc6 **Glassdoor Job Found**\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n\ud83c\udfe2 **{{ $json.company_name }}**\n\ud83d\udcbc **{{ $json.job_title }}**\n\ud83d\udccd {{ $json.job_location }}\n\ud83d\udcb0 {{ '$('+$json.pay_range_Employer_est+')' || '$('+$json.pay_median_employer+')' || 'Not disclosed' }}\n\n\ud83e\udd16 **AI Analysis:**\n{{ $json.ai_analysis }}\n\n\ud83d\udd17 **Apply:** [Link]({{ $json.url }})\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n",
        "additionalFields": {
          "parse_mode": "Markdown"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        48,
        736
      ],
      "id": "e44039e8-39e9-4c25-92b8-39b16a1c9ff4",
      "name": "Send Glassdoor Job",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "filterDataset",
        "dataset_id": {
          "__rl": true,
          "value": "gd_l4dx9j9sscpvs7no2",
          "mode": "list",
          "cachedResultName": "Indeed job listings information"
        },
        "records_limit": 1,
        "filter_type": "filters_group",
        "filters_group": "={\n  \"operator\": \"and\",\n  \"filters\": [\n    {\n      \"name\": \"job_title\",\n      \"operator\": \"includes\",\n      \"value\": \"{{ $json[\"role value\"] }}\"\n    },\n    {\n      \"name\": \"country\",\n      \"operator\": \"=\",\n      \"value\": \"{{ $json[\"country value\"] }}\"\n    },\n    {\n      \"name\": \"date_posted\",\n      \"operator\": \"=\",\n      \"value\": \"Just posted\"\n    }\n  ]\n}",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -1872,
        728
      ],
      "id": "1529f862-6e47-4c5a-aa1d-0a0cdcf591fd",
      "name": "Create Indeed Snapshot",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\n\nconst updatedItems = items.map((item) => {\n  const text = item?.json?.message?.text || \"\";\n  const splitText = text.split(\"-\").map(s => s.trim());\n\n  return {\n    json: {\n      \"role value\": splitText[0] || \"\",\n      \"country value\": splitText[1] || \"\"\n    }\n  };\n});\n\nreturn updatedItems;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -2096,
        728
      ],
      "id": "cc3b605c-9899-400f-b6c2-3efdf4745ce5",
      "name": "Convert Chat Message"
    },
    {
      "parameters": {
        "resource": "marketplaceDataset",
        "operation": "getSnapshotContent",
        "snapshot_id": "={{ $('Check if Snapshot is ready').item.json.id }}",
        "requestOptions": {}
      },
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "typeVersion": 1,
      "position": [
        -464,
        152
      ],
      "id": "28ff7226-9a43-45a5-891a-6c754d837fa1",
      "name": "Retrieve Again Snapshot Data",
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f00caffe-86cd-4434-85b4-8c667aed7598",
              "leftValue": "={{ JSON.stringify($json) }}",
              "rightValue": "Snapshot is building",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -976,
        272
      ],
      "id": "9980349d-73fe-4cdf-9e47-df1fbc8ad2cd",
      "name": "Check if Snapshot Data is ready"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -752,
        48
      ],
      "id": "92e54d88-2d50-4317-bfd5-486c4f3be143",
      "name": "Wait 5 seconds"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Analyze this job listing and provide a comprehensive review in paragraph format.\n\nJob Data: {{ JSON.stringify($json) }}\n\nProvide insights about:\n- Overall opportunity score (1-100)\n- Company analysis (reputation, industry, culture indicators)\n- Salary assessment and competitiveness\n- Role requirements and standards\n- Benefits and perks mentioned\n\nFormat as natural paragraphs, starting with \"SCORE: [number]\" then flowing text about the company and opportunity.\n\nKeep the response informative but concise (under 500 characters for Telegram).\n"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1,
      "position": [
        -528,
        352
      ],
      "id": "6e895014-1e2b-46b1-aa37-2b959edcaae7",
      "name": "Analyze LinkedIn Job Listing",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Analyze this job listing and provide a comprehensive review in paragraph format.\n\nJob Data: {{ JSON.stringify($json) }}\n\nProvide insights about:\n- Overall opportunity score (1-100)\n- Company analysis (reputation, industry, culture indicators)\n- Salary assessment and competitiveness\n- Role requirements and standards\n- Benefits and perks mentioned\n\nFormat as natural paragraphs, starting with \"SCORE: [number]\" then flowing text about the company and opportunity.\n\nKeep the response informative but concise (under 500 characters for Telegram).\n"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1,
      "position": [
        -528,
        544
      ],
      "id": "dfd16d6d-32a2-48a5-8fe5-1bba44148cee",
      "name": "Analyze Indeed Job Listing",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "models/gemini-2.5-flash",
          "mode": "list",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "messages": {
          "values": [
            {
              "content": "=Analyze this job listing and provide a comprehensive review in paragraph format.\n\nJob Data: {{ JSON.stringify($json) }}\n\nProvide insights about:\n- Overall opportunity score (1-100)\n- Company analysis (reputation, industry, culture indicators)\n- Salary assessment and competitiveness\n- Role requirements and standards\n- Benefits and perks mentioned\n\nFormat as natural paragraphs, starting with \"SCORE: [number]\" then flowing text about the company and opportunity.\n\nKeep the response informative but concise (under 500 characters for Telegram).\n"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "typeVersion": 1,
      "position": [
        -528,
        736
      ],
      "id": "0e33339a-d1b3-41f4-9fa4-b50fc940ca29",
      "name": "Analyze Glassdoor Job Listing",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Get original job data from Platform Mapping\nconst jobData = $('Platform Mapping').item.json;\n\n// Get AI response\nlet aiResponse = '';\ntry {\n  if ($json[0] && $json[0].content && $json[0].content.parts && $json[0].content.parts[0]) {\n    aiResponse = $json[0].content.parts[0].text;\n  } else if ($json.content && $json.content.parts && $json.content.parts[0]) {\n    aiResponse = $json.content.parts[0].text;\n  }\n} catch (e) {\n  aiResponse = 'AI analysis temporarily unavailable';\n}\n\n// Enhanced formatting function\nfunction formatAIAnalysis(text) {\n  if (!text) return 'Analysis not available';\n  \n  // Find score\n  const scoreMatch = text.match(/SCORE:\\s*(\\d+)/i);\n  const score = scoreMatch ? scoreMatch[1] : 'N/A';\n  \n  // Extract description (everything after SCORE: XX.)\n  let description = text.replace(/SCORE:\\s*\\d+\\.?\\s*/i, '').trim();\n  \n  // Clean up any extra periods or spaces at the beginning\n  description = description.replace(/^\\.+\\s*/, '');\n  \n  // Format with bullet points\n  return `- SCORE: ${score}\\n- ${description}`;\n}\n\nreturn {\n  ...jobData,\n  ai_analysis: formatAIAnalysis(aiResponse)\n};\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -176,
        352
      ],
      "id": "175212db-02fb-4cde-a764-5680630f917e",
      "name": "Merge Response Data with AI - LinkedIn"
    },
    {
      "parameters": {
        "jsCode": "// Get original job data from Platform Mapping\nconst jobData = $('Platform Mapping').item.json;\n\n// Get AI response\nlet aiResponse = '';\ntry {\n  if ($json[0] && $json[0].content && $json[0].content.parts && $json[0].content.parts[0]) {\n    aiResponse = $json[0].content.parts[0].text;\n  } else if ($json.content && $json.content.parts && $json.content.parts[0]) {\n    aiResponse = $json.content.parts[0].text;\n  }\n} catch (e) {\n  aiResponse = 'AI analysis temporarily unavailable';\n}\n\n// Enhanced formatting function\nfunction formatAIAnalysis(text) {\n  if (!text) return 'Analysis not available';\n  \n  // Find score\n  const scoreMatch = text.match(/SCORE:\\s*(\\d+)/i);\n  const score = scoreMatch ? scoreMatch[1] : 'N/A';\n  \n  // Extract description (everything after SCORE: XX.)\n  let description = text.replace(/SCORE:\\s*\\d+\\.?\\s*/i, '').trim();\n  \n  // Clean up any extra periods or spaces at the beginning\n  description = description.replace(/^\\.+\\s*/, '');\n  \n  // Format with bullet points\n  return `- SCORE: ${score}\\n- ${description}`;\n}\n\nreturn {\n  ...jobData,\n  ai_analysis: formatAIAnalysis(aiResponse)\n};\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -176,
        544
      ],
      "id": "a6fa4f95-3065-4b73-84c1-849e65e0270e",
      "name": "Merge Response Data with AI - Indeed"
    },
    {
      "parameters": {
        "jsCode": "// Get original job data from Platform Mapping\nconst jobData = $('Platform Mapping').item.json;\n\n// Get AI response\nlet aiResponse = '';\ntry {\n  if ($json[0] && $json[0].content && $json[0].content.parts && $json[0].content.parts[0]) {\n    aiResponse = $json[0].content.parts[0].text;\n  } else if ($json.content && $json.content.parts && $json.content.parts[0]) {\n    aiResponse = $json.content.parts[0].text;\n  }\n} catch (e) {\n  aiResponse = 'AI analysis temporarily unavailable';\n}\n\n// Enhanced formatting function\nfunction formatAIAnalysis(text) {\n  if (!text) return 'Analysis not available';\n  \n  // Find score\n  const scoreMatch = text.match(/SCORE:\\s*(\\d+)/i);\n  const score = scoreMatch ? scoreMatch[1] : 'N/A';\n  \n  // Extract description (everything after SCORE: XX.)\n  let description = text.replace(/SCORE:\\s*\\d+\\.?\\s*/i, '').trim();\n  \n  // Clean up any extra periods or spaces at the beginning\n  description = description.replace(/^\\.+\\s*/, '');\n  \n  // Format with bullet points\n  return `- SCORE: ${score}\\n- ${description}`;\n}\n\nreturn {\n  ...jobData,\n  ai_analysis: formatAIAnalysis(aiResponse)\n};\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -176,
        736
      ],
      "id": "2e6ff7f0-5937-4d05-9f97-211cd9fae3a9",
      "name": "Merge Response Data with AI - Glassdoor"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Convert Chat Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create LinkedIn Snapshot": {
      "main": [
        [
          {
            "node": "Get Snapshot Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Glassdoor Snapshot": {
      "main": [
        [
          {
            "node": "Get Snapshot Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Snapshot Metadata": {
      "main": [
        [
          {
            "node": "Check if Snapshot is ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Snapshot is ready": {
      "main": [
        [
          {
            "node": "Retrieve Snapshot data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check Snapshot Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Snapshot Status": {
      "main": [
        [
          {
            "node": "No job listing found notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10 seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10 seconds": {
      "main": [
        [
          {
            "node": "Parse Snapshot ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Snapshot ID": {
      "main": [
        [
          {
            "node": "Get Snapshot Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Platform Mapping": {
      "main": [
        [
          {
            "node": "Analyze LinkedIn Job Listing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Analyze Indeed Job Listing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Analyze Glassdoor Job Listing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Snapshot data": {
      "main": [
        [
          {
            "node": "Check if Snapshot Data is ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Indeed Snapshot": {
      "main": [
        [
          {
            "node": "Get Snapshot Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Chat Message": {
      "main": [
        [
          {
            "node": "Create Glassdoor Snapshot",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create Indeed Snapshot",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create LinkedIn Snapshot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Again Snapshot Data": {
      "main": [
        [
          {
            "node": "Check if Snapshot Data is ready",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Snapshot Data is ready": {
      "main": [
        [
          {
            "node": "Wait 5 seconds",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Platform Mapping",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 seconds": {
      "main": [
        [
          {
            "node": "Retrieve Again Snapshot Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze LinkedIn Job Listing": {
      "main": [
        [
          {
            "node": "Merge Response Data with AI - LinkedIn",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Indeed Job Listing": {
      "main": [
        [
          {
            "node": "Merge Response Data with AI - Indeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Glassdoor Job Listing": {
      "main": [
        [
          {
            "node": "Merge Response Data with AI - Glassdoor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Response Data with AI - LinkedIn": {
      "main": [
        [
          {
            "node": "Send LinkedIn Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Response Data with AI - Indeed": {
      "main": [
        [
          {
            "node": "Send Indeed Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Response Data with AI - Glassdoor": {
      "main": [
        [
          {
            "node": "Send Glassdoor Job",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "31e84431-140c-40ee-aac9-c9d463f252d1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "DmiNaX4zUJkKG8nY",
  "tags": []
}