{
  "name": "Vorlux AI | Revenue Pulse Weekly",
  "nodes": [
    {
      "id": "67b232d5-4407-4d29-a133-955bfb36b675",
      "name": "Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        220,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1440
            }
          ]
        }
      }
    },
    {
      "id": "8ac28a78-acaf-4bc6-bf65-10a543a85ee3",
      "name": "Stripe Revenue",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "={{$env.VORLUX_HUB_URL}}/api/admin/billing/revenue?period=7d",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "4b5c3e32-dcb6-425f-aca5-21f578f44a1f",
      "name": "Donations",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        440
      ],
      "parameters": {
        "method": "GET",
        "url": "={{$env.VORLUX_HUB_URL}}/api/admin/donations?period=7d",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "476f8c48-a4e4-44ad-8557-cf1345f6c66e",
      "name": "Subscriptions",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        160
      ],
      "parameters": {
        "method": "GET",
        "url": "={{$env.VORLUX_HUB_URL}}/api/admin/billing/subscriptions?status=active",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "20851094-e23b-4426-963e-9441f86270f3",
      "name": "Process",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        740,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const rev=$node['Stripe Revenue'].json.data||{total:0};\nconst don=$node['Donations'].json.data||{total:0};\nconst sub=$node['Subscriptions'].json.data||{active:0,mrr:0};\nconst total=(rev.total||0)+(don.total||0);\nreturn [{json:{embeds:[{title:'\ud83d\udcb0 Revenue Pulse',color:5793266,fields:[{name:'Payments',value:'$'+(rev.total||0).toFixed(2),inline:true},{name:'Donations',value:'$'+(don.total||0).toFixed(2),inline:true},{name:'MRR',value:'$'+(sub.mrr||0).toFixed(2),inline:true},{name:'Total',value:'**$'+total.toFixed(2)+'**',inline:false}]}]}}];"
      }
    },
    {
      "id": "ad3771c9-f905-4240-adfb-841a070f341f",
      "name": "Post Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        980,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_OPS_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.embeds ? $json : {embeds:[{title:$json.mood||$json.status||\"Update\",description:JSON.stringify($json).substring(0,500),color:5793266}]}) }}",
        "options": {
          "timeout": 10000
        }
      }
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Stripe Revenue",
            "type": "main",
            "index": 0
          },
          {
            "node": "Donations",
            "type": "main",
            "index": 0
          },
          {
            "node": "Subscriptions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stripe Revenue": {
      "main": [
        [
          {
            "node": "Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Donations": {
      "main": [
        [
          {
            "node": "Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Subscriptions": {
      "main": [
        [
          {
            "node": "Process",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process": {
      "main": [
        [
          {
            "node": "Post Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}