Title: Allow Azure Functions Durable 2.x apps to opt in to JsonDataConverter · Issue #249 · microsoft/durabletask-python · GitHub
Open Graph Title: Allow Azure Functions Durable 2.x apps to opt in to JsonDataConverter · Issue #249 · microsoft/durabletask-python
X Title: Allow Azure Functions Durable 2.x apps to opt in to JsonDataConverter · Issue #249 · microsoft/durabletask-python
Description: Summary Add an app-wide opt-in for new azure-functions-durable 2.x applications to use durabletask.serialization.JsonDataConverter instead of the default Functions-compatible converter. Proposed usage: from durabletask.serialization impo...
Open Graph Description: Summary Add an app-wide opt-in for new azure-functions-durable 2.x applications to use durabletask.serialization.JsonDataConverter instead of the default Functions-compatible converter. Proposed us...
X Description: Summary Add an app-wide opt-in for new azure-functions-durable 2.x applications to use durabletask.serialization.JsonDataConverter instead of the default Functions-compatible converter. Proposed us...
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/249
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow Azure Functions Durable 2.x apps to opt in to JsonDataConverter","articleBody":"## Summary\n\nAdd an app-wide opt-in for new `azure-functions-durable` 2.x applications to use `durabletask.serialization.JsonDataConverter` instead of the default Functions-compatible converter.\n\nProposed usage:\n\n```python\nfrom durabletask.serialization import JsonDataConverter\n\napp = df.DFApp(data_converter=JsonDataConverter())\n```\n\nKeep `FunctionsDataConverter` as the default for v1 compatibility.\n\n## Motivation\n\n`azure-functions-durable` 2.x is built on `durabletask`, but currently hardcodes `FunctionsDataConverter` across workers, bound clients, compatibility wrappers, testing helpers, and activity binding conversion. New durabletask-native applications should be able to select durabletask's plain-JSON, type-directed serialization model consistently across every payload boundary.\n\n## Design constraints\n\n- The setting must be function-app/process-wide, not per function or blueprint. Azure Functions uses one mutable binding-converter registry per Python worker process.\n- Blueprints can be constructed before `DFApp`, so workers created during decoration must observe the later app-level selection.\n- Activity input/output conversion happens in `ActivityTriggerConverter`, outside the durabletask worker pipeline. It must use the same converter as orchestrators, entities, and clients.\n- The Functions worker does not pass activity parameter types to converter `decode()`. Activity wrappers must retain the original resolved type hint and apply converter coercion after binding decode.\n- Only converters producing valid JSON are compatible with the activity binding wire contract. Initially restrict the option to `JsonDataConverter` subclasses or validate this contract explicitly.\n- Preserve the activity converter's existing raw-string fallback.\n- Conflicting app configurations in one process should fail immediately; repeated equivalent configuration should be idempotent.\n\nA process-wide delegating `DataConverter` proxy is one possible implementation. Existing workers and cached clients can retain the stable proxy while `DFApp` selects its delegate before invocation.\n\n## Compatibility and migration safety\n\nThis opt-in should be documented for new task hubs only.\n\nThe current Functions codec can emit custom-object envelopes containing `__class__`, `__module__`, and `__data__`. `JsonDataConverter` emits plain JSON and does not reconstruct those envelopes. Switching an existing task hub can therefore break orchestration replay and persisted entity state. Entities may be long-lived and cannot simply be allowed to drain.\n\nWhen the opt-in encounters a Functions custom-object envelope, it should fail loudly rather than silently returning the envelope as an ordinary dictionary.\n\nThe feature is primarily for durabletask-native authoring. V1-style activity calls that do not supply a result type may receive dictionaries for custom outputs under `JsonDataConverter`; document this limitation or provide an explicit typed path.\n\n## Implementation surfaces\n\n- `azure.durable_functions.decorators.DFApp` and `Blueprint`\n- `DurableFunctionsWorker`\n- `DurableFunctionsClient` and `SyncDurableFunctionsClient`, including the process-wide sync-client cache\n- `ActivityTriggerConverter`\n- v1 orchestration/entity compatibility contexts\n- entity testing helpers and other import-time converter captures\n- built-in scheduled-task, history-export, and Durable HTTP registrations\n- public documentation and `azure-functions-durable/CHANGELOG.md`\n\n## Acceptance criteria\n\n- `DFApp(data_converter=JsonDataConverter())` consistently applies the converter to client, orchestration, activity, entity, event, custom-status, and persisted-state payloads.\n- Existing apps without the option retain current serialization behavior.\n- Blueprints created before the app still use the selected converter.\n- Conflicting process-wide selections fail with a clear error.\n- Functions custom-object envelopes fail clearly under the opt-in.\n- Activity raw-string fallback remains supported.\n- Unit tests cover all serialization boundaries, compatibility wrappers, cached clients, configuration conflicts, and cross-format behavior.\n- An end-to-end test round-trips typed dataclasses through client, orchestrator, activity, and entity paths.\n- Documentation warns users to select the converter before creating data in a task hub and explains v1-style limitations.","author":{"url":"https://github.com/andystaples","@type":"Person","name":"andystaples"},"datePublished":"2026-07-30T21:52:54Z","url":"https://github.com/microsoft/durabletask-python/issues/249"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:248faf5e-cbaa-a660-d6bf-27a5a3a6018f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1BE:36768A:9691AA:D48B44:6AFE1E88 |
| html-safe-nonce | 6c8ef55ddaf3fceedb8fbcace8ebe60addf84a589ae34329343496bd4ccdbbae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUJFOjM2NzY4QTo5NjkxQUE6RDQ4QjQ0OjZBRkUxRTg4IiwidmlzaXRvcl9pZCI6IjM5NDU1MTYyNjAyMzc2NDc0OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4b30c60da0dfbb952fa0d7372dd7ea490913e77bf56d6ea4dd8742d7e3dedf59 |
| hovercard-subject-tag | issue:5024280444 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/durabletask-python/249/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3ede1e157b0af801e05476f3371150c99410055ea01f5cf3589621249ea1527c/microsoft/durabletask-python/issues/249 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3ede1e157b0af801e05476f3371150c99410055ea01f5cf3589621249ea1527c/microsoft/durabletask-python/issues/249 |
| og:image:alt | Summary Add an app-wide opt-in for new azure-functions-durable 2.x applications to use durabletask.serialization.JsonDataConverter instead of the default Functions-compatible converter. Proposed us... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andystaples |
| hostname | github.com |
| expected-hostname | github.com |
| None | d0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef3993a71fa20f7be8e167132fbf9619bc66e12 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width