{
  "name": "My workflow 2",
  "nodes": [
    {
      "parameters": {
        "formTitle": "ENTREZ VOS NOTES ",
        "formDescription": "soon ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Math"
            },
            {
              "fieldLabel": "PC ",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "ANG",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "FRANCAIS",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "SVT",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "ARABE"
            },
            {
              "fieldLabel": "INFORMATIQUE",
              "fieldType": "textarea"
            },
            {
              "fieldLabel": "AIME LES LANGUES",
              "fieldType": "checkbox",
              "fieldOptions": {
                "values": [
                  {
                    "option": "OUI "
                  },
                  {
                    "option": "NON"
                  }
                ]
              }
            },
            {
              "fieldLabel": "AIME LA TECHNOLOGIE",
              "fieldType": "checkbox",
              "fieldOptions": {
                "values": [
                  {
                    "option": "OUI"
                  },
                  {
                    "option": "NON"
                  }
                ]
              }
            },
            {
              "fieldLabel": "AIME DES SCIENCES ",
              "fieldType": "checkbox",
              "fieldOptions": {
                "values": [
                  {
                    "option": "OUI"
                  },
                  {
                    "option": "NON"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [
        0,
        0
      ],
      "id": "05bed25d-fc0c-406e-9a58-9cb7a85474cc",
      "name": "On form submission",
      "webhookId": "a75e0b5c-32c1-4005-996b-52364e5153d9"
    },
    {
      "parameters": {
        "jsCode": "// Exemple de données\nconst data = [\n  {\n    \"row_number\": 1,\n    \"Élève\": \"eleve1\",\n    \"Math\": \"math1\",\n    \"Physique\": \"physique1\",\n    \"SVT\": \"svt1\",\n    \"Arabe\": \"arabe1\",\n    \"Français\": \"francais1\",\n    \"Anglais\": \"anglais1\",\n    \"Aime les sciences\": \"science1\",\n    \"Aime les langues\": \"langue1\",\n    \"Aime la technologie\": \"technologie1\"\n  },\n  {\n    \"row_number\": 2,\n    \"Élève\": \"eleve2\",\n    \"Math\": \"math2\",\n    \"Physique\": \"physique2\",\n    \"SVT\": \"svt2\",\n    \"Arabe\": \"arabe2\",\n    \"Français\": \"francais2\",\n    \"Anglais\": \"anglais2\",\n    \"Aime les sciences\": \"science2\",\n    \"Aime les langues\": \"langue2\",\n    \"Aime la technologie\": \"technologie2\"\n  },\n  // jusqu'à eleve5\n];\n\n// On regroupe toutes les données dans un seul objet\nconst output = {\n  élèves: data.map(el => ({\n    nom: el.Élève,\n    matières: {\n      Math: el.Math,\n      Physique: el.Physique,\n      SVT: el.SVT\n    },\n    langues: {\n      Arabe: el.Arabe,\n      Français: el.Français,\n      Anglais: el.Anglais\n    },\n    goûts: {\n      sciences: el[\"Aime les sciences\"],\n      langues: el[\"Aime les langues\"],\n      technologie: el[\"Aime la technologie\"]\n    }\n  }))\n};\n\nreturn [{ json: output }];\n\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        208,
        0
      ],
      "id": "1544470e-0053-4cef-b828-7d66bd0ee039",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        288,
        208
      ],
      "id": "cd0b6bd3-ef37-42c7-858c-0b4fefceafcf",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "lpbOLiWWH5j4HkoN",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "DIS MOI L ORIENTATION DE CET ELEVE EN SE BASANT SUR CES NOTES ET CES CHOIX : SI LES NOTES DES SCIENCES SONT SUPERIEUR A 10 TU DIS UNE ORIENTATION SCIENTIFIQUE ET SI LES NOTES DES SCIENCES SONT INFERIEUR A 10 TU DONNE UNE FILIERE LITERAIRE ET SI C MOYEN UNE FILIERE TECHNOLOGIE ( juste dis une filiere c nest pas important si c soit vrai ou faux ET essaye de plus specifie quelle fiiliere ex : scientifique : sc math ...essaye de dire si a partir des choix dernier sur lorientation  )\n",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        416,
        16
      ],
      "id": "c45de9d6-7fef-493a-a352-788281f11b13",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "AIzaSyA85yJzbonoMi2KpzosQmW6oPD1AEAY6J4"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        432,
        224
      ],
      "id": "b6e5b2c1-00d5-4f7c-93ce-276a8a47b3cc",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "eDC6Yd4HrlfZVfcQ",
          "mode": "list",
          "cachedResultUrl": "/workflow/eDC6Yd4HrlfZVfcQ",
          "cachedResultName": "My workflow 2"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {}
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2.2,
      "position": [
        576,
        224
      ],
      "id": "904d5649-f319-49a7-a3c3-dfb55c0c42b8",
      "name": "Call 'My workflow 2'"
    },
    {
      "parameters": {
        "content": "## FORMULAIRE A REMPLIRE  \n remplire ce formulaire permettra a lagent de bien identifier l orientation \n",
        "color": 2
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        112
      ],
      "typeVersion": 1,
      "id": "589a4acc-556f-4d38-ba16-27893c26de42",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## JAVA CODE \n ce code permet de reunir tous les sorties su formulaire ( donnes ex : note math ... )",
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -128
      ],
      "typeVersion": 1,
      "id": "7825e2f9-7ee7-48bd-83a7-50b85f4ad6cb",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Agent Ai \ncet agenty va identifier la filliere correspondante en fonction des notes et des interets de l etudiant ",
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -128
      ],
      "typeVersion": 1,
      "id": "cadac5db-a93d-4dfb-b402-34bb26fe8a6d",
      "name": "Sticky Note2"
    }
  ],
  "pinData": {},
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Call 'My workflow 2'": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c0389b68-937a-4727-848b-f519d6382494",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "1845139cd31d24f39a3a1c4420048985fa608bc2ea8f058dfee62e62e3f55588"
  },
  "id": "eDC6Yd4HrlfZVfcQ",
  "tags": []
}