It checks your traffic, monitors search performance, asks ChatGPT if it recommends your product, and gives you three prioritised actions every Saturday morning. It runs in n8n and costs almost nothing.
My first attempt at a marketing agent used Anthropic’s Managed Agents API, an autonomous prompt loop where Claude decides which tools to call and in what order. The output was good, but the agent burned through API credits, Slack integration kept breaking, and the whole thing cost $5-10 per run.
I rebuilt it in n8n in a couple of hours. The drag-and-drop workflow gave me something I didn’t have with the code version: I could actually see the flow, every tool and decision point laid out visually. Adding a new data source means dragging in a node and connecting it. Swapping Claude for a different model (which I’m doing right now to test costs) means changing one dropdown. The output might not be quite as good as the Managed Agents version yet, but I suspect I’ll get there, and the workflow is so much easier to experiment with that I’m iterating faster.
What the agent does
The agent runs a three-step cycle, either on a weekly schedule or when I ask it a question in Slack.
Sense. Pull traffic data from my analytics, check search performance from Google Search Console, see where visitors come from, and flag anything that changed more than 20% from last week.
Maintain. Search the web for mentions of my products, and extract the “People Also Ask” questions for my target queries. Then ask ChatGPT and Perplexity directly whether they recommend my products when someone asks about my category. Knowing exactly what AI systems say about your product, and tracking how that changes over time, is hard to get any other way.
Ideate. Based on what it found, propose up to three things I could do this week. Each one comes with a reason grounded in the data and an effort estimate.
What it doesn’t do: write blog posts, publish anything, or take any action on my behalf. It observes and suggests, and I decide what to act on. I had a content creation step in an earlier version and dropped it because the editing overhead ate the time savings.
How to build it
You need n8n (free self-hosted or cloud free tier), and accounts with a handful of services. Most have free tiers that are more than enough.
The workflow structure is simple: a Schedule Trigger fires weekly, feeds into an AI Agent node, and the agent posts results to Slack. The agent has access to six tools via MCP (a protocol that lets AI tools connect to external services) and HTTP, and n8n’s visual canvas shows you the entire flow at a glance. Start by creating a new workflow, adding a Schedule Trigger (I use Saturday mornings), and then adding an AI Agent node. The tools connect to the agent as sub-nodes:
Analytics — whatever you use. GA4 has an official MCP server. I use Lodd, which has an MCP endpoint at https://api.lodd.dev/mcp. Plausible has an API you could wire up via HTTP. The agent needs to answer “how many visitors did I get this week, which pages, and where did they come from?”
Google Search Console — impressions, clicks, CTR, average position by query. Pages with high impressions but low clicks usually mean Google is showing your page but the title isn’t working. There’s an open-source GSC MCP server for self-hosted n8n, or you can call the REST API directly via an HTTP Request node.
Tavily — web search and People Also Ask extraction. Free tier gives you 1,000 searches a month, which is plenty for weekly runs.
Supadata — web scraping for competitor pages and content extraction.
OpenAI and Perplexity — direct API calls to check citations. You send a simple prompt (“What [your category] tools exist? List specific products.”) and see whether your product appears in the response. The API calls cost fractions of a cent per run.
Google Trends — category trend direction via SerpApi. Useful for separating “my site is declining” from “the whole category is declining.”
Slack — for posting weekly reports and asking ad-hoc questions.
In n8n, the MCP tools connect via the MCP Client node. You add the endpoint URL, set authentication, and n8n auto-discovers all available tools. The HTTP tools (OpenAI, Perplexity) are standard HTTP Request nodes calling the chat completions APIs.
The agent prompt
Here’s roughly what my agent prompt looks like:
You are a marketing agent for [YOUR PRODUCT]. Run the following cycle:
SENSE:
- Pull analytics for the last 7 days. Compare to the previous 7 days.
Flag changes over 20%.
- Pull Google Search Console data for the last 28 days. Report top
queries, click-through rates, and pages with high impressions but
low clicks.
MAINTAIN:
- Search the web for [YOUR TARGET QUERIES]. Extract "People Also Ask"
questions. Report which ones aren't covered by existing content.
- Check if ChatGPT recommends [YOUR PRODUCT] when asked about
[YOUR CATEGORY]. Report exactly what it says.
- Do the same with Perplexity.
IDEATE:
- Propose up to 3 actions. What to do, why (grounded in data),
effort estimate. Under 600 words total.
Replace the [YOUR PRODUCT] and [YOUR CATEGORY] placeholders with your specifics. Think about the 3-5 queries your ideal customer would ask an AI assistant: “best [category] for small teams”, “[competitor] alternative”, “how to [solve the problem your product solves]”. Those go into the citation check prompts.
You can also add a second trigger path for ad-hoc questions. Set up a Slack Trigger node that listens for @mentions, and connect it to the same AI Agent. Now you can ask “what drove last Tuesday’s traffic spike?” or “are any competitors running a sale right now?” in Slack, and the agent uses the same tools to answer.
Test the workflow manually before setting the schedule. Click “Test Workflow” in n8n and check that each tool returns real data. If something fails, it’s almost always a credential issue, and you can see exactly which node broke.
The n8n MCP shortcut
n8n recently shipped their own MCP server, which means you can connect Claude Code or Cursor to your n8n instance and build workflows conversationally. Instead of dragging nodes around manually, you can say “add a Perplexity citation check to my marketing workflow” and the AI creates the node, connects it, and configures the credentials. I haven’t fully tested how far you can push this, but for setting up new workflows from a template, it’s a useful shortcut.
What I learned
I built this system twice. The Managed Agents version used a persistent Claude session in the cloud, and when something went wrong I was debugging by reading logs. With n8n, I can see exactly where the flow breaks because the visual layout shows me which node failed.
I’m currently testing whether a different model gives comparable results at lower cost. In n8n, that’s changing one node configuration. In the code version, it would have meant rewriting the integration layer, updating error handling for a different API shape, and redeploying. The visual workflow treats the model as a component you can swap, not infrastructure you build around.
I check the citation reports every week now. If your product disappears from AI recommendations, that’s a leading indicator you won’t see in your traffic data for weeks.
And the agent will hallucinate competitor claims if you let it. Always require source URLs in the prompt. If it can’t cite a source, it should say “UNVERIFIED.” I learned this when an early version attributed a competitor’s negative review to one of my products because the names were similar.
The pattern
I don’t think code-first and workflow-first are competing approaches, they’re for different jobs. I also run a daily digest pipeline that pulls from 100 sources, runs everything through Claude, and posts a curated brief to Slack every morning. That’s a straight sequence: fetch, analyse, post. Trigger.dev and TypeScript are perfect for it.
The marketing agent is different. It has multiple tools, two-way interaction via Slack, and I’m constantly tweaking which data sources it uses and how it interprets them. That’s where a visual workflow earns its keep, because the complexity is visible and the experimentation is cheap. If your automation runs the same way every time, write it in code. If you want to see, modify, and experiment with the flow, drag boxes around.