ai-agents · automation · marketing · xpr

Using AI agents to research, draft, and publish marketing content

How to build a custom AI agent workflow to publish on a regular cadence

For a startup or any small business, it is important to publish regularly - firstly, it signals that the company is alive and kicking, it keeps you visible in search and it gives a prospect something recent to read when they look you up. Now, everyone agrees that this is important but the hard part is actually doing it week after week, especially when it's nobody's full time job.

Where it broke down for us

For us at XPR, where we sell self-ordering solutions like Kiosks and QR Code ordering to food-service operators, restaurant chains and resellers, our blog has two kinds of posts -

The first is a feature post. When we ship something new like a Talk to Order feature or Fleet Management Solution, we write a post explaining it. These are written by hand, start to finish, by the person who built or owns the feature. We do not hand these to an agent. A feature post is the product talking to a customer, and it has to be exactly right, so the person who knows the feature writes it. We may occasionally enhance it with AI.

The second kind is everything in between. Releases do not arrive every week, and the blog cannot go quiet in the gaps. So we fill them with posts that comment on something recent in restaurant tech, or expand on something we already do well. On paper these are the easy wins but in practice these posts would never get done. Two reasons -

  • Starting with a blank page is hard. Coming up with an angle worth writing is most of the work and researching that takes time.
  • Without a release forcing the issue, the blog just slips. There is always something more urgent.

What we delegated to the AI agent

We handed over the two things that actually stop us: remembering, and starting.

On a weekly schedule, the agent reminds us that a post is due and then suggests ideas for the in-between posts. We provide it enough context to determine the topic suggestions. Details are in the sections below.

How it works

The flow runs on a weekly rhythm with a person in the middle.

  1. On a schedule, the agent reminds us in the marketing Slack channel that a publishing slot is coming up.
  2. It researches and suggests ideas. It already knows what XPR does and what we have blogged about, so it does not repeat us. It reads relevant industry sources and recent news, and comes back with a short list of angles grounded in our actual work.
  3. We pick an idea we like and ask it to expand it. It returns a rough first draft.
  4. We give feedback, what to cut, what is wrong, what to say differently, and it revises.
  5. Where the post needs an image, it generates a concept image to go with it.
  6. It publishes the post to its own preview branch with a live preview URL.
  7. We review the preview, and after approval it goes live.

Optionally, the same agent drafts a LinkedIn post tied to the article. That goes through the same loop: it drafts, we edit, we approve, and only then is it posted.

The architecture behind it

A few choices make this safe to run. The first is that this is not one big agent. The marketing work is split into focused sub-agents, each with a narrow set of tools: a research agent, one that drafts a blog post, one that does the SEO pass, and another sub-agent that publishes. Only messages in our marketing Slack channel reach this set. The channel a message arrives in decides which agent answers and what it is allowed to touch.

A bit more detail on how it researches -

  • It reads our own site first. Before it suggests anything, it pulls the recent posts from our marketing site repository, their titles, categories, and summaries, so it knows what we have already covered, does not repeat us, and can build on what is there.
  • The research sub-agent searches current online activity in the areas of interest to us: Self Ordering Kiosks, AI voice ordering, POS and Payment Integrations, relevant Trade Shows. It maps what it finds back to what XPR does and to the people we write for.

Once we pick from the list of candidate topics and summaries generated by the research agent, it goes ahead and creates a draft blog post. Each post goes onto its own preview branch, gets a generated hero image, and opens its own pull request with a live preview URL on Vercel. Approving merges that one pull request to main. The agent uses a GitHub token scoped to the marketing website repository only. It has no access to the product code.

So overall, the agent removes the two excuses that kept the blog quiet: not knowing what to write, and forgetting to write it. The writing that readers see still goes through a real person.