Getting Started & Migration
What pattern should I follow to wrap existing agent logic in durable steps without altering the core business logic or its unit tests?
Use an adapter function that receives the existing agent’s input, calls the original logic, and returns its output, while Catalyst manages the durable lifecycle around it. This thin wrapper keeps business code untouched, so existing tests remain valid. Add separate tests for the wrapper’s integration with Catalyst. Beware that if the original logic has hidden non-determinism (e.g., direct LLM calls with timestamps), the replay may diverge, requiring you to refactor those calls into idempotent steps.
Was this article helpful?
Your feedback helps improve Diagrid's FAQ experience.
Keep reading
More Diagrid FAQ articles
- Getting Started & Migration
What does a minimal but realistic durable agent look like when I first run Catalyst locally?
A realistic durable agent prototype that progresses from a call to an LLM through a conditional action to an API, illustrating automatic state persistence.
- Getting Started & Migration
How do I iterate quickly on durable agent logic without deploying to a shared cluster?
Use a local Dapr sidecar to execute and debug agent workflows, enabling a fast edit-run-debug cycle without remote dependencies.
- Getting Started & Migration
My agent is already built with LangChain/LlamaIndex. Can I add durable execution without a rewrite?
Wrap an existing agent’s entry point in a Catalyst workflow to gain durability without modifying framework internals, then progressively refactor.