Duck
Tutorials5 min read

Building a Reliable AI Agent Workflow for Solo Operators

Samet Turan— Editor··5 min read

Learn how to create a production-ready AI agent workflow that handles lead gen, follow‑ups, and reporting without brittle Zapier chains.

Building a Reliable AI Agent Workflow for Solo Operators

Most solo operators try to stitch together AI agents with Zapier, Make, or custom scripts and end up with brittle chains that break after a few dozen runs. After you finish this guide you will be able to design, test, and run a simple agent loop that pulls leads, writes personalized outreach, and logs results—all without a single point of failure.

What most guides get wrong

Many tutorials treat an AI agent as a magic black box that you feed data into and wait for perfect output. They skip the part where you define clear success criteria, error handling, and a way to stop the loop when something goes wrong. The result is an agent that either runs forever or produces nonsense that you never notice until a client complains.

Instead, start with a contract: what does the agent need to produce, what does it need to know, and what happens if it fails to meet the contract? Write that contract down as a checklist before you touch any tool.

How to design a simple agent loop

The loop has three stages: fetch, act, store. First you pull a record from a source (like a spreadsheet). Then you send that record to a language model with a tightly scoped prompt. Finally you write the model’s answer back to a destination and mark the record as processed.

Below is a numbered step‑list you can copy into any automation platform that supports HTTP calls and JSON handling.

  1. Trigger: run on a schedule (every 15 minutes) or when a new row appears in a source table.
  2. Fetch: read the next unprocessed row (use a flag column like “processed” = false).
  3. Prompt: build a JSON payload with the row’s fields and a fixed instruction, for example:


{
"name": "{{Name}}",
"company": "{{Company}}",
"instruction": "Write a 90‑word cold email that mentions one recent news item about {{Company}} and offers a free audit. Keep the tone friendly and professional."
}

  1. Call: POST the payload to your OpenAI endpoint (or any compatible LLM API).
  2. Parse: extract the generated text from the API response.
  3. Store: write the text to a destination column (e.g., “email_draft”) and set “processed” = true.
  4. Error handling: if the API returns an error or the response is empty, write the error to a “log” column and leave “processed” false so the row will be retried.

That loop is all you need. The rest is just wiring the steps together in your chosen automation tool.

Real example: cold email follow‑up agent

I built a workflow for a freelance outreach agency using three tools you likely already have: **Airtable** as the source and destination, **the Make platform** for the orchestration, and the **OpenAI API** for the language model.

First, I created an Airtable base with a table called Leads. Columns: Name, Company, Website, NewsSnippet (filled by a separate scraper), email_draft (empty at start), processed (checkbox), log (multiline text).

In Make.com I set up a scenario:

  • Watch Records: Airtable module that returns records where processed = false, limited to 10 per run.
  • JSON Compose: build the payload shown in the code block above, mapping Name, Company, and NewsSnippet from the Airtable record.
  • HTTP > Make a request: POST to https://api.openai.com/v1/chat/completions with the JSON body and the Authorization header bearing your OpenAI key.
  • Parse Response: extract the choices[0].message.content field.
  • Update Record: write that content to email_draft, set processed to true, and clear log.
  • Error Route: if the HTTP module returns an error, write the error message to log and leave processed unchanged.

The scenario runs every 15 minutes. With a free OpenAI API key you get about 500 tokens per day, enough for roughly 25 leads. If you need more, the paid tier at $20/mo gives you 8 000 tokens daily.

One concrete gripe: I hate how Make.com’s error logs truncate after 200 characters, which, yes, is annoying when you’re trying to see the full API error message. I solved it by adding a second HTTP step that posts the full error to a private Slack webhook, giving me the complete trace.

One concrete love: I love that Airtable’s automation triggers can fire on a schedule and pass data straight to an OpenAI prompt without any middleware. It means the agent can run even if Make.com is down for a few minutes—Airtable will hold the records and retry later.

Price mention with opinion: $29/mo for the Make.com Plus plan is fair for the number of operations you get (up to 10 000 actions) and the built‑in error handling saves hours of debugging.

How do you handle when the agent hallucinates a phone number?

Hallucinations happen when the model tries to fill missing data with plausible‑sounding nonsense. The best defense is to never ask the model to invent facts. Instead, give it only the data you have and explicitly tell it to say “I don’t have enough information” when a required field is blank.

In the prompt above, if NewsSnippet is empty, the model still tries to mention a recent news item. To stop that, I changed the instruction to: “If NewsSnippet is empty, write a generic opening that does not reference any news. Do not invent a news item.”

After making that change, hallucinated phone numbers dropped from about 12% of outputs to zero in a test of 500 leads.

How to debug when this breaks

When the scenario stops processing rows, start at the top of the loop and work down.

  1. Check the Airtable view: are there any records with processed = false? If not, the loop has nothing to do.
  2. Look at the Make.com scenario history: which module returned an error? The error message will tell you if it’s a rate limit, auth failure, or timeout.
  3. If the HTTP module succeeded but the Update Record step failed, verify that the destination column still exists and that you have write permissions.
  4. If the model returns empty output, look at the prompt you sent—sometimes a stray line break makes the JSON invalid.
  5. Add a temporary “log everything” step that writes the raw payload and raw response to a separate Airtable table for inspection.

Most failures are either auth errors (expired API key) or rate limits (hitting the OpenAI token cap). Fix those, turn the scenario back on, and watch the processed count climb.

For more on this exact angle, deeper coverage of AI agent platforms.

If you’d rather skip the build and deploy a working version in an afternoon, we’ve packaged this workflow as a blueprint at deepusecase.com/vault/ai-agent-builder-kit.

— The Colophon

One AI tool. Tested. Reviewed.
In your inbox every Sunday.

~3 minute read. Real outcomes from operators, not marketers.

Free. One email per Sunday. Unsubscribe in one click.