{
  "id": "P6NgvqQqtFTVhQ09",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Candidates Rate (Submitted)",
  "tags": [],
  "nodes": [
    {
      "id": "24307a82-75e4-4e51-b888-5be1e8dcf576",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -1360,
        288
      ],
      "parameters": {
        "form": "YOUR_JOTFORM_ID_HERE"
      },
      "credentials": {
        "jotFormApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e970b876-3ba7-4e01-8b24-bec20187e905",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1088,
        288
      ],
      "parameters": {
        "text": "=You are a UGC candidate evaluator for [Company Name] skincare campaigns.\n\nRead the candidate form data and calculate a score (0\u201310) based on these rules:\n+3 if has previous UGC/content experience\n+1 if lives in Helwan\n+1 if age 20\u201325\n+0.5 if 15\u201320\n+2 if no kids\n+1 if has child 0\u20132 years\n+1 if mentions liking or using XQ products\n+0.5 if skin is normal/dry/combination\n+0.5 if not sensitive\n\nReturn only the number \u2014 no text, no JSON, no explanation.\n\nCandidate data:\n{{ JSON.stringify($json, null, 2) }}\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "e48ba0bd-d476-492a-b215-2722997d3f19",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1136,
        512
      ],
      "parameters": {
        "options": {
          "temperature": 0.2
        },
        "modelName": "models/gemini-2.5-flash-lite"
      },
      "typeVersion": 1
    },
    {
      "id": "7c9cdf5f-0712-4dad-8e87-3f13aefcaae9",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -352,
        160
      ],
      "parameters": {
        "columns": {
          "value": {
            "Age ": "={{ $('JotForm Trigger').item.json['Age From'] }}",
            "Kids": "={{ $('JotForm Trigger').item.json['If you a Mother Please choose you child\\'s age '] }}",
            "Email": "={{ $('JotForm Trigger').item.json.Email }}",
            "Links": "={{ $('JotForm Trigger').item.json['Instagram / Tiktok Links'] }}",
            "AI Rate": "={{ $json.output }}",
            "Address": "={{ $('JotForm Trigger').item.json.Address }}",
            "Work Exp": "={{ $('JotForm Trigger').item.json['Do you have previous similar work experience?'][0] }}",
            "Skin Sens": "={{ $('JotForm Trigger').item.json['Is your skin sensitive or not?'] }}",
            "Skin Type": "={{ $('JotForm Trigger').item.json['What is your skin type?'] }}",
            "Phone Number": "={{ $('JotForm Trigger').item.json['Mobile Number '] }}",
            "Candidate Name": "={{ $('JotForm Trigger').item.json['Your Name'] }}",
            "\u0627\u0644\u062a\u0627\u0631\u064a\u062e": "={{$now}}"
          },
          "schema": [
            {
              "id": "Candidate Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Candidate Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "\u0627\u0644\u062a\u0627\u0631\u064a\u062e",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "\u0627\u0644\u062a\u0627\u0631\u064a\u062e",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Number",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Phone Number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Links",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Links",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Skin Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Skin Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Skin Sens",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Skin Sens",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Age ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Age ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Kids",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Kids",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI Rate",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "AI Rate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Work Exp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Work Exp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_DOCUMENT_ID/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_DOCUMENT_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_DOCUMENT_ID/edit?usp=drivesdk",
          "cachedResultName": "XQ UGC"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "218f82ef-22a9-4b1d-8ddf-d8eceec69f93",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -656,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ef502dfe-2c19-457e-be7e-b61b80d2324e",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": 6
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "9f42af24-db42-4a66-8174-5cb3102e0924",
      "name": "Send Candidate Shortlist Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -32,
        -64
      ],
      "parameters": {
        "sendTo": "={{ $json.Email }}",
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "6abfc3d9-2a0c-495c-b958-b710df7188b8",
      "name": "Notify HR of Shortlist",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -48,
        240
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "options": {}
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ad9c4f6f-1072-488e-b534-d634ced1a0e9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1456,
        208
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 208,
        "content": "Starts the workflow upon form submission. It captures all the candidate's qualification and personal data."
      },
      "typeVersion": 1
    },
    {
      "id": "e95fce78-dd45-460b-b03c-b0ed5ea07558",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        208
      ],
      "parameters": {
        "color": 6,
        "width": 368,
        "content": "Calculates a numerical UGC candidate score (0-10) based on the predefined rules from the input data. It uses the Gemini Chat Model for the evaluation."
      },
      "typeVersion": 1
    },
    {
      "id": "2d24b424-d383-440f-a870-97ed9ac62a67",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        208
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "content": "A conditional gate that allows only candidates with an AI Rate of 6 or higher to proceed through the rest of the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "2de88f97-dd75-494c-8358-274566a239a2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        64
      ],
      "parameters": {
        "color": 5,
        "content": "Adds the candidate's full data and their calculated AI Rate to the Google Sheet. It uses the Email to prevent duplicate entries."
      },
      "typeVersion": 1
    },
    {
      "id": "f3af5415-27be-4580-8178-16f5bf12db3c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -160
      ],
      "parameters": {
        "color": 4,
        "content": "Sends a customized email to the candidate's address, notifying them that they have been shortlisted based on their high score."
      },
      "typeVersion": 1
    },
    {
      "id": "f2b14e62-bf51-4cf6-9a71-22f2278b5456",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        160
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "content": "Sends an internal email to the HR contact (Marketingr@yourcompany.com) with the shortlisted candidate's name and score for quick follow-up."
      },
      "typeVersion": 1
    },
    {
      "id": "51d91032-c735-497c-acc9-b393203696c5",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -624
      ],
      "parameters": {
        "width": 1024,
        "height": 736,
        "content": "# JotForm Setup Guide\n\n\n## \u26a1 Step 1: Link with the Webhook\n\n\n* **1. Log in to your JotForm account, select your Form, and navigate to Settings.**\n\n* **2. Go to Integrations and search for Webhooks.**\n\n* **3. Paste the JotForm Trigger Webhook URL provided by your n8n workflow into the field.**\n\n* **4. Save and activate! Your form is now live!**\n\n## \ud83d\udd11 Step 2: Unlock File Access (API Key)\n\n* **1.Generate a JotForm API Key in your JotForm account settings.**\n\n* **2.CRITICAL: Set the key permission level to \"Full Access\" (required for file downloads).**\n\n* **3.Go to your n8n workflow and insert this key into:**\n    * **I.The JotForm Trigger node's credential.**\n    * **II.The Fetch All Receipts node's query parameters.**\n\n## \u2699\ufe0f Step 3: Configure Your n8n Nodes\n\n* **In the JotForm Trigger node replace the placeholder with your actual JotForm ID.**\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "63943148-66f8-4b6c-8ad7-13b994ff669d",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Send Candidate Shortlist Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify HR of Shortlist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}