{
  "name": "Monitor agency profitability with Facebook Ads, Shopify, Stripe, Clockify, Google Sheets, Slack and Gemini",
  "nodes": [
    {
      "id": "5d1c5562-7ac5-4fbe-9a66-992a3d5dd9ff",
      "name": "Get a time entry",
      "type": "n8n-nodes-base.clockify",
      "position": [
        -1696,
        352
      ]
    },
    {
      "id": "a5bce0db-f455-44fd-a62e-2a15707434ba",
      "name": "Get a balance",
      "type": "n8n-nodes-base.stripe",
      "position": [
        -1696,
        544
      ]
    },
    {
      "id": "f94b67f4-0cd3-4e8f-93e2-b26b4634101a",
      "name": "Get many orders",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -1696,
        160
      ]
    },
    {
      "id": "a0ec860f-29b9-49ab-8539-c1c0dc114aeb",
      "name": "Facebook Graph API",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -1696,
        -224
      ]
    },
    {
      "id": "7e63e486-99fd-4e4b-a146-f5e2e5014c40",
      "name": "Get a campaign",
      "type": "n8n-nodes-base.googleAds",
      "position": [
        -1696,
        -32
      ]
    },
    {
      "id": "7598c5dc-a583-421a-9b41-7f7e5914f90a",
      "name": "Append row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -800,
        160
      ]
    },
    {
      "id": "8cf5f9e5-0eb9-4b88-8b77-8d8521f71e88",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1920,
        160
      ]
    },
    {
      "id": "1d4dec25-431c-4aa0-b47d-dffbf7222cc0",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1248,
        112
      ]
    },
    {
      "id": "180d1013-e364-4fd9-92a6-d384d3522d6b",
      "name": "Facebook ads1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        -224
      ]
    },
    {
      "id": "3e1e5a60-9438-49b6-a126-932ff3929ff6",
      "name": "Google ads1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        -32
      ]
    },
    {
      "id": "dd114afb-6f16-4829-a54e-5ded05a7717c",
      "name": "Shopify1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        160
      ]
    },
    {
      "id": "b550b321-f37a-4b2e-8cfc-e3d0d5428cde",
      "name": "Stripe1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        352
      ]
    },
    {
      "id": "ae4c8ef4-c72a-4dc1-a558-6d6d7658451b",
      "name": "Clockify1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1472,
        544
      ]
    },
    {
      "id": "0526e83e-25e6-4ab3-9b10-880ce38103f2",
      "name": "Send a message",
      "type": "n8n-nodes-base.slack",
      "position": [
        -224,
        160
      ]
    },
    {
      "id": "15161336-b9b9-4391-a454-a6cb0bc64f4e",
      "name": "AI Profit Analyzer1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -576,
        160
      ]
    },
    {
      "id": "df0f315f-73ea-4627-9110-dc5bc93da6ab",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -1024,
        160
      ]
    },
    {
      "id": "129bfe9a-e1d5-4368-bbca-b4a05e852f82",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -512,
        384
      ]
    },
    {
      "id": "f6d394ee-0ff1-47e7-956a-ff4c7c8e9cbc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1728,
        -496
      ],
      "parameters": {
        "width": 368,
        "height": 224,
        "content": "## Data ingestion\n\nFetch ad spend from Facebook and Google, revenue from Shopify and Stripe, and time tracking data from Clockify.\n\nDisable mock Set nodes and connect real API nodes directly to the Me"
      }
    },
    {
      "id": "017299a1-1224-4e6e-b92c-607fb2b50d06",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -96
      ],
      "parameters": {
        "width": 256,
        "height": 224,
        "content": "## Processing logic\n\nMerge all sources and calculate revenue, costs, ROAS, CAC, profit margin, and time ratio per client.\n\nUpdate the CONFIG object in the code node to match your real overhead rate, s"
      }
    },
    {
      "id": "7cd6b962-db8a-46a6-82f0-29260048e247",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -96
      ],
      "parameters": {
        "width": 320,
        "height": 224,
        "content": "## AI analysis\n\nSend structured financial data to the AI agent to generate a concise executive summary.\n\nAdjust the system message if your definition of healthy performance changes.\n"
      }
    },
    {
      "id": "925733b9-c85d-4179-9551-5acb1e386987",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        544
      ],
      "parameters": {
        "width": 368,
        "height": 176,
        "content": "## Storage and notifications\n\nAppend weekly metrics to Google Sheets for historical tracking.\n\nPost a formatted profitability summary to Slack. Ensure the Slack bot is invited to the selected channel."
      }
    },
    {
      "id": "7c3325d6-9219-41a3-a5a0-828373e78e52",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        80
      ],
      "parameters": {
        "width": 416,
        "height": 208,
        "content": "## Go live checklist\n\n- Remove all mock Set nodes  \n- Confirm client naming consistency across platforms  \n- Validate Google Sheets column mapping  \n- Review configuration values  \n- Run a manual test"
      }
    },
    {
      "id": "b7bb0126-5898-4e03-84b1-8e2f8509d5c5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2512,
        -624
      ],
      "parameters": {
        "width": 528,
        "height": 720,
        "content": "# Agency profitability monitor\n\nCalculate client profitability by combining ad spend, revenue, and time tracking data, then store results and send an executive summary to Slack.\n\nThis workflow runs we"
      }
    }
  ],
  "connections": {
    "Merge1": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stripe1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Shopify1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Clockify1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "Google ads1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Facebook ads1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a balance": {
      "main": [
        [
          {
            "node": "Clockify1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a campaign": {
      "main": [
        [
          {
            "node": "Google ads1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many orders": {
      "main": [
        [
          {
            "node": "Shopify1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a time entry": {
      "main": [
        [
          {
            "node": "Stripe1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Facebook Graph API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get a campaign",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get many orders",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get a time entry",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get a balance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Facebook Graph API": {
      "main": [
        [
          {
            "node": "Facebook ads1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Profit Analyzer1": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet1": {
      "main": [
        [
          {
            "node": "AI Profit Analyzer1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Profit Analyzer1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}