{
  "name": "YA-RE-29: Lead Follow-Up Sequence",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        300
      ],
      "id": "node-sched-29",
      "name": "Schedule: Periodic Trigger"
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://YOUR_DATA_SERVICE_URL/api/v1/records",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_API_TOKEN"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "id": "node-fetch-29",
      "name": "HTTP: Ingest Source Data"
    },
    {
      "parameters": {
        "jsCode": "// Processing Logic for Lead Follow-Up Sequence\nconst records = $input.first().json.items || [];\nconst filtered = records.filter(r => r.requires_action === true || r.status === 'pending');\nreturn [{ json: { workflow: 'Lead Follow-Up Sequence', total_processed: records.length, action_items: filtered, timestamp: new Date().toISOString() } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ],
      "id": "node-code-29",
      "name": "Code: Rule Execution"
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ $json.action_items.length }}",
              "operation": "larger",
              "value2": 0
            }
          ]
        }
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        900,
        300
      ],
      "id": "node-if-29",
      "name": "IF: Action Items Found"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://YOUR_NOTIFICATION_WEBHOOK_URL",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"workflow\": \"{{ $json.workflow }}\",\n  \"alert\": \"Found {{ $json.action_items.length }} pending actions\",\n  \"timestamp\": \"{{ $json.timestamp }}\"\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        200
      ],
      "id": "node-notify-29",
      "name": "HTTP: Send Notification"
    }
  ],
  "connections": {
    "Schedule: Periodic Trigger": {
      "main": [
        [
          {
            "node": "HTTP: Ingest Source Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Ingest Source Data": {
      "main": [
        [
          {
            "node": "Code: Rule Execution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code: Rule Execution": {
      "main": [
        [
          {
            "node": "IF: Action Items Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Action Items Found": {
      "main": [
        [
          {
            "node": "HTTP: Send Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1.0.0",
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "yehia-ahmed-re-playbook"
  },
  "tags": [
    {
      "name": "Nurturing"
    },
    {
      "name": "CRM"
    }
  ]
}