{
  "id": "JkVDHIO07GEWJaxC",
  "meta": {
    "instanceId": "5426f28e42ac8a11df60a526207f8378191e0a0c5cb6f341b59fc3e46d73eee8",
    "templateCredsSetupCompleted": true
  },
  "name": "Business Intelligence copy",
  "tags": [
    {
      "id": "Z7L0f1AkNk8PRVAq",
      "name": "n8n",
      "createdAt": "2025-12-11T04:51:48.351Z",
      "updatedAt": "2025-12-11T04:51:48.351Z"
    }
  ],
  "nodes": [
    {
      "id": "1f681d72-931f-424c-83bf-8a264f5e0aec",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -480,
        -16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9ef97585-07c6-498d-9ab1-bb855669ccbd",
      "name": "Yesterday's Revenue",
      "type": "n8n-nodes-base.microsoftSql",
      "position": [
        32,
        -304
      ],
      "parameters": {
        "query": "SELECT  * from yourtable",
        "operation": "executeQuery"
      },
      "credentials": {
        "microsoftSql": {
          "id": "credential-id",
          "name": "microsoftSql Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "eef0e175-a878-4874-9a60-55dfc71df450",
      "name": "Yesterday's Registered Users",
      "type": "n8n-nodes-base.microsoftSql",
      "position": [
        32,
        -128
      ],
      "parameters": {
        "query": "select * from yourtable",
        "operation": "executeQuery"
      },
      "credentials": {
        "microsoftSql": {
          "id": "credential-id",
          "name": "microsoftSql Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b45937d6-e82e-4078-8380-f5f5547552dd",
      "name": "Yesterday's Report",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        32,
        64
      ],
      "parameters": {
        "dateRange": "yesterday",
        "metricsGA4": {
          "metricValues": [
            {}
          ]
        },
        "propertyId": {
          "__rl": true,
          "mode": "list",
          "value": "420608804",
          "cachedResultUrl": "https://analytics.google.com/analytics/web/#/",
          "cachedResultName": "googleAnalytics"
        },
        "dimensionsGA4": {
          "dimensionValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "googleAnalyticsOAuth2": {
          "id": "credential-id",
          "name": "googleAnalyticsOAuth2 Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "84147e9a-175b-4948-9e91-d8cc4b473e55",
      "name": "Check data",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        -304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "01573f2a-695b-4125-a9d9-300622b84a28",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Yesterday\\'s Revenue').item.json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "350540ce-2d7c-4478-ac6d-93a518771547",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        -128
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0c9d6fa3-aa93-4b0c-ad3a-af01829b4db8",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Yesterday\\'s Registered Users').item.json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6f8dde0f-b98e-4657-a89a-d69aad52afe2",
      "name": "Yesterday's Marketing Expenses",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        32,
        224
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ubZBlg0HB0297pqWZyuxpABUpm5PSKPXaD68z53C_MI/edit#gid=0",
          "cachedResultName": "Yesterday's Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1ubZBlg0HB0297pqWZyuxpABUpm5PSKPXaD68z53C_MI",
          "__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "credential-id",
          "name": "googleApi Credential"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "6c399e61-16ab-4583-8f31-89cf49ad4acb",
      "name": "Condition for google report",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "face1c70-4441-442d-bbce-940d40a85ecc",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Yesterday\\'s Report').item.json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "66bf6725-8303-4a6c-a1c1-de95ed51f64c",
      "name": "Condition for marketing reports",
      "type": "n8n-nodes-base.if",
      "position": [
        320,
        224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "54212a7c-9369-4710-b734-9a76df9f7253",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Yesterday\\'s Marketing Expenses').item.json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "40ef826a-462b-47f3-a667-b34023dae60e",
      "name": "Get only Total Revenue Amount",
      "type": "n8n-nodes-base.summarize",
      "position": [
        720,
        -320
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "TotalAmount",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7a39f638-9d81-40ba-aa71-c2ea9e65b219",
      "name": "Get only Total Users",
      "type": "n8n-nodes-base.summarize",
      "position": [
        720,
        -144
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "email"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "3344d237-7836-4be7-866e-79dff6d25520",
      "name": "Get Only Total Users",
      "type": "n8n-nodes-base.set",
      "position": [
        720,
        48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "66925533-eb00-4e80-a44f-2f1161b432c7",
              "name": "Total Users",
              "type": "number",
              "value": "={{ $json.totalUsers }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "31716f31-beef-417c-8d72-53a70f2215cb",
      "name": "Get only Total Spend Amount",
      "type": "n8n-nodes-base.summarize",
      "position": [
        720,
        208
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Ad Spend",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "8e0f1f23-c0ec-4082-b725-8509df484d03",
      "name": "Send Error Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        720,
        416
      ],
      "webhookId": "f0aa451f-fe70-4920-b953-d9930a52b377",
      "parameters": {
        "text": "Dear User,\n\nDaily business intelligence workflow failed due to missing input data.\nOne or more required sources did not return valid results.\nAction: Review individual data source logs and resolve before next run.\n\n",
        "options": {},
        "subject": "No Data Returned",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "credential-id",
          "name": "smtp Credential"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ab09aee2-1cc0-4d82-afc5-54bff1c4a194",
      "name": "Merge all result",
      "type": "n8n-nodes-base.merge",
      "position": [
        1168,
        -48
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "06b72e4c-e51a-4a1e-b5a5-b8118bbd8b1e",
      "name": "Normalize the data",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        -16
      ],
      "parameters": {
        "jsCode": "const result = {\n  revenue: 0,\n  registeredUsers: 0,\n  totalUsers: 0,\n  adSpend: 0\n};\n\nfor (const item of items) {\n  if (item.json.sum_TotalAmount !== undefined) {\n    result.revenue = item.json.sum_TotalAmount;\n  }\n\n  if (item.json.count_email !== undefined) {\n    result.registeredUsers = item.json.count_email;\n  }\n\n  if (item.json[\"Total Users\"] !== undefined) {\n    result.totalUsers = item.json[\"Total Users\"];\n  }\n\n  if (item.json.sum_Ad_Spend !== undefined) {\n    result.adSpend = item.json.sum_Ad_Spend;\n  }\n}\n\nreturn [{ json: result }];"
      },
      "typeVersion": 2
    },
    {
      "id": "39359262-3fcf-476a-a08a-aa37e1fb06e2",
      "name": "KPI Calculator",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        -16
      ],
      "parameters": {
        "jsCode": "const revenue = Number($json.revenue) || 0;\nconst adSpend = Number($json.adSpend) || 0;\nconst users = Number($json.registeredUsers) || 0;\n\n// Optional: yesterday values (if available later)\nconst yesterdayRevenue = Number($json.yesterdayRevenue) || 0;\nconst yesterdayUsers = Number($json.yesterdayUsers) || 0;\n\n// KPI calculations\nconst ROAS = adSpend > 0 ? revenue / adSpend : 0;\nconst CAC = users > 0 ? adSpend / users : 0;\n\n// Growth calculations\nconst revenueGrowthPct =\n  yesterdayRevenue > 0\n    ? ((revenue - yesterdayRevenue) / yesterdayRevenue) * 100\n    : 0;\n\nconst userGrowthPct =\n  yesterdayUsers > 0\n    ? ((users - yesterdayUsers) / yesterdayUsers) * 100\n    : 0;\n\nreturn [\n  {\n    json: {\n      ...$json,\n      ROAS: Number(ROAS.toFixed(2)),\n      CAC: Number(CAC.toFixed(2)),\n      //revenueGrowthPct: Number(revenueGrowthPct.toFixed(2)),\n      //userGrowthPct: Number(userGrowthPct.toFixed(2))\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9ce564f1-a79c-40aa-994e-ffabe10e4a5d",
      "name": "Business Decision Logic",
      "type": "n8n-nodes-base.code",
      "position": [
        1808,
        -16
      ],
      "parameters": {
        "jsCode": "const kpi = $json;\n\nlet status = \"normal\";\nlet priority = \"low\";\nlet insights = [];\n\nif(kpi.ROAS < 1){\n  status = \"risk\";\n  priority = \"high\";\n  insights.push(\"Marketing spend is not generating returns\");\n}\n\nif(kpi.ROAS >= 3){\n  insights.push(\"Marketing campaigns are perfoming very well\");\n}\n\nif(kpi.CAC > 100){\n  status = \"risk\";\n  priority = \"medium\";\n  insights.push(\"Customer acquision cost is high\");\n}\n\nreturn [{\n  json: {\n    ...kpi,\n    agentStatus: status,\n    agentPriority: priority,\n    insights\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "633a0d99-5ef0-43ed-bd97-c7cede4a8f8c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2016,
        -16
      ],
      "parameters": {
        "text": "=Business KPIs:\n{{ JSON.stringify($json) }}\n\nWrite:\n1. One-line business summary\n2. One risk (if any)\n3. One opportunity\n4. One recommended action",
        "options": {
          "systemMessage": "You are an AI business agent working for a company founder.\n\nYour job:\n- Analyze business KPIs\n- Explain what is happening\n- Decide if a notification is required\n- Keep the message short, clear, and actionable\n- Do not use technical terms\n- Do not exaggerate"
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "40b9c5d8-01ea-4891-8fed-88620694f55b",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1952,
        224
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ea7dd279-82a6-42cc-95b4-2ab14c226150",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        2176,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "deea0a73-811f-4d54-b1ac-28b39c0bf07b",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2400,
        304
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "79ce9a59-f4cb-46fa-83dd-815a336949ad",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2640,
        192
      ],
      "webhookId": "c20c587e-6393-4945-8764-9727c23f15f9",
      "parameters": {
        "textBody": "={{ $json.output }}\n\nRevenue :- {{ $json.revenue }}\nNew Users :- {{ $json.registeredUsers }}\nTotal Users :- {{ $json.totalUsers }}\nTotal Ad Spend :- {{ $json.adSpend }}",
        "operation": "send",
        "additionalFields": {}
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "9d56b3a8-5028-440c-98c8-56f7b42fbde8",
      "name": "Send Final Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2656,
        416
      ],
      "webhookId": "79b8d15d-dafb-4769-8208-e60417a4df85",
      "parameters": {
        "text": "=Dear User,\n\n{{ $json.output }}\n\nRevenue :- {{ $json.revenue }}\nNew Users :- {{ $json.registeredUsers }}\nTotal Users :- {{ $json.totalUsers }}\nTotal Ad Spend :- {{ $json.adSpend }}",
        "options": {},
        "subject": "Yesterday's Revenue Report",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "credential-id",
          "name": "smtp Credential"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5cc67887-cd3a-4ea3-a3f3-3bf5fbaf5a9f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -288
      ],
      "parameters": {
        "width": 512,
        "height": 608,
        "content": "## OVERVIEW\n\n\nThis workflow is an AI-powered business intelligence agent designed for founders and business owners.\nIt automatically collects key business metrics, calculates performance KPIs, applies decision logic, uses AI reasoning, and sends clear, actionable notifications — without dashboards or manual reports.\n\n\n## Architecture\n\nScheduler\n → Data Collection (MSSQL, Analytics, Sheets)\n → Merge Results\n → Data Consolidation\n → KPI Calculation\n → Business Decision Logic\n → AI Reasoning Agent\n → Notification Formatter\n → Smart Alerts (WhatsApp / Email / Slack)\n\n\n## Setup & Requirements:\n\nAPI access to data sources (MSSQL, Google Analytics, Google Sheets)\nOpenAI or Google Gemini API for AI reasoning\nMessaging integration: Gmail, Twilio (WhatsApp), Slack, Telegram"
      },
      "typeVersion": 1
    },
    {
      "id": "e5d3d88b-c282-4f10-aa31-5ca40718aae1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 288,
        "content": "## Notification Formatter\n\nPrepare a professional message with AI summary and key statistics for distributions. \n\nFinally, you can deliver the output with multiple communication channels:\n\nGmail / SMTP Node → For Email\nTwilio / WhatsApp Cloud API Node → For WhatsApp\nSlack / Telegram Node → Optional team notifications"
      },
      "typeVersion": 1
    },
    {
      "id": "fdfbce03-215f-4aeb-8a74-20717c077a69",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -672
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 304,
        "content": "## DATA EXTRACTION\n\n1. Fetches yesterday’s total revenue from the database.\n2. Fetches number of newly registered users for yesterday.\n3. Fetches total users for yesterday to measure traffic and engagement.\n4. Fetches yesterday’s marketing expenses (manual or automated source).\n5. Combines all incoming data sources into a single execution context."
      },
      "typeVersion": 1
    },
    {
      "id": "e8ce75d3-537f-48fd-a513-a5b77fc70b24",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -672
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 304,
        "content": "## DATA CHECKER\n\n1. After getting all data need to check if data available using IF nodes\n2. If data is not available send email to dedication person for verify the data\n3. Make sure you are getting all data sources from all nodes. don't allow to execute next step without getting any one fail."
      },
      "typeVersion": 1
    },
    {
      "id": "77d8f08a-813e-454b-b500-39dfc663aecc",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -672
      ],
      "parameters": {
        "color": 7,
        "width": 368,
        "height": 304,
        "content": "## DATA NORMALIZE\n\n1. Converts raw data into a consistent format and correct data types for calculation.\n2. Ensures reliable calculation and avoids error due to inconsistent data types.\n3. These node will return total amount of revenue, Total users registered, total users visited and total amount spend for marketing."
      },
      "typeVersion": 1
    },
    {
      "id": "953d6615-eefd-4dcf-80ef-0b5a438f6179",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 288,
        "content": "## COMBINE REPORTS\n1. Merge all datasets into one unified dataset for calculation\n2. Allows side-by-side comparison of today's and yesterday's metrics\n3. The Data Consolidation Function Node transforms the merged multiple items into one structured JSON object.\n4. Key performance indicators that provide actionable insights for founders\n5. Business logic node will applies rule basic logic to detect the potential risks or opportunities for marketing.\n\nThis will show you the indications that if marketing is inefficiency and if high acquisition cost and if strong campaign performance."
      },
      "typeVersion": 1
    },
    {
      "id": "68d041fc-b79e-4c83-ae7d-8502cd48c834",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -496
      ],
      "parameters": {
        "color": 7,
        "width": 352,
        "height": 384,
        "content": "## AI SUMMARY GENERATION\n1. Using OpenAI to generate a human friendly summary of traffic changes and produce insights automatically without manual works.\n\nThis will generate concise business summary, identifies risks and opportunities\n\nyou can change the system prompt based on your requirements and you can change the LLM which you like."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "287b38f6-1ba2-4dd0-b730-133dc2af4b2b",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Get only Total Users",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Final Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Check data": {
      "main": [
        [
          {
            "node": "Get only Total Revenue Amount",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "KPI Calculator": {
      "main": [
        [
          {
            "node": "Business Decision Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge all result": {
      "main": [
        [
          {
            "node": "Normalize the data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Yesterday's Revenue",
            "type": "main",
            "index": 0
          },
          {
            "node": "Yesterday's Registered Users",
            "type": "main",
            "index": 0
          },
          {
            "node": "Yesterday's Report",
            "type": "main",
            "index": 0
          },
          {
            "node": "Yesterday's Marketing Expenses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Normalize the data": {
      "main": [
        [
          {
            "node": "KPI Calculator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Yesterday's Report": {
      "main": [
        [
          {
            "node": "Condition for google report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Yesterday's Revenue": {
      "main": [
        [
          {
            "node": "Check data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Only Total Users": {
      "main": [
        [
          {
            "node": "Merge all result",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Get only Total Users": {
      "main": [
        [
          {
            "node": "Merge all result",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Business Decision Logic": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Condition for google report": {
      "main": [
        [
          {
            "node": "Get Only Total Users",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get only Total Spend Amount": {
      "main": [
        [
          {
            "node": "Merge all result",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Yesterday's Registered Users": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get only Total Revenue Amount": {
      "main": [
        [
          {
            "node": "Merge all result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Yesterday's Marketing Expenses": {
      "main": [
        [
          {
            "node": "Condition for marketing reports",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Condition for marketing reports": {
      "main": [
        [
          {
            "node": "Get only Total Spend Amount",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Error Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}