{
  "id": "JJSKBObsmymp2bU9",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Notion - 3rd Brain",
  "tags": [],
  "nodes": [
    {
      "id": "2f4ecc20-184c-4dc4-8232-bc8ba6ecf261",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "135651f9-845e-4935-a1ae-cc83e8a1f845",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        220,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "list",
          "value": "1qYi9QBfBFu9jWXLoR7fdTn7FOwbceiL5",
          "cachedResultUrl": "https://drive.google.com/YOUR_AWS_SECRET_KEY_HERE/view?usp=drivesdk",
          "cachedResultName": "2ufyv-ng4c6.csv"
        },
        "options": {
          "binaryPropertyName": "data"
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a5a78379-862f-4677-a541-0c1a41fe1eef",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        620,
        0
      ],
      "parameters": {
        "jsCode": "const contacts = [];\n\nfor (const contact of items) {\n  const firstName = contact.json[\"First Name\"] || \"\";\n  const lastName = contact.json[\"Last Name\"] || \"\";\n  const fullName = contact.json[\"Display Name\"] || `${firstName} ${lastName}`.trim();\n  const email = contact.json[\"E-mail Address\"] || \"\";\n  const phone = contact.json[\"Mobile Phone\"] || contact.json[\"Home Phone\"] || \"\";\n\n  contacts.push({\n    json: {\n      name: fullName,\n      email: email,\n      phone: phone,\n      company: contact.json[\"Company\"] || \"\"\n    }\n  });\n}\n\nreturn contacts;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d0578f34-fa9c-4576-a1df-a54961edc5b6",
      "name": "Create a database page",
      "type": "n8n-nodes-base.notion",
      "position": [
        840,
        0
      ],
      "parameters": {
        "title": "={{ $json.name }}",
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "22243337-8e81-80a8-bc67-c2494034f1b4",
          "cachedResultUrl": "https://www.notion.so/222433378e8180a8bc67c2494034f1b4",
          "cachedResultName": "Contacts"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Email Address|email",
              "emailValue": "={{ $json.email ? $json.email : null}}"
            },
            {
              "key": "Phone Number|phone_number",
              "phoneValue": "={{ $json.phone ? $json.phone : null}}"
            },
            {
              "key": "Company|rich_text",
              "richText": "={{ false }}",
              "textContent": "={{ $json.company ? $json.company : \"N/A\" }}"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d6c9769e-41ea-4c82-879d-9a4a048660c7",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        420,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "a376d074-930d-4e38-b33f-0e5b51a1f13d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        200
      ],
      "parameters": {
        "width": 500,
        "height": 280,
        "content": "## How to use\n1. Get a .csv file with your contacts (you can download this from any contact manager app)\n2. Set API key for Google Drive API, and Notion (you need to create a \"connection\" in Notion)\n3. Create Database for your contacts in Notion\n4. Choose which properties to extract from the .csv and pass it in to the Notion database. Right now, it transfer 4 pieces of information: full name, email, phone, and company.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "304a9d7a-c8a2-4617-b12a-20d0658d979a",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Create a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}