Contact

How to Send The Right Content to Every Lead Using AI and Marketo

April 21, 2026

ai nurturing with marketo

Traditional nurture campaigns pose a fundamental challenge to marketers.

They send the same email to every person in a segment, regardless of:

  • Where that person actually is in their buying journey
  • What content they’ve already consumed
  • What topics they care about most

While you can improve content relevance with good segmentation and branching logic, even the most sophisticated Marketo nurture programs are making educated guesses at scale. You’re grouping people into buckets and hoping the content resonates.

But what if you didn’t have to guess at all?

At Revenue Pulse, we’ve been building what we call “AI Nurture” (or “AI Next Best Offer”) for our clients. 

It’s a workflow where Marketo triggers an AI-powered process that reads each lead’s demographic and behavioral data, then picks the single best piece of content to send them. From there, it writes a personalized subject line and email body and returns everything to Marketo, ready to send.

The result is true one-to-one email nurturing. Every lead gets a unique email, crafted specifically for them.

In this article, we’ll walk you through the full architecture of this workflow and explain how each piece works. We’ll also be including code snippets you can reference when building your own version.

Let’s jump right in!


Why Traditional Nurtures Fall Short

If you’ve spent any time in Marketo, you’ve probably built an engagement program with multiple streams. You set up cadences, add content, and maybe even use transition rules to move people between streams based on score or behavior.

It works, but there are some real challenges we wanted to tackle. Here are the 3 big ones:

Everyone in a stream gets the same email. A VP of Marketing and a junior coordinator in the same stream will receive identical content, even though their pain points and decision-making authority are completely different.

Content selection is static. You decided the order of emails weeks or months ago. The nurture doesn’t adapt to real-time signals; it just follows the sequence you built.

Scaling personalization is painful. To get more targeted, you need more streams, more segmentations, more content variants. It quickly becomes unmanageable. We’ve seen instances with dozens of streams that still don’t feel personal to the recipient.

AI Nurture solves all of these problems by making content selection dynamic and individual, not static and segment-based.

The Full Architecture

Here’s how the entire flow works at a high level:

  1. Marketo fires a webhook to an iPaaS workflow (we typically use n8n, but Workato, Zapier, or any other iPaaS will work).
  2. The workflow pulls the lead’s data from Marketo, including demographics (title, industry, company size) and behavioral activity (emails opened, pages visited, forms filled, content downloaded).
  3. A content selection model receives this data along with a RAG knowledge base containing your full content library. The model picks the single best piece of content for that specific lead.
  4. A subject line model writes a personalized subject line, using your top and worst-performing email subject lines from the past month as reference material.
  5. An email body model writes personalized HTML email copy, also trained on your recent email performance data.
  6. The workflow writes the results back to Marketo into custom fields: AI Email Subject, AI Email Body (HTML), and AI Email Body Text.
  7. Marketo sends the email, using Velocity scripting to render the HTML content from those fields.

Let’s break down each step.

Step 1: The Webhook Trigger

In Marketo, you set up a Smart Campaign that fires a webhook when a lead qualifies for the nurture. The webhook sends the lead’s ID (or email) to your iPaaS workflow.

Your webhook URL might look something like:

On the iPaaS side, this triggers the workflow. The first node receives the lead ID and kicks off the data retrieval process.

Step 2: Pull Lead Data from Marketo

The workflow calls the Marketo REST API to get two things: the lead’s demographic profile and their activity history.

For demographics, you’d call the Get Lead by ID endpoint:

For behavioral activity, you’d call the Get Lead Activities endpoint with the relevant activity type IDs (email opens, web page visits, form fills, and so on):

The workflow then compiles this into a structured payload. Here’s an example of what that compiled data might look like:

The contentHistory array is critical. It tells the AI what this person has already received, so it won’t recommend the same content twice.

Step 3: The Content Selection Model (RAG)

This is the core of the system. You send the lead’s compiled data to an LLM that has access to a RAG (Retrieval-Augmented Generation) knowledge base containing your content library.

Building the Content Library

Your content library is a structured document (or set of documents) that describes every piece of content your company wants to promote. Each entry should include:

  • Title: The name of the content piece
  • Type: eBook, webinar recording, blog post, case study, etc.
  • Summary: A 2-3 sentence description of what it covers
  • Key Takeaways: The main points someone will learn
  • Target Audience: Who this content is best suited for (by role, seniority, industry, buying stage)
  • URL/Link: Where the content lives
  • Tags: Topics covered (e.g., “budgeting”, “AI”, “data quality”, “attribution”)

Here’s an example of what one entry might look like:

Your full library might have 50 to 200+ entries. The RAG system indexes this content so the model can search and retrieve relevant options quickly.

The Content Selection Prompt

The system prompt for your content selection model might look something like this:

The model receives this system prompt along with the lead data and the content library (via RAG), then returns its pick.

Step 4: The Subject Line Writer

Once you know what content to promote, you need a compelling subject line. This is where the second model comes in.

What makes this model special is its knowledge base: you feed it your organization’s top-performing and worst-performing email subject lines from the past 30 days (or whatever timeframe makes sense). You can pull this data from Marketo’s Email Performance Report or via the API.

The knowledge base might look like this:

The system prompt for this model:

Step 5: The Email Body Writer

The third model writes the actual email body. It uses the same performance knowledge base as the subject line writer, but this time it’s looking at full email copy patterns rather than just subject lines.

This model returns HTML, which is important because Marketo will render it inside your email template.

The system prompt:

Step 6: Write Results Back to Marketo

Once all three models have returned their results, the workflow writes the data back to Marketo using the Update Lead endpoint:

You’ll need three custom fields in Marketo to hold this data:

  • aiEmailSubject (String)
  • aiEmailBodyHtml (Text, large enough to hold HTML content)
  • aiEmailBodyText (Text)

These fields get overwritten every time the workflow runs for a given lead, so you always have the freshest AI-generated content ready to send.

Step 7: Rendering with Velocity Scripting

Here’s where it all comes together inside Marketo.

Your email template contains Velocity script blocks that pull the AI-generated content from the lead’s fields and render them.

For the subject line, you simply use the token:

For the HTML email body, you need Velocity scripting to safely render the HTML. In your email template, you’d add something like:

This script checks if the AI body field has content. If it does, it renders the HTML directly. If the field is empty for some reason (maybe the workflow failed or the lead was added to the campaign before the AI could process them), it falls back to a generic message.

For the text version of the email (used by email clients that don’t render HTML), you’d use:

Important note on the HTML version: Because the AI returns HTML stored in a Marketo field, and Velocity renders it within your email template, you want to make sure the AI is only generating simple, inline-styled HTML. No external CSS, no JavaScript, no complex structures. Simple <p>, <a>, <strong>, and <br> tags with inline styles are your safest bet. Most email clients are picky about what they’ll render, so keeping it simple is both a technical and deliverability best practice.

What This Looks Like in Practice

Let’s walk through a quick example (We’re using a completely made-up person and company as a placeholder for this).

Lead: Sarah Chen, Director of Marketing at TechCorp (500-employee software company). Lead score: 47. Recently visited a blog post about AI agents, downloaded a 2026 planning checklist, and opened last month’s newsletter about budgeting.

What traditional nurture would do: Send Sarah the next email in Stream B, which is the same case study that every other lead in that stream also receives.

What AI Nurture does:

  1. Pulls Sarah’s full profile and activity history
  2. Recognizes she’s mid-funnel (decent lead score, active engagement), interested in AI and planning topics, and hasn’t yet seen the “Where Does AI Fit Into Your 2026 Budget?” article
  3. Selects that article as the best next piece of content
  4. Writes a subject line modeled after the organization’s best-performing emails: “Your 2026 plan is missing this piece”
  5. Writes a personalized email body that connects the content to her role as a marketing director during planning season
  6. Returns everything to Marketo, where the email is sent within minutes

Sarah gets an email that feels like someone on your team wrote it specifically for her. Because, in a way, something did.

A Few Things to Keep in Mind

Start with a solid content library. The AI is only as good as the options you give it. If your content library has 10 blog posts and nothing else, the recommendations will get repetitive fast. Aim for a diverse library that covers different topics, formats, buying stages, and audience segments.

Update your performance data regularly. The subject line and body writer models learn from your recent email performance. If you’re feeding them data from six months ago, they’re optimizing for patterns that may no longer work. We recommend refreshing this data monthly.

Build in fallbacks. Things will occasionally fail. An API times out, a model returns unexpected output, a field doesn’t get populated. Your Velocity scripts should always have fallback content, and your Smart Campaign should include a “wait” step to give the workflow time to complete before the email sends.

Test and iterate. Run A/B tests comparing AI Nurture emails against your traditional nurture campaigns. Track open rates, click rates, and most importantly, progression through the funnel. In our experience, the AI-generated emails consistently outperform static nurture content because they’re relevant to each recipient.

Watch your API usage. Each lead that goes through this workflow makes multiple API calls to both Marketo and your LLM provider. Be mindful of rate limits on both sides, and consider batching if you’re processing large volumes. Most iPaaS solutions let you add delays or queue management to stay within limits.

Wrapping Up

AI Nurture isn’t a futuristic concept. It’s something you can build and run today with tools that already exist: Marketo, an iPaaS like n8n or Workato, and any major LLM with RAG capabilities.

The shift it represents is significant. Instead of building nurture programs that treat segments as monoliths, you’re creating a system that treats every lead as an individual. It knows what they’ve done, understands where they are in their journey, picks the right content, and writes the email in a style that’s proven to work for your audience.

It’s one-to-one marketing at scale, and it’s not as far out of reach as you might think!

If you’re interested in building something like this for your organization, or if you want to see how Otto (our AI teammate for MOPs) handles nurture workflows, we’d love to chat. 

Reach out to us here to book some time with our team.