Skip to content
中文
← PostsAfter Calling a Workflow Tool, the Agent Still Ran the Old Steps Again

After Calling a Workflow Tool, the Agent Still Ran the Old Steps Again

Across ~10,000 agent scenarios in 110 countries, Maersk extracted fixed actions into tools and kept only decision tables in text. Updating a Skill also requires scrubbing referenced docs, error branches, and verifying against call logs.

2026年12月3日·841 words·4 min readRead Chinese original
After wrapping actions into a workflow tool, remove duplicate steps from old instructions

Maersk’s engineers wrapped a business workflow that agents executed repeatedly into a tool. On the first rollout, performance got worse. The old instructions still listed the step names handled inside the tool, so after calling the tool, the agent followed the instructions and ran those same steps again.

This is a case Dmitry Buykin shared in his 2026 AI Engineer Code Summit talk. Their system runs across 110 countries and roughly 10,000 scenarios, with about three-quarters of it written as natural language instructions. The tool wrapper only started working properly after they stripped the operational steps out of the old instructions and left only the rules that required judgment.

When code changes and prompt changes are reviewed separately, it is hard to spot this duplication. The tool code passes its unit tests, and the old instructions look fine on their own. At runtime, however, the model cannot tell which steps have already moved into the tool. As long as those steps remain in the text, the model will call the tool and then repeat them anyway.

Once steps move into a tool, the corresponding operational instructions must be removed from the prompt, leaving only the decision rules for the model.

Extract Fixed Workflows into Tools, Keep Changing Rules in Text

Deleting a few background paragraphs or trimming the instruction file down to a few dozen lines does not solve this. As long as a sentence in the body tells the model to perform the old steps, duplicate calls will still happen.

Maersk did not wipe out the natural language layer altogether. They inspected actual production execution paths first, then extracted the segments that stayed consistent and recurred across countries into workflow tools. Rules that still varied by country and needed frequent adjustments stayed in text.

After wrapping the workflow, code handled gathering facts and executing actions, while domain experts maintained a decision table. The model only picked which row applied, and escalated to a human when no rule matched. Because domain experts could not read complex expressions in code, the team even moved hundreds of lines of logic out of code and back into text rules.

Remove wrapped operational steps from the Skill and keep only the business decision table for the model

Take a simplified order instruction as an example. Suppose the original prompt read: “Read the order, calculate the total, and decide whether to approve based on the amount rules.” Later, a developer wraps the first two steps into a preparation tool. The instruction should be rewritten to call the preparation tool first and check the returned total against the amount rules—the earlier steps for reading the order and calculating the total must be deleted outright.

Easy-to-Miss Details When Cleaning Old Instructions and Verifying

In a real project, editing the main file alone is not enough. Even if SKILL.md has been updated to call the tool, any referenced docs or examples that still describe the old flow—combined with a line like “see the reference doc for detailed steps”—will send the model right back to manual execution.

When updating instructions, separate implementation notes from execution commands. Writing “the tool updates the order status internally” explains what the tool does and causes no harm. Writing “after calling the tool, update the order status” turns it into a next step the model tries to run itself.

Do not rely on adding “do not execute this manually anymore” in front of old steps either. Based on Dmitry’s experience in the talk, telling a model “do not call X” can actually remind it that X exists. Deleting those lines completely is safer.

Post-call branches need to be updated at the same time. When the tool succeeds, only instruct the model to check the business rules against the return value, rather than listing steps the tool already ran internally.

If the tool fails halfway through, handle retries or human escalation based on the returned status. Never leave a fallback like “if it fails, rerun using the old steps,” or the model will revert to the legacy flow.

After making the edits, do not verify by checking only the final output. If the wrapped step is a data lookup, the tool queries it once and the model queries it again from the old prompt, returning identical data—looking at the final answer alone will hide the bug. Swap that lookup for a database write or a notification, and the extra pass immediately creates dirty data or duplicate alerts.

To verify the cleanup, inspect the call logs of a real task and check what the model requests right after the tool returns. Reading a record again after modifying it to confirm its state is a normal check. If the model immediately reads or writes with the exact same parameters right after the tool finishes, stale instructions are still lurking somewhere.

Next time you extract an agent workflow into a tool, do not open a PR after only testing the tool code. List every action the new tool covers, grep through SKILL.md, its referenced docs, and its error branches for those old steps, remove them cleanly, and review everything in the same PR.

Copyright

Author
XingKaiXin
Title
After Calling a Workflow Tool, the Agent Still Ran the Old Steps Again
Published
2026年12月3日

Licensed under CC BY-NC-ND 4.0 DEED.

XingKaiXinXingKaiXin

Stamp book

0 / 10
  • 初来乍到Visit for the first time
  • 颠倒世界Flip the world once
  • 手不释卷Read a post to the end
  • 愿者上钩Fish something out of the pond
  • 余音绕梁Play the record to the end
  • 手下留情Pinch Kaixin's cheek
  • 暗房一游See the photos in the darkroom
  • 误入歧途Find a page that doesn't exist
  • 夜深人静Drop by late at night
  • 终端潜行Successfully run cat or mcp call in the Agent shell

Stamps are kept only in this browser