{
  "name": "Sales intelligence - weekly digest",
  "nodes": [
    {
      "id": "b4319fc9-920d-5bb7-a1a3-13e09730bb2b",
      "name": "Manual run",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "1626ca37-7df4-53e7-8567-6526e54b67e0",
      "name": "Scheduled run",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.4,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * 1"
            }
          ]
        }
      }
    },
    {
      "id": "097c4f35-3443-550f-b220-19bd162e1cb7",
      "name": "Load config and claim period",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        300,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/start",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "{}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "b65a2b90-3bb5-554a-82c2-7e7a72e01c9a",
      "name": "HubSpot records and history",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        570,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/collect",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "41b364ef-3b31-5b7c-8358-5d1410199d73",
      "name": "Validate deduplicate and FX",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        840,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/normalize",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "cc02acb1-e70c-5f1f-a5a3-d49ce6518824",
      "name": "Metrics snapshots and audience scopes",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1110,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/analyze",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "61d04e8e-36f4-518b-99cb-c7f9d4848547",
      "name": "AI validation fallback and charts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1380,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/prepare",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "53d1b5c1-b168-5484-ad3a-1d2aa8d58701",
      "name": "Slack digest thread and charts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1650,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/slack",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "2b6a9922-4f47-59e8-aa17-7b3b2294bf50",
      "name": "Threaded accessible email",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        1920,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/email",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    },
    {
      "id": "e3b0b8f9-81e7-50e9-8588-4b14750bb47a",
      "name": "Finalize audit and alert",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        2190,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "http://digest-service:8080/v1/finalize",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpTemplatedCustomAuth",
        "sendBody": true,
        "contentType": "json",
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ run_id: $json.run_id }) }}",
        "options": {
          "timeout": 300000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "credentials": {
        "httpTemplatedCustomAuth": {
          "name": "Digest service - configure Bearer token"
        }
      },
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000
    }
  ],
  "connections": {
    "Manual run": {
      "main": [
        [
          {
            "node": "Load config and claim period",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scheduled run": {
      "main": [
        [
          {
            "node": "Load config and claim period",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load config and claim period": {
      "main": [
        [
          {
            "node": "HubSpot records and history",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot records and history": {
      "main": [
        [
          {
            "node": "Validate deduplicate and FX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate deduplicate and FX": {
      "main": [
        [
          {
            "node": "Metrics snapshots and audience scopes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Metrics snapshots and audience scopes": {
      "main": [
        [
          {
            "node": "AI validation fallback and charts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI validation fallback and charts": {
      "main": [
        [
          {
            "node": "Slack digest thread and charts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack digest thread and charts": {
      "main": [
        [
          {
            "node": "Threaded accessible email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Threaded accessible email": {
      "main": [
        [
          {
            "node": "Finalize audit and alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "timezone": "Asia/Tbilisi",
    "saveDataSuccessExecution": "none",
    "saveDataErrorExecution": "none",
    "saveManualExecutions": false,
    "executionTimeout": 1800
  },
  "active": false,
  "pinData": {},
  "tags": []
}
