{
  "name": "Gary Club — Daily Call Report → Slack",
  "nodes": [
    {
      "parameters": {
        "content": "## ⚡ After import — 3 steps\n\n**1. Bind your credentials**\nClick **Get Calls** → set **Credential for Header Auth** to your Gary Club Agency key.\nClick **Post to Slack** → set your Slack OAuth2 or Webhook credential.\n\n**2. Set your Slack channel**\nIn the **Post to Slack** node, change **Channel** to wherever you want the daily report (e.g. `#daily-reports`).\n\n**3. Adjust the schedule**\nClick the **Schedule Trigger** node and set the time you want the report (default: 9:00 AM). Make sure your n8n timezone is set correctly in Settings → General.\n\n📋 **Notes**\n- The **Build Report** node assembles the message text — edit it to add/remove fields.\n- `start_date` uses yesterday's ISO date so the report covers the prior day's calls.\n- `count` in the response is the total number of calls in the window.\n- Add a second HTTP node to `GET /api/public/v1/sms/messages` for a combined SMS + calls daily digest.\n\n📚 Docs: https://docs.gary.club/api/calls",
        "height": 400,
        "width": 400,
        "color": 5
      },
      "id": "77000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, 60]
    },
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "hours", "triggerAtHour": 9, "triggerAtMinute": 0 }]
        }
      },
      "id": "77000000-0001-4000-8000-000000000001",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [260, 300]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "https://agency.gary.club/api/public/v1/calls",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "start_date", "value": "={{ $now.minus({days:1}).toFormat('yyyy-MM-dd') }}" },
            { "name": "end_date", "value": "={{ $now.toFormat('yyyy-MM-dd') }}" },
            { "name": "limit", "value": "100" }
          ]
        },
        "options": {}
      },
      "id": "77000000-0002-4000-8000-000000000002",
      "name": "Get Calls",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "report_date", "value": "={{ $now.minus({days:1}).toFormat('LLL d, yyyy') }}", "type": "string" },
            { "id": "f2", "name": "total_calls", "value": "={{ $json.count || ($json.data || []).length }}", "type": "number" },
            { "id": "f3", "name": "slack_text", "value": "={{ '📊 *Daily Call Report — ' + $now.minus({days:1}).toFormat('LLL d, yyyy') + '*\\nTotal calls: *' + ($json.count || ($json.data || []).length) + '*\\nView full report → https://agency.gary.club/dashboard/calls' }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "77000000-0003-4000-8000-000000000003",
      "name": "Build Report",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [740, 300]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "message",
        "operation": "post",
        "channel": "#daily-reports",
        "text": "={{ $json.slack_text }}",
        "otherOptions": {}
      },
      "id": "77000000-0004-4000-8000-000000000004",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [980, 300]
    }
  ],
  "connections": {
    "Schedule Trigger": { "main": [[{ "node": "Get Calls", "type": "main", "index": 0 }]] },
    "Get Calls": { "main": [[{ "node": "Build Report", "type": "main", "index": 0 }]] },
    "Build Report": { "main": [[{ "node": "Post to Slack", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "gary-club-api" }]
}
