Duck
Tutorials9 min read

Building AI Systems That Don't Break on Tuesday

Samet Turan— Editor··9 min read

Learn to build reliable, multi-step AI systems for your business. This guide covers state management, error handling, and the tools that actually work in production.

What Most Guides Get Wrong About AI Systems

Most tutorials on building AI automation are just glorified prompt engineering guides. They show you a clever, 2000-word mega-prompt that supposedly does everything from research to writing to formatting. It works once in the demo, you get excited, you try to build a business process on it, and it fails unpredictably. The problem isn’t your prompt. The problem is that a single prompt isn’t a system.

A real AI system is plumbing. It’s a series of small, specialized, and resilient steps, not one giant, fragile brain. It’s about managing state, handling errors, and connecting discrete tools. The magic isn’t in one perfect prompt that writes a blog post; it’s in a workflow where one AI agent generates an outline, another finds sources, a third drafts sections, and a fourth checks for consistency. This approach is more work to set up, but it’s the only way to build something that runs reliably without you babysitting it every morning. Forget the single-prompt dream. It’s a trap.

The Core Components: State, Tools, and Transitions

To build durable AI systems, you need to think like a programmer, even if you’re using no-code tools. Every automated workflow is composed of three fundamental parts.

🤖
Recommended Reading

AI Side Hustles

12 Ways to Earn with AI

Practical setups for building real income streams with AI tools. No coding needed. 12 tested models with real numbers.


Get the Guide → $14

★★★★★ (89)

  • State: This is the memory of your system. It’s the information that gets passed from one step to the next. In a simple case, the state might just be a single piece of text, like a customer email. In a more complex system, it could be a structured JSON object containing a user ID, research notes, a list of sources, and a draft status. Managing state is critical. Losing state mid-workflow means the system has amnesia and can’t complete its task.
  • Tools: These are the verbs of your system. A tool is a specific capability you give your AI. This could be ‘call the Google Search API’, ‘read a file from Dropbox’, ‘query our database’, or ‘send an email’. The most important tool, of course, is ‘ask an LLM to think’. By breaking down capabilities into discrete tools, you create predictable, testable actions. Instead of asking one big prompt to ‘research a topic and write a post’, you use a ‘search’ tool, a ‘scrape_url’ tool, and a ‘write_draft’ tool.
  • Transitions: This is the logic that connects the steps. It’s the ‘if this, then that’ brain of the operation. After a tool runs, the transition logic decides what to do next based on the result. If the ‘search’ tool returns a list of URLs, the transition logic might send each URL to the ‘scrape_url’ tool. If the search tool returns an error, the transition logic should trigger an error-handling path, maybe by trying a different search query or notifying a human. This is where most no-code automations fall apart—they lack robust transition logic.

Thinking in these terms forces you to design a process, not just write a prompt. It’s the difference between a hobby project and a production asset.

A Concrete Example: Building a Research Agent with Make

Let’s make this real. I’ll show you how to build a simple agent that takes a topic, researches it, and produces a summary brief. We’ll use Make.com as our orchestrator (the platform that handles state and transitions) and connect to a few external tools.

The goal: A new row in an Airtable base with a ‘Topic’ field triggers a workflow that fills in a ‘Research Brief’ field.

Here’s the step-by-step flow inside Make:

  1. Trigger: New Record in Airtable. The workflow starts when we add a new topic, like “The history of GraphQL APIs”.
  2. LLM Step 1: Generate Questions. We send the topic to an LLM. I use the Claude 3 Sonnet API for this because it’s fast and cheap. The prompt isn’t fancy: Given the topic "{{topic}}", generate a JSON array of 5 specific questions a researcher would ask to understand this topic. Output ONLY the JSON array, with no preamble.
  3. Tool Step 1: Search. Make’s iterator function takes the JSON array from Claude and runs a new branch for each question. In each branch, we use a search API. I prefer Serper for this; it’s fast and the $10/month plan is generous for most uses. We call the Serper API with the question as the query.
  4. Tool Step 2: Scrape. The search API returns a list of URLs. We take the top 2-3 URLs and pass them to a scraping tool. You can use a built-in Make HTTP module with a service like ScraperAPI, or a dedicated scraping tool. The goal is to get the raw text content from each page.
  5. LLM Step 2: Synthesize. This is the hard part. We now have a big mess of unstructured text from multiple sources. We bundle it all up and send it back to Claude with a clear, structured prompt. This is a prompt I’ve had success with: You are a research analyst. I will provide you with a topic and a block of raw text scraped from several web pages. Your task is to synthesize this information into a concise research brief of 3-4 paragraphs. Ignore irrelevant text like navigation links, ads, and comments. Focus only on the substantive content. Topic: {{topic}}. Raw Text: {{scraped_text}}.
  6. Final Step: Update Airtable. We take the generated brief from the LLM and use the Airtable ‘Update a Record’ module to write it back to the correct field in our base.

This multi-step process is far more reliable than a single prompt that tries to do everything. Each step is simple, has a clear input and output, and can be debugged individually.

Why Do Simple AI Chains Break So Often?

You’ll build the workflow above, it will work five times in a row, and then on the sixth run, it will fail silently. Why? Because the digital world is messy, and AI systems are sensitive to that mess. Production AI systems aren’t about building for the best-case scenario; they’re about planning for the inevitable failures.

Here are the most common points of failure:

  • LLM Hallucinations (Format, not Facts): The most common failure point, by far. You ask the LLM for JSON, and it gives you JSON wrapped in a Markdown code block. Or it adds a friendly sentence like “Sure, here is the JSON you requested!”. This breaks the next step in your automation, which is expecting raw JSON. My biggest gripe with all current models is their inability to follow output formatting instructions with 100% reliability. It’s maddening.
  • API Timeouts and Rate Limits: The search API you’re calling might be slow to respond, causing your orchestrator to time out. Or you might hit a rate limit (e.g., only 60 requests per minute) if you’re processing a batch of topics at once.
  • Website Structure Changes: Your scraper works perfectly for a week, and then the website you’re targeting redesigns its HTML. Your scraper can no longer find the main content, and it starts feeding garbage into your LLM, resulting in a useless summary.
  • Unexpected Content: The page you scrape might be a 404 error, a login wall, or have a giant cookie consent banner as the main text. Your system needs to be smart enough to recognize this isn’t useful content and either skip it or try another source.

A system that doesn’t account for these issues is a toy, not a tool.

The Operator’s Playbook for Debugging

So, how do you fix it? You build in resilience from the start. You don’t just hope for the best; you plan for the worst. This is what separates an amateur from a professional operator.

First, log everything. Every API call, every LLM input, every LLM output. When something breaks, your logs are the only way to trace the failure back to its source. Make has a decent logging history, but for serious work, I pipe logs to a dedicated service or even a simple Airtable base.

Second, implement self-correction loops for LLM outputs. This is my favorite technique and it solves the formatting problem. Before passing the LLM’s JSON output to the next tool, run it through a validation step. Is it valid JSON? Does it have the keys you expect? If not, don’t just fail. Send the bad output *back* to the LLM with a second prompt: The following output you provided is not valid JSON. Please correct it and provide only the valid JSON. Bad output: {{llm_output_1}}. The model is surprisingly good at fixing its own mistakes.

Third, use error handling routes. In Make, this is the ‘Error Handler’ option. If a module fails (like an API call timing out), you can trigger a specific set of actions. My default is a simple retry-with-delay. The module will try the API call again after 15 seconds. If it fails three times, it sends me a notification in Slack and stops that specific workflow run so it doesn’t waste more resources.

This is the unglamorous, essential work of building real AI systems.

Beyond No-Code: When to Use an AI Agent Framework

Tools like Make and Zapier automations are fantastic for linear, predictable workflows. But sometimes you need more. You need loops that can run an unknown number of times, complex conditional logic, or the ability to dynamically choose from dozens of tools. This is where you might hit the ceiling of no-code platforms.

When that happens, you step into the world of AI agent frameworks like LangChain or CrewAI. These are Python libraries that provide building blocks for creating more sophisticated agentic systems. They give you more granular control over state management, tool creation, and the agent’s reasoning process.

The tradeoff is complexity. You’re writing code now. There’s no friendly drag-and-drop interface. Honestly, for 90% of business automation tasks, it’s overkill. Make’s Pro plan at $29/month is a steal for the amount of work it can handle. Jumping to a code-based framework like LangChain is ‘free’ only if your development and debugging time has no value (which, for an operator, it definitely does). Stick with no-code until you have a problem that is genuinely impossible to solve there. Don’t add complexity for the sake of it.

You can build incredibly powerful and reliable AI systems using off-the-shelf tools if you focus on the plumbing, not just the prompts. Think in terms of state, tools, and transitions. Plan for failure, build in redundancy, and log everything. That’s the playbook.

We cover this in more depth elsewhere — 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 entire research agent workflow as a deployable AI automation blueprint. You can find it at deepusecase.com/vault.

— 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.