Back to Writing

Prompt chaining: split the work, raise the floor

One big prompt that does five things will fail somewhere in the middle and you won't know where. Five prompts that do one thing each cost more to run and are far easier to fix.

2 min read

Prompt chaining means breaking a complex task into a sequence of smaller prompts. Instead of asking a model to handle everything in one call, you walk it through the steps. You get:

  • Higher accuracy and reliability
  • The ability to handle multi-step tasks
  • More control over the reasoning
  • Somewhere to check for errors before they spread

The main techniques

Sequential chaining

The simplest version. String prompts together so each one works on the last one’s output.

  1. “Summarise the key points of this article.”
  2. “Based on that summary, what are three follow-up questions we could ask?”
  3. “Write an email to the author asking those questions.”

Branching chains

Pick the next prompt based on what came back from the last one.

  1. “Analyse the sentiment of this customer review.”
  2. If positive: “Generate a thank-you response.”
  3. If negative: “Draft an apology and offer a discount.”

Recursive chains

Feed a prompt’s output back into itself and let it improve.

  1. “Write a short story about a robot.”
  2. “Analyse the story and suggest improvements.”
  3. Apply the improvements and repeat until it’s good enough.

Human-in-the-loop chains

Put a person at the decision points that need one.

  1. The model generates a product description.
  2. A human approves it or asks for changes.
  3. The model revises based on that.

Best practices

  1. Start simple. Basic chains first. Add complexity when something forces you to.
  2. Be specific. Clear, detailed instructions in every prompt.
  3. Pass context forward. Carry what matters between steps or the chain loses the thread.
  4. Test the structure. Different shapes suit different tasks and you won’t guess right first time.
  5. Monitor outputs. Put checks in that catch errors before they propagate down the chain.
  6. Refine iteratively. Improve the chain based on what it actually produces.

Why splitting the work helps

I use this for customer emails. The first prompt reads the incoming email and pulls out the sentiment, what the person needs, and the relevant facts from a knowledge base. That output goes into a second prompt that drafts the reply.

It comes down to load. Each call is doing about half as many things as one combined call would, so there’s less to get wrong at each step, and the second call gets a chance to catch problems from the first. That raises the floor rather than the ceiling.

Tooling

Plenty of platforms help you build and manage these workflows: OpenAI function calling, LangChain, NVIDIA NIM Agent Blueprints, and the various agent frameworks. They give you pre-built components so you’re not wiring it all up yourself.

There’s still a gap, though. A good environment for managing, testing and iterating on prompts with variables and a knowledge base is hard to find. For now, treat chaining as something you tune by hand, and expect to experiment before you land on the right structure.