{
  "id": "99QisNGBpRO6PDM1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "GoMarble MCP - Weekly Report",
  "tags": [],
  "nodes": [
    {
      "id": "5b23d5ab-2930-4cd2-8949-9d36c95c640f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -180,
        -120
      ],
      "parameters": {
        "text": "={{ $json['report prompt'] }}",
        "options": {
          "systemMessage": "You are a senior digital marketing professional preparing an email to be sent to the client. There should be no made up data or hallucination. "
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "cd7d0eb0-fedf-45f2-9c7f-bcd40ca15136",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "notes": "\ud83d\udd11 Add your Anthropic API credentials in the node settings",
      "position": [
        -220,
        100
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude Sonnet 4"
        },
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "87a91c08-5c64-4dfa-9542-53ac14bd5337",
      "name": "MCP Client",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "notes": "\ud83d\udd10 Add your GoMarble Bearer YOUR_TOKEN_HERE - get it from https://www.gomarble.ai/docs/connect-to-n8n",
      "position": [
        20,
        100
      ],
      "parameters": {
        "sseEndpoint": "https://apps.gomarble.ai/mcp-api/sse",
        "authentication": "bearerAuth"
      },
      "typeVersion": 1
    },
    {
      "id": "8953ebc8-7632-48a3-ae8d-d8d201e9db47",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "notes": "\ud83d\udce7 Configure your Gmail credentials and set the recipient email address",
      "position": [
        520,
        -120
      ],
      "parameters": {
        "sendTo": "",
        "message": "={{ $json.text }}",
        "options": {},
        "subject": "Weekly platform analysis report"
      },
      "typeVersion": 2.1
    },
    {
      "id": "e8670179-2f5e-45b1-873f-896eec4150b0",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "\u23f0 Runs every Monday at 8 AM - adjust schedule as needed",
      "position": [
        -560,
        -120
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9ef2ba81-e746-47aa-84e6-962fa9cfa5fa",
      "name": "Basic LLM Chain1",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        180,
        -120
      ],
      "parameters": {
        "text": "=You are an expert in converting marketing reports into clean, well-styled HTML for email. Convert the following input into final HTML using the GoMarble brand theme and colors.\n\nDesign Guidelines:\n- Background: #00272B\n- Card Backgrounds: #033438\n- Subtle Sections / Dividers: #013135\n- Primary Text: #EAFDFC\n- Secondary Text: #B8FFF6\n- Tertiary Text: #8AD9D1\n- Borders: #00A0AF\n- Accent (CTA or highlight): #FFC66C\n- Error or alerts: #FF6B6B\n- Font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif\n- Headings: #EAFDFC, font-weight: 600\u2013700\n- Body Text: #B8FFF6\n- Use clean, modern padding, card-style sections, and well-aligned tables\n- KPI and campaign tables must have alternating row colors (#013135 / #033438), bold header row, bordered cells using #00A0AF\n- Section headings should have ample top margin, bold weight, and primary text color\n- Use <div>-based layout with section wrappers (cards), avoid raw <br> for spacing\n- Final HTML must be suitable for pasting directly into an email node \u2014 no CSS in <head>, use inline styles only\n- Output should be ONLY the inner HTML (no <html>, <head>, <body>, or comments)\n- Do not include any explanation or extra output \u2014 just the final HTML\n\nInput report:\n{{ $json.output }}",
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "ffa751d7-2632-4165-91d4-991f6846b7f9",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "notes": "\ud83e\udd16 Configure your OpenAI API credentials for HTML formatting",
      "position": [
        300,
        120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "chatgpt-4o-latest"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "fcc765ef-7e8a-4d41-8b69-1f3e40094cfb",
      "name": "Report Prompt",
      "type": "n8n-nodes-base.set",
      "notes": "\ud83d\udcdd Customize the report prompt for your specific account and requirements",
      "position": [
        -360,
        -120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f100cea7-e5ea-4dce-b69b-6739ccdfa543",
              "name": "report prompt",
              "type": "string",
              "value": "=You are senior performance-marketing analyst. \nVoice: sharp, concise, insight-driven (no fluff, no marketing hype). \nGoal: craft a weekly digest that a busy CMO can scan in <3 min and act on immediately.\nAd Account: [YOUR_ACCOUNT_NAME]; Time Period: Last 7 days\nUse Meta & Google Ads account data to create the report.\n\n1. Executive Snapshot (3-line paragraph)**\n   \u2022 One-sentence topline: combined spend, revenue, ROAS and WoW % change.  \n   \u2022 One-sentence highlight of the biggest win.  \n   \u2022 One-sentence note on the main risk / action gap.  \n\n**2. KPI Tables**  \n   A. *Channel Overview* \u2014 columns: Platform, Spend, Impr, Clicks, CTR, CPC, Conv, CPA, Revenue, ROAS, WoW \u0394-ROAS%.  \n   B. *Top 3 Campaigns (per platform)* \u2014 ranked by ROAS. Include objective and primary creative hook.  \n   C. Any *Underperformers*   \n\n**3. Give 2-3 Action Recommendations"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "45311444-f920-4b15-9d30-b6a76a8af36f",
  "connections": {
    "Gmail": {
      "main": [
        []
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Report Prompt": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain1": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Report Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}