Get startedGet started for free

Building an AI marketing department

1. Building an AI marketing department

Welcome to this course on building marketing automations with n8n!

2. Meet your instructor

I'm Yaron Been — a marketer, automation architect, and founder of several AI-driven tools used by growth teams and agencies. My goal here is practical: I want to give you automations you can actually deploy, adapt, and improve inside your own marketing stack.

3. The FlowPilot challenge

Here's the scenario. Imagine you've just joined FlowPilot, a B2B sales automation startup, as the new Chief Marketing Officer. The product is growing fast, but the marketing team can't keep up! You've inherited three challenges. There's no unified marketing strategy: messaging varies across channels, and content lacks a central narrative. Landing pages convert poorly, but nobody has the bandwidth to test and optimize them, and your sales team is finding leads manually, searching Google one business at a time.

4. Three workflows, one mission

So, here's your mission: solve all three challenges by building an AI-powered marketing stack! Each workflow teaches a different automation pattern. First, you'll build a multi-agent marketing system where AI specialists collaborate to produce a complete marketing plan. This tackles the strategy unification challenge. Second, a conversion rate optimizer that generates suggestions, scores them, and loops back to improve, fixing the landing page issues. And third, a lead scraper that pulls business contacts from Google Maps automatically, replacing the manual search. Together, these three workflows form a complete AI marketing stack for FlowPilot.

5. The parallel agent architecture

Let's start with the first one: the multi-agent system. Here's the architecture. A Campaign Brief node holds four fields: business context, objective, target audience, and budget. Three specialist AI agents — a Brand Strategist, a Content Strategist, and a Paid Ads Expert — each connect to the Campaign Brief through their own branch and work independently. Why separate branches? Because each specialist has a different focus, and we want to keep them isolated. Then, a Merge Strategies node waits for all three branches to finish before letting data flow downstream. After that, a Code node combines the outputs into one object. The CMO Summary Agent reads all three strategies and produces a single executive brief.

6. Collecting and reshaping outputs

Let's zoom into the merging strategy. The Merge node outputs a list of three separate items, one per agent. If the CMO Summary Agent receives three items, it runs three times and produces three separate briefs — not what we want. So a Code node reshapes that list into a single combined object with three named fields: brand, content, and paid. This is a deliberate design choice. Combining outputs is a deterministic task, so a Code node is more predictable than asking another AI agent to do it.

7. Structuring the final output

The CMO Summary Agent reads those three combined fields and produces one executive brief. But instead of returning plain text, we attach a Structured Output Parser. The parser enforces a JSON schema, which means every run returns the same predictable structure: an executive summary, a ranked list of priorities, and day 30, 60, and 90 milestones. This matters beyond just formatting. A predictable JSON output means you can chain this workflow into a dashboard, a Slack notification, or another automation without worrying about how the AI phrased things on a given run. The result: a complete, structured marketing plan from a single Campaign Brief.

8. What you'll learn

By the end of this chapter, you'll know how to use parallel branches to run independent AI agents from a single input node, enforce JSON schemas with Structured Output Parsers so your outputs are always predictable, merge parallel outputs and reshape them with a Code node so the final agent runs exactly once, and synthesize independent specialist strategies into one structured executive brief. These patterns apply far beyond marketing — any time you need multiple AI perspectives combined into one deliverable.

9. Let's practice!

Ready to build your AI marketing department? Let's get started!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.