{
  "name": "Enrichissemen lead par Siren",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        688,
        160
      ],
      "id": "11fd2044-ba4c-4370-af78-f27315f09e14",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "url": "=",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "options": {}
      },
      "id": "8da1f592-50c5-4c78-95ef-6080c4f34b29",
      "name": "Enrich via API Sirene INSEE",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        1360,
        112
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "ggcAygzCTXlvEFLE",
          "name": "Api SIrene"
        }
      }
    },
    {
      "parameters": {
        "url": "https://api.pappers.in/v1/company",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "country_code",
              "value": "FR"
            },
            {
              "name": "company_number",
              "value": "={{ $json.body.siren }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        912,
        256
      ],
      "id": "1f1c1c46-956e-455a-a83f-87893742ddc8",
      "name": "Enrich with Pappers",
      "credentials": {
        "httpCustomAuth": {
          "id": "bLUc5exahxYmiamQ",
          "name": "Gamma"
        },
        "httpQueryAuth": {
          "id": "eKtrJTknkYtc5dqn",
          "name": "pappers"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1808,
        256
      ],
      "id": "6dc8053d-5f7d-43e8-be4a-25bce730dec5",
      "name": "Append or update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HQ3sDqm2Pl7nzSkR",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "messages": {
          "message": [
            {
              "content": "={{ $json.perplexityQuery }}"
            }
          ]
        },
        "options": {
          "searchDomainFilter": "fr"
        },
        "requestOptions": {}
      },
      "id": "d85912e9-88b7-4ea3-8f8c-5826683632ae",
      "name": "Enrich with Perplexity Research",
      "type": "n8n-nodes-base.perplexity",
      "typeVersion": 1,
      "position": [
        1360,
        400
      ],
      "credentials": {
        "perplexityApi": {
          "id": "B5DQJI5Q9hvBX4rm",
          "name": "Perplexity account"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "numberInputs": 3,
        "options": {
          "includeUnpaired": true
        }
      },
      "id": "4d8d90f6-168d-4154-a2a1-693773bc5fe0",
      "name": "Merge All Enrichment Data",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1584,
        240
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "companyName",
              "value": "={{ $json.body.name || $json.body.denomination || 'Unknown Company' }}",
              "type": "string"
            },
            {
              "id": "id-2",
              "name": "siren",
              "value": "={{ $json.body.siren }}",
              "type": "string"
            },
            {
              "id": "id-3",
              "name": "perplexityQuery",
              "value": "=Recherche des informations complémentaires sur l'entreprise {{ $json.body.name || $json.body.denomination }} (SIREN: {{ $json.body.siren }}). Trouve des informations sur leur activité principale, leurs produits/services, leur présence en ligne, et toute information pertinente pour la prospection commerciale.",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      },
      "id": "decdb09b-18cf-4b6d-a727-570692735cf1",
      "name": "Prepare Perplexity Query",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1136,
        400
      ]
    },
    {
      "parameters": {
        "formTitle": "Enrichissement ",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Siren",
              "placeholder": "Siren"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [
        688,
        352
      ],
      "id": "ef4753f1-3f5a-4a25-ae10-055b1f093e67",
      "name": "On form submission",
      "webhookId": "d047c138-99d8-4bcc-82da-739b93318f6e"
    },
    {
      "parameters": {
        "content": "## Merci d'avoir téléchargé ce workflow\n\nMon site : https://willymarchais.com\nYoutube : https://www.youtube.com/@willymarchais\n\nOutils :\n- n8n\n- Base SIREN (gratuit) OU Base Pappers (payant)\n\nPour obtenir votre clé API SIREN ou Pappers veuillez vous rendre sur leur site respectif (https://www.pappers.fr/api) (https://portail-api.insee.fr/).\n\n",
        "height": 736,
        "width": 1408,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        592,
        -176
      ],
      "id": "dcb8a289-b1f8-4d3d-8a8b-b780e84272cd",
      "name": "Sticky Note9"
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Enrich with Pappers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich with Pappers": {
      "main": [
        [
          {
            "node": "Enrich via API Sirene INSEE",
            "type": "main",
            "index": 0
          },
          {
            "node": "Prepare Perplexity Query",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge All Enrichment Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Perplexity Query": {
      "main": [
        [
          {
            "node": "Enrich with Perplexity Research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich via API Sirene INSEE": {
      "main": [
        [
          {
            "node": "Merge All Enrichment Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Enrich with Perplexity Research": {
      "main": [
        [
          {
            "node": "Merge All Enrichment Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Merge All Enrichment Data": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Enrich with Pappers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b3242bf3-9703-446f-ac8c-c8ac0abc458a",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "57ff3ec2ed98f4fcb0c832179a63b124ade527d62e4e66f7e1fbd158a0b7353d"
  },
  "id": "Go07drdCEb4G4gHU",
  "tags": []
}