{
  "name": "daily-balance-sync-trigger",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 6 * * *"
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Daily Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{$env.APP_API_BASE_URL}}/api/integrations/plaid/sync",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{'Bearer ' + $env.AUTOMATION_WEBHOOK_TOKEN}}"
            }
          ]
        },
        "options": {}
      },
      "id": "sync",
      "name": "Trigger Plaid Sync",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{$env.APP_API_BASE_URL}}/api/automation/events",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "={{'Bearer ' + $env.AUTOMATION_WEBHOOK_TOKEN}}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"workflow\":\"daily-balance-sync-trigger\",\"source\":\"n8n\",\"status\":\"success\",\"payload\":{\"run_id\":\"{{$execution.id}}\"},\"result\":$json}",
        "options": {}
      },
      "id": "record",
      "name": "Record Run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        780,
        300
      ]
    }
  ],
  "connections": {
    "Daily Schedule": {
      "main": [
        [
          {
            "node": "Trigger Plaid Sync",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Plaid Sync": {
      "main": [
        [
          {
            "node": "Record Run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}