{
  "name": "Bella Plugin \u2014 SmartLead Add Lead (Placeholder)",
  "nodes": [
    {
      "id": "3baf7522-5b4b-41e7-b0f1-44e6242c9bf1",
      "name": "Execute Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "edd94a26-f0a7-4712-9595-be1c5065f81b",
      "name": "Code: Prepare SmartLead Payload",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        0
      ],
      "parameters": {
        "jsCode": "const input = $input.first().json;\nreturn [{ json: {\n  email: input.email,\n  first_name: input.first_name || '',\n  last_name: input.last_name || '',\n  company_name: input.company_name || '',\n  website: input.website || '',\n  custom_fields: input.custom_fields || {},\n  prepared_at: new Date().toISOString(),\n} }];"
      }
    },
    {
      "id": "16498103-7843-4f6b-bd74-c385c4d1908a",
      "name": "Note: SmartLead API Key",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        560,
        -120
      ],
      "parameters": {
        "content": "\u26a0\ufe0f Add your SmartLead API key here and enable this node. URL: https://server.smartlead.ai/api/v1/leads",
        "height": 80,
        "width": 360,
        "color": 4
      }
    },
    {
      "id": "365982a2-6abc-4aa6-80da-281a5cf51233",
      "name": "HTTP Request: SmartLead Add Lead",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        560,
        0
      ],
      "disabled": true,
      "parameters": {
        "method": "POST",
        "url": "https://server.smartlead.ai/api/v1/leads",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer SMARTLEAD_API_KEY_PLACEHOLDER"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "body": {
          "email": "={{ $json.email }}",
          "first_name": "={{ $json.first_name }}",
          "last_name": "={{ $json.last_name }}",
          "company_name": "={{ $json.company_name }}",
          "website": "={{ $json.website }}",
          "custom_fields": "={{ $json.custom_fields }}"
        }
      }
    },
    {
      "id": "5f80a970-a9d1-426a-9184-051919d53231",
      "name": "Set: Output",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        840,
        0
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "319529eb-c847-42b1-ba90-c969bf871c19",
              "name": "queued",
              "value": true,
              "type": "boolean"
            },
            {
              "id": "b3db1300-4771-45b4-b1ad-4060b81c340f",
              "name": "message",
              "value": "Lead queued for SmartLead (configure API key to activate)",
              "type": "string"
            },
            {
              "id": "958fdaba-787e-4ae5-bc37-6c924c3ff32f",
              "name": "email",
              "value": "={{ $('Code: Prepare SmartLead Payload').first().json.email }}",
              "type": "string"
            }
          ]
        }
      }
    }
  ],
  "connections": {
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Code: Prepare SmartLead Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Prepare SmartLead Payload": {
      "main": [
        [
          {
            "node": "HTTP Request: SmartLead Add Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request: SmartLead Add Lead": {
      "main": [
        [
          {
            "node": "Set: Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}