{
  "name": "10 \u2014 Tygodniowy raport KPI: CRM + Ads + faktury \u2192 Slack (klinweb.pl)",
  "nodes": [
    {
      "parameters": {
        "content": "## Tygodniowy raport KPI \u2014 poniedzia\u0142ek 8:00\nSzablon KlinWeb. Zbiera dane z 3 \u017ar\u00f3de\u0142 r\u00f3wnolegle (CRM, Google Ads, arkusz faktur), scala je i wysy\u0142a podsumowanie na Slack. Pod\u0142\u0105cz w\u0142asne API/arkusz. W\u0119ze\u0142 \u201eMerge\" czeka na wszystkie 3 ga\u0142\u0119zie zanim zbuduje raport.",
        "height": 160,
        "width": 820,
        "color": 4
      },
      "id": "note-a3",
      "name": "Sticky Note a3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -200
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "n3-cron",
      "name": "Poniedzia\u0142ek 8:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://api.twoj-crm.pl/v1/reports/leads?range=7d",
        "options": {}
      },
      "id": "n3-crm",
      "name": "CRM: nowe leady (7 dni)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        -160
      ]
    },
    {
      "parameters": {
        "url": "https://googleads.googleapis.com/v17/customers/CID/googleAds:searchStream",
        "options": {}
      },
      "id": "n3-ads",
      "name": "Google Ads: koszt/konwersje",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "mode": "list",
          "value": "Faktury"
        },
        "options": {}
      },
      "id": "n3-sheet",
      "name": "Arkusz faktur (przych\u00f3d)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        240,
        160
      ]
    },
    {
      "parameters": {
        "numberInputs": 3
      },
      "id": "n3-merge",
      "name": "Scal \u017ar\u00f3d\u0142a",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3,
      "position": [
        480,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "r1",
              "name": "tekst",
              "type": "string",
              "value": "=\ud83d\udcca *Raport tygodniowy*\\n\u2022 Nowe leady: {{ $(\"CRM: nowe leady (7 dni)\").all().length }}\\n\u2022 Koszt Ads: {{ $(\"Google Ads: koszt/konwersje\").first().json.cost || \"\u2014\" }} z\u0142\\n\u2022 Przych\u00f3d (faktury): {{ $(\"Arkusz faktur (przych\u00f3d)\").all().reduce((s,r)=>s+(r.json.kwota||0),0) }} z\u0142"
            }
          ]
        },
        "options": {}
      },
      "id": "n3-agg",
      "name": "Zbuduj raport",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        700,
        0
      ]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "mode": "name",
          "value": "zarzad"
        },
        "text": "={{ $json.tekst }}",
        "otherOptions": {}
      },
      "id": "n3-slack",
      "name": "Wy\u015blij na Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        920,
        0
      ]
    }
  ],
  "connections": {
    "Poniedzia\u0142ek 8:00": {
      "main": [
        [
          {
            "node": "CRM: nowe leady (7 dni)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Google Ads: koszt/konwersje",
            "type": "main",
            "index": 0
          },
          {
            "node": "Arkusz faktur (przych\u00f3d)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM: nowe leady (7 dni)": {
      "main": [
        [
          {
            "node": "Scal \u017ar\u00f3d\u0142a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Ads: koszt/konwersje": {
      "main": [
        [
          {
            "node": "Scal \u017ar\u00f3d\u0142a",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Arkusz faktur (przych\u00f3d)": {
      "main": [
        [
          {
            "node": "Scal \u017ar\u00f3d\u0142a",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Scal \u017ar\u00f3d\u0142a": {
      "main": [
        [
          {
            "node": "Zbuduj raport",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zbuduj raport": {
      "main": [
        [
          {
            "node": "Wy\u015blij na Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": [
    {
      "name": "klinweb.pl"
    },
    {
      "name": "szablon-PL"
    }
  ]
}