PRTL Labs: How the agents plan, run and schedule a campaign
Case study
How the agents plan, run and schedule a campaign
At PRTL Labs I worked on AI agents that run marketing for local retail brands. We tried to get several agents working together on Cloudflare, and the parts below are the ones I designed and built.

Windows and cards come from the product's own agent code, run locally on invented data, in a console made for this demonstration. The model's reply is a recorded stand-in, outside services are stubbed and nothing was posted. The Instagram failure was forced and some waiting cut. Drawn: posts, tiles, headlines, pointer, MCP scene (MCP, a standard way agents call tools).
How I did itHide how I did it
A local shop wants posts that feel local. I built the agent that turns one typed sentence into a planned campaign, runs its ten steps, recovers when one fails, and sets an alarm for anything scheduled.
Transcript
The film has music and no voice. These are the words that appear on screen, in order.
Local shops need posts that feel local.
Making one meant starting every job by hand.
Now it takes one sentence.
The agent reads it and writes its own plan.
It picks its tools and says why.
Then it runs the campaign in ten steps, and saves each one as it finishes.
It finds what's happening in town and writes about that.
If a step fails, only that step runs again.
Tell it when, and it sets its own alarm.
Every scheduled post gets its own alarm.
When the alarm rings, the campaign starts itself.
Other agents can call it too, over MCP.
One sentence goes in, and a running campaign comes out.
PRTL Labs
AI agents that run marketing for local retail brands.
01
A sentence, a plan and the workflows it starts
You send it a sentence in plain English. A language model on Cloudflare reads it next to the agent's four tools and answers with a JSON plan: which tool, what settings and why. The agent checks the plan, starts each job as a durable Cloudflare Workflow and returns its decision trail.
One sentence, a plan, and the workflows it started
02
The ten steps of a campaign
It checks the request, reads recent campaigns to avoid repeats and searches local trends. It writes a topical post instead of a sales pitch, makes an image and a video, and saves a campaign per store. Then it posts to Instagram and X and records the results.
The ten steps of one campaign
03
Retry of one failed step
Each step saves its result. A failed step retries alone, up to two or three times with longer waits, and the steps before it do not run again. I reworked most steps and wrote the content step.
Step 8's two waits before it passed
04
The scheduler's old and new design
Scheduled posts sat in a key-value list that a cron job swept every minute. Cloudflare's Durable Objects, small servers that each keep their own state, can wake themselves with an alarm, but each holds only one at a time. So my scheduler makes a new object for every task.
One list swept every minute, and one object per task
05
Three scheduled posts and their alarms
A language model reads a request like "post this at 9am tomorrow" and returns the agent, job and time. A fresh object, named after the task, stores it and sets its alarm. When it rings, the object hands the job to the right agent.
Three posts on one day, each with its own alarm
06
How other agents call it
I published it as an MCP server. MCP is a standard way agents call tools, so other agents and Claude clients can call it too. They reach it over SSE, a connection that stays open and streams the reply, or plain HTTP, or call it directly over RPC.
Other agents and Claude clients call the agent over MCP or RPC
Read on
Next project
HelpHive
Final year project
A marketplace where hotels book housekeeping staff by the hour, with an Android app for hotels and providers, a web app and an admin console.
25 kmjobs nearby arrive as an alert