AI Engineering
/
Tool Calling & Agents
/

Choose a fixed workflow or an agent loop

Tool Calling & Agents · 2 to 3 hours

Choose a fixed workflow or an agent loop

Compare a fixed workflow and an agent loop for a parcel-delivery assistant's rescheduling and stuck-parcel tasks using a pilot's success, cost, and latency figures, then recommend a design per task and say what would change it.

Medium
Conceptual

Conceptual comparison

3 h

Step 1: The question

The parcel company's team asks whether each assistant task should run as a fixed workflow or as an agent loop. Using the scenario and the pilot results, state each task's goal and constraints, compare both designs for each task on the same dimensions with the pilot's figures, and recommend a design per task. Then name the evidence you still lack and the changes that would reverse each recommendation.

Scenario: a parcel-delivery assistant

Suppose a parcel-delivery company runs a chat assistant on its website. The company, its tools, and every figure in this question are fictional. For each of two tasks, the team built both a fixed workflow and an agent loop. Both designs use the same model, tools, and argument validation; only the control flow differs.

Task A: reschedule a delivery. A customer gives a tracking number and asks for another day. A parcel can be rescheduled only while it is at a depot (not out for delivery, delivered, or held at customs). A rebook is a write: a wrong one sends a driver on the wrong day.

ToolWhat it does
verify_customerChecks the tracking number against the postcode the customer gives
get_shipmentReturns the parcel's state and depot
list_slotsReturns open delivery slots for a day
rebook_deliveryMoves the delivery to a slot (write)
  • Workflow A. The model extracts the tracking number, postcode, and preferred day into validated JSON (one repair attempt). Code verifies the customer, reads the shipment, checks that its state allows rescheduling, and lists slots. The customer picks and confirms a slot with buttons; code rebooks, and the model writes the confirmation from the result. Anything outside this path, such as a redirect to a neighbor, goes to a person.
  • Agent A. The model receives the four tools and instructions that include "verify the customer first" and "confirm the slot with the customer before rebooking". The executor validates arguments and rejects get_shipment, list_slots, and rebook_delivery until verify_customer has succeeded. Cap: 10 model calls, then a hand-off.

Task B: explain why a parcel is stuck. The customer asks why tracking has not moved. The reply must name the cause and the next step and cite the records it used. Every Task B tool is read-only.

ToolWhat it returns
get_tracking_eventsThe public tracking history
get_depot_scansInternal scans at each depot
get_carrier_notesFree-text notes from drivers and partner carriers
get_customs_statusCustoms holds and missing documents
get_partner_trackingA partner carrier's history, given the partner reference found in a carrier note
check_addressWhether the address failed validation at the depot
  • Workflow B. Code calls the first four tools in parallel, and one model call writes the explanation from their results (one repair attempt if the reply fails its format check). Code checks that every cause the reply cites comes from a fetched record; when that check fails or the model finds no record that explains the hold, the conversation goes to a person.
  • Agent B. The model receives all six tools and chooses which to call and in what order. Code applies the same cited-record check to its reply. Cap: 12 model calls, then a hand-off.

Product constraints

ConstraintTask ATask B
Conversations per day6,0002,000
p95 processing time target (excluding customer wait)8 s20 s
Writesrebook_delivery; no wrong rebooks allowedNone

Model spend for both tasks together must stay at or below $100 per day. Prices: $1.00 per million input tokens and $3.00 per million output tokens. Each conversation a person has to finish costs $2.50 of staff time.

Pilot results

The team labeled 200 recent conversations per task with the correct outcome. Each design ran every case three times (600 runs per design), and a reviewer graded every run's outcome against its label and read every trace.

  • Successful: the labeled outcome without a person. Task A: the confirmed slot is booked, or the assistant correctly says the parcel cannot be rescheduled and why. Task B: the right cause and next step, with the records cited.
  • Wrong outcome: the assistant finished, but the outcome was wrong.
  • Handed off: the assistant passed the conversation to a person, including every run that hit the cap.

Every unsuccessful run, wrong or handed off, ends with a person finishing the conversation.

Measure (600 runs per design)Workflow AAgent AWorkflow BAgent B
Successful runs582570426516
Wrong outcomes035430
Handed off182712054
Cases successful in all 3 runs (of 200)192176136158
Model calls per run, mean / p952.1 / 35.4 / 91.2 / 24.6 / 10
Mean input tokens per run3,00016,0009,00021,000
Mean output tokens per run3009004001,100
p95 processing time4.1 s11.8 s5.2 s17.5 s
Runs that hit the capn/a6n/a12
Runs with a wrong or unnecessary tool calln/a (code picks every call)41n/a (code picks every call)48

Trace notes:

  • Agent A: in 9 runs (included in the 41) the model called rebook_delivery before verify_customer; the executor rejected each call and the run continued. All 3 wrong outcomes booked a slot the customer had not confirmed.
  • Workflow A: the 18 hand-offs were requests outside the path (redirects, two parcels in one message) and extractions that still failed after the repair.
  • Workflow B: each of its 54 wrong outcomes cited a real fetched record, but not the record that explained the hold.
  • Agent B: the cap hits alternated between get_depot_scans and get_carrier_notes without new information.

Task B by case type (successful runs; each case ran 3 times)

Case typeCasesRunsWorkflow B successfulAgent B successful
Depot backlog80240228216
Customs hold50150138132
Partner carrier handover401203696
Address problem30902472

Constraints

  • Use only the scenario, prices, and pilot figures shown; all of them are fictional
  • Both designs share the model, tools, and argument validation; only the control flow differs
  • Work the figures first, then present in about five minutes, quoting the figures that decide each task

Deliverables

  • Each task's goal and binding constraints
  • A comparison of both designs for each task on the same dimensions
  • Cost per successful run, daily cost including conversations a person finishes, and the latency and budget checks
  • A recommendation per task with the figures behind it and the evidence still missing
  • What would change each recommendation

Step 2: Hints

Optional. Each hint gives a little more away.

Step 3: Your answer

Kept in this browser. Saving your score below keeps a copy with it.

0 / 5000

Step 4: Reference answer

Step 5: Score yourself

Score each dimension 0, 1, or 2, then save the score to your history. Readiness thresholds are editorial estimates.

Grades your written answer against this rubric with your own AI provider key from Settings. It is a second opinion: the score you save is still yours.

Goals and constraints

What earns a 2: States each task's correct outcome, whether it ends in a write, its latency target, and the shared budget before comparing designs.

Same-dimension comparison

What earns a 2: Compares both designs for each task on the same rows (for example who picks the next step and its limits, cost, latency, failure modes, controls in code, and testing) using the pilot's figures.

Pilot arithmetic

What earns a 2: Shows cost per run, cost per successful run, daily model and handling cost, consistency across the three runs, and the per-slice rates from the stated prices and counts.

Decision and evidence

What earns a 2: Recommends a design per task tied to named figures, explains the cause of each failure class before weighing it, and names the evidence still missing.

What would change the decision

What earns a 2: For each changed constraint, re-checks the affected figures and says whether each task's recommendation holds, and why.

0 of 10 · Scored 0 of 5 dimensions

Ready at 8 of 10, with no 0 in Same-dimension comparison or Decision and evidence

Kept in this browser until you sign up, then it moves to your account.

Complete this level when you can turn a two-design pilot into cost per successful task and a daily total, compare the designs task by task on the same dimensions, and say which changes would reverse your choice.

Your saved scores

Practice saves and mock interview answers on this question, newest first.

No saved scores yet. Score every dimension, then save.

Step 6: Follow-up questions

An interviewer may ask these next.

What makes a design an agent loop rather than a fixed workflow?

Why compare cost per successful task instead of cost per run?

Why run every pilot case more than once?

How do you grade an agent run without requiring one exact tool sequence?

Where do required steps and approvals live in a fixed workflow and in an agent loop?

Step 7: Mark complete