{
  "name": "Add, update, and fetch contacts from a Notion database by email",
  "nodes": [
    {
      "id": "c9e06bcb-5c0f-497c-9a4b-31f422fe893e",
      "name": "Sticky Note — Main",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2192,
        -160
      ],
      "parameters": {
        "width": 476,
        "height": 480,
        "content": "## How it works\n1. The Manual Trigger fires with a JSON payload containing an `action` field (`create`, `update`, or `get`).\n2. The Switch node routes the request to the correct branch.\n3. **Create** "
      }
    },
    {
      "id": "e86f5856-122e-4d0c-9c88-61d1005dd3f8",
      "name": "Sticky Note — Create",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -512
      ],
      "parameters": {
        "width": 716,
        "height": 356,
        "content": "## Create branch\nChecks if email already exists before creating.\nBlocks duplicates automatically."
      }
    },
    {
      "id": "d0e4cfa9-cda4-4727-9803-5477d45b3228",
      "name": "Sticky Note — Update",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -128
      ],
      "parameters": {
        "width": 716,
        "height": 340,
        "content": "## Update branch\nFinds contact by email automatically.\nNo manual page ID needed."
      }
    },
    {
      "id": "1ef1da76-962a-4e4c-9504-91e958ee6bc3",
      "name": "Sticky Note — Get",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        240
      ],
      "parameters": {
        "width": 364,
        "height": 276,
        "content": "## Get branch\nRetrieves a contact by email.\nReturns all Notion page properties."
      }
    },
    {
      "id": "968bbc62-eb30-4bf7-a929-0d790c1e4bf8",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1680,
        48
      ]
    },
    {
      "id": "45fca751-a90e-4ad0-a3f7-8fbaec9ef310",
      "name": "Search — Email Exists?",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1120,
        -368
      ]
    },
    {
      "id": "ca6cdc4e-4c08-41a0-9e28-136153240ba9",
      "name": "Already Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        -896,
        -368
      ]
    },
    {
      "id": "89741cd5-db5a-407d-8440-6c62ff0fe39a",
      "name": "Block Duplicate",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -688,
        -448
      ]
    },
    {
      "id": "aea1e92e-6a46-471d-9071-14a65a51ecc8",
      "name": "Search — Find by Email",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1104,
        48
      ]
    },
    {
      "id": "86cbd614-e602-4c16-ac56-4907ce0e2689",
      "name": "Person Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        48
      ]
    },
    {
      "id": "2836c871-e37a-49b1-94dd-9e7130d8a25f",
      "name": "Not Found Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -672,
        80
      ]
    },
    {
      "id": "bde08172-7822-433b-adfe-dbe7cb252d2d",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -288,
        48
      ]
    },
    {
      "id": "00f3a676-3203-4750-bf26-e6c9861477d3",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1456,
        32
      ]
    },
    {
      "id": "63a8fb78-0157-45cb-8e61-3daa98386f90",
      "name": "Notion — Create Person1",
      "type": "n8n-nodes-base.notion",
      "position": [
        -688,
        -304
      ]
    },
    {
      "id": "4ffa0180-596c-4c96-a670-f5eed8b06c01",
      "name": "Notion — Update Person1",
      "type": "n8n-nodes-base.notion",
      "position": [
        -672,
        -96
      ]
    },
    {
      "id": "de27e473-a6de-4fc8-ad34-d3dd59868ca2",
      "name": "Notion — Get Person1",
      "type": "n8n-nodes-base.notion",
      "position": [
        -880,
        352
      ]
    },
    {
      "id": "8153f3fb-6235-48b6-946f-82a27c76e466",
      "name": "Sticky Note — Switch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1488,
        -112
      ],
      "parameters": {
        "width": 160,
        "height": 338,
        "content": "## Router\nRoutes `create`, `update`, and `get`\nto their respective branches."
      }
    }
  ],
  "connections": {
    "Switch1": {
      "main": [
        [
          {
            "node": "Search — Email Exists?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Search — Find by Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notion — Get Person1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Person Found?": {
      "main": [
        [
          {
            "node": "Notion — Update Person1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Not Found Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already Exists?": {
      "main": [
        [
          {
            "node": "Block Duplicate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notion — Create Person1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion — Get Person1": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search — Email Exists?": {
      "main": [
        [
          {
            "node": "Already Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search — Find by Email": {
      "main": [
        [
          {
            "node": "Person Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion — Create Person1": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion — Update Person1": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}