CertPrep
Domain 1 · Lesson 1.1 · 6 min read

Choosing a Workflow, an Agent and a Runtime

Exam skillArchitecture and Runtime Selection

Evaluating whether a workflow or an agentic architecture fits a set of business requirements, error tolerance, and audit constraints. This includes choosing the orchestrator and subagent decomposition and selecting the execution environment: a self-hosted harness or a managed, sandboxed agent runtime.

Decide between a workflow and an agent from how predictable the path is, how costly an error would be and what the audit trail must show; split work between an orchestrator and subagents only where the pieces are independent; and run the agent in a self-hosted harness or a managed, sandboxed runtime depending on who must control the environment.

What you need to know

Most failed agent projects did not need an agent. Start with the simplest design that meets the requirement and add autonomy only when the task demands it.

Workflow or agent

WorkflowAgent
Who decides the stepsYour codeThe model, in a loop
Fits whenThe path is known in advanceThe next step depends on what earlier steps found
StrengthsPredictable, cheap, easy to auditHandles open-ended investigation
CostsRigidMore tokens, more variance, harder to test

Common workflow patterns: prompt chaining (fixed sequence), routing (classify, then send to a specialized path), parallelization (independent checks at once, combined in code), orchestrator-workers (a lead model splits a task and delegates) and evaluator-optimizer (one call drafts, another critiques).

Most real systems mix both: route the predictable majority (say, address changes) into a workflow and send the unpredictable minority (disputes) to an agent.

Orchestrator and subagents

An orchestrator splits a task and sends parts to subagents, each with its own context window. This pays off when parts are independent and context-heavy (research across several sources, auditing several services).

  • Give each subagent a distinct scope and a defined result format, so results do not overlap and stay small.
  • Make every result carry a status. A missing or failed result is a gap, never "clean."
  • Keep tightly dependent steps (reproduce, diagnose, fix) in one context. Splitting them loses detail at every handoff.

Where the agent runs

Self-hosted harness (Agent SDK)Managed runtime (Claude Managed Agents)
You run the loop on your infrastructureAnthropic hosts the loop and a sandboxed container
Full control of network, images, loggingPersistent sessions you resume by ID, event streams
You build durability, sandboxing and scalingNo container infrastructure to operate
Fits strict "runs inside our network" policiesFits teams that need sandboxed code execution without platform engineers

The binding constraint decides. A bank that requires execution inside its own network chooses a self-hosted harness; a small team that needs long, resumable, sandboxed sessions chooses the managed runtime.

Hard rules stay in code

Even inside an agent, approvals over a threshold, validation of bookings or refunds, and audit logs belong in the harness or tools, not in the prompt. The model chooses what to try; the code decides what is allowed.

In the exam

Items describe requirements (predictability, error cost, audit, latency, hosting policy) and ask for the architecture or runtime. Pick the simplest design that meets them, keep hard rules in code, and match the runtime to the binding constraint. Distractors add agents or subagents for fixed paths, split dependent steps, trust model-written explanations as audit, or pick a runtime that breaks a stated policy.

Check your understanding

Question 1

Every product listing goes through the same three steps in the same order. Which design fits?

Show answer

Answer: B. The path is known in advance, so code should sequence it.

Question 2

Two subagents edited the same file in conflicting ways, and a third returned 40 pages of notes. What fixes both?

Show answer

Answer: D. Clear boundaries prevent conflicts; a compact result protects the orchestrator's context.

Question 3

Policy requires agent code execution inside the company network, with its own images and logging. Where should the agent run?

Show answer

Answer: A. The hosting policy is the binding constraint, so the team keeps control of the environment.

Apply it: Design Juniper's support architecture

Exercise · about 20 minCase: Juniper Outdoor Co.

Juniper's order-support agent handles order lookups, returns, refunds and product questions. Refunds over $250 need a supervisor, every refund must be logged, and 40,000 reviews must be classified each night.

  1. Split the traffic into what a workflow handles and what needs an agent.
  2. Place the controls for the refund threshold and the refund log.
  3. Choose the design for the review classifier and justify it.
  4. Choose the runtime for the support agent, given the team runs its own servers.
    Done when: every rule is enforced in code and each choice names its deciding constraint.
Check your work
Show model answer

1. Order-status and simple return questions follow fixed paths (look up, explain, start return), so a router can send them into short workflows. Mixed or unclear requests ("my order arrived damaged and I want a different size") go to the agent, which chooses tools as it learns more.

2. The refund tool (or a PreToolUse hook) checks the amount and requires a supervisor approval token above $250; the harness writes a log entry with order number, amount and approver after every refund call. The prompt explains the policy but does not enforce it.

3. A batch workflow: one classification call per review through the Message Batches API at night, with counts aggregated in code. The results are not needed until morning, so batch halves the cost and no agent is needed.

4. A self-hosted Agent SDK harness on Juniper's servers: the team already runs the agent there and needs access to internal order systems. Claude Managed Agents would fit if they wanted hosted, sandboxed sessions without running servers.

Key termsAgentAudit logClaude Managed AgentsContext windowHandoffOrchestratorPrompt chainingSandboxing

Sources