{
  "name": "77STF \u2014 Quote Follow-up (09:00 pon-pt)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1-5"
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Pon-Pt 09:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://77stf-system-crypto77stf-4430s-projects.vercel.app/api/guardian/run",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-webhook-secret",
              "value": "a2e09b11523539ca26e4bb60468b4015e114848edf3dbb9e382201d6e5e4e664"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\"trigger\":\"cron\"}",
        "options": {
          "timeout": 30000
        }
      },
      "id": "guardian-run",
      "name": "Guardian Run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "fieldToSplitOut": "alerts",
        "options": {}
      },
      "id": "split-alerts",
      "name": "Split Alerts",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.type }}",
              "rightValue": "quote_no_response",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "c2",
              "leftValue": "={{ $json.quote_id }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "filter-quotes",
      "name": "Tylko wyceny",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        960,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://77stf-system-crypto77stf-4430s-projects.vercel.app/api/quotes/followup",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-webhook-secret",
              "value": "a2e09b11523539ca26e4bb60468b4015e114848edf3dbb9e382201d6e5e4e664"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ quote_id: $json.quote_id }) }}",
        "options": {
          "timeout": 15000
        }
      },
      "id": "send-followup",
      "name": "Wyslij Follow-up",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1200,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "SLACK_WEBHOOK_PLACEHOLDER",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ text: $json.ok ? ('\ud83d\udce7 Follow-up wys\u0142any: ' + $json.quote_title + ' \u2192 ' + $json.email_sent_to + ' (' + $json.days_pending + 'd)') : ('\u26a0\ufe0f Follow-up nieudany: ' + ($json.reason || 'b\u0142\u0105d')) }) }}",
        "options": {}
      },
      "id": "slack-result",
      "name": "Slack crm-log",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1440,
        200
      ]
    }
  ],
  "connections": {
    "Pon-Pt 09:00": {
      "main": [
        [
          {
            "node": "Guardian Run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guardian Run": {
      "main": [
        [
          {
            "node": "Split Alerts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Alerts": {
      "main": [
        [
          {
            "node": "Tylko wyceny",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tylko wyceny": {
      "main": [
        [
          {
            "node": "Wyslij Follow-up",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Wyslij Follow-up": {
      "main": [
        [
          {
            "node": "Slack crm-log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true
  },
  "staticData": null
}