API discovery: Pydantic AI’s public durable-execution change exposes the seam that a new workflow engine needs to implement. Instead of duplicating the framework’s orchestration, an adapter can use CallableOperationBackend when its SDK accepts a callback at invocation time, or RegisteredOperationBackend when handlers must exist before a worker starts. Both carry the same typed operation identity, naming, codec and configuration work around the engine-specific primitive.
Try it
Imagine an internal review agent that turns a long investigation into resumable stages: model request, evidence lookup, tool validation and a custom “write the findings” capability. A small adapter can begin with the documentation’s in-process callable backend, then replace its execute method with the workflow engine’s activity or task call. The benefit is not magic persistence; it is one place to preserve operation identity and serialization rules before retry logic meets a real side effect. Pydantic AI’s backend guide includes that minimal shape.
Copy-paste agent instruction
Build a minimal Pydantic AI durable-execution adapter for our chosen workflow engine. Start from CallableOperationBackend if the engine accepts an async callback per activity; otherwise explain why RegisteredOperationBackend is required. Keep model requests, tool calls and @durable_operation capability methods on the shared Pydantic AI operation path. Choose and document the codec, preserve stable operation names, and add a replay test for a failure after a side effect. Make the side effect idempotent or use a documented at-most-once engine guarantee. Work in a disposable environment and do not claim this public main-branch API is released or production-proven.
Test caveat
The source is public main-branch documentation and code, not a release guarantee or a tested adapter for your engine. The in-process example needs no credentials, but a real adapter needs its own access controls, serialization policy and recovery tests. The documentation is blunt about the hard part: a durable unit can run again after a failure, so a side effect must be idempotent unless the engine offers a suitable at-most-once mode.