{
  "name": "CRM Lead Creation Workflow",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "minutesInterval": 1
            }
          ]
        }
      },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:8000/api/leads",
        "authentication": "headerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer={{$node[\"Set API Key\"].json[\"apiKey\"]}}"
            }
          ]
        },
        "options": {},
        "method": "POST",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "first_name",
              "value": "John"
            },
            {
              "name": "last_name",
              "value": "Smith"
            },
            {
              "name": "email",
              "value": "john.smith@example.com"
            },
            {
              "name": "phone",
              "value": "+1234567890"
            },
            {
              "name": "company",
              "value": "Example Corp"
            },
            {
              "name": "position",
              "value": "CEO"
            },
            {
              "name": "status",
              "value": "new"
            },
            {
              "name": "source",
              "value": "n8n-automation"
            },
            {
              "name": "tags",
              "value": "[\"automated\", \"n8n\"]"
            }
          ]
        }
      },
      "name": "Create Lead",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "apiKey",
              "value": "YOUR_API_KEY_HERE"
            }
          ]
        }
      },
      "name": "Set API Key",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"id\"]}}",
              "operation": "exists"
            }
          ]
        }
      },
      "name": "IF Lead Created",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "url": "http://localhost:8000/api/activities",
        "authentication": "headerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer={{$node[\"Set API Key\"].json[\"apiKey\"]}}"
            }
          ]
        },
        "options": {},
        "method": "POST",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "lead_id",
              "value": "={{$node[\"Create Lead\"].json[\"id\"]}}"
            },
            {
              "name": "title",
              "value": "Initial outreach"
            },
            {
              "name": "activity_type",
              "value": "email"
            },
            {
              "name": "description",
              "value": "Automated initial outreach email"
            },
            {
              "name": "scheduled_at",
              "value": "={{$now.toISOString()}}"
            }
          ]
        }
      },
      "name": "Create Activity",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1050,
        200
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Lead": {
      "main": [
        [
          {
            "node": "IF Lead Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Key": {
      "main": [
        [
          {
            "node": "Create Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Lead Created": {
      "main": [
        [
          {
            "node": "Create Activity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1",
  "id": "1",
  "tags": []
}