Repository navigation
[Async stack 5/6] Functions async orchestration support - #363
Draft
andystaples wants to merge 7 commits into
Draft
andystaples wants to merge 7 commits into
andystaples wants to merge 7 commits into
Conversation
andystaples
marked this pull request as draft
November 12, 2026 16:30
andystaples
force-pushed
the
andystaples-async-stack-5-functions-support
branch
from
November 12, 2026 16:48
4ebbc8b to
a35936b
Compare
andystaples
force-pushed
the
andystaples-async-stack-5-functions-support
branch
from
November 12, 2026 18:57
a35936b to
f9ae519
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
andystaples
force-pushed
the
andystaples-async-stack-5-functions-support
branch
from
November 12, 2026 21:02
f9ae519 to
69872f1
Compare
…stack-5-functions-support Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…stack-5-functions-support Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…stack-5-functions-support Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…stack-5-functions-support Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…stack-5-functions-support Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ttp helper Remove AsyncDurableOrchestrationContext. Single-parameter async def orchestrators now fail with TypeError when decorated or registered, pointing to the two-parameter AsyncOrchestrationContext shape. Add azure.durable_functions.call_http for durabletask orchestration contexts. It returns a cold coroutine for AsyncOrchestrationContext and an eager task for OrchestrationContext, and shares the existing durable HTTP implementation with DurableOrchestrationContext.call_http. Restore the generator-only orchestrator_generator_wrapper testing helper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
This PR is part of a review-only stack and must not be merged individually. The whole stack will be squash-merged after every PR in it is approved.
Summary
Adds
async deforchestrator support to the Azure Functions Durable provider using the same shape as the core SDK and Durable Task Scheduler provider:async def orchestrator(ctx: task.AsyncOrchestrationContext, input). The second argument is the orchestration input.Async orchestrators
async deforchestrators pass straight through to the core worker, which suppliestask.AsyncOrchestrationContext. This works throughDFApp/Blueprint.orchestration_trigger,Orchestrator.create, andDurableFunctionsWorker.async deforchestrators are not supported.orchestration_triggerandOrchestrator.createraiseTypeErrorat decoration time, and the worker raises it before registration. The message points to the two-parameter shape. The function is inspected only, so no coroutine is created.DurableOrchestrationContextorchestrators remain generator or regular functions with unchanged behavior, includingtask_all/task_any.df.call_httpazure.durable_functions.call_http(ctx, method, uri, *, content, headers, token_source, is_raw_str, retry_options). It returns aDurableHttpResponse.task.AsyncOrchestrationContext, it returns a cold coroutine: validation, serialization, and scheduling happen when the coroutine starts. Withtask.OrchestrationContext, it schedules immediately and returns aTasktoyield. Other context types raiseTypeError.DurableOrchestrationContext.call_http: the built-in HTTP activity, 202/Location polling sub-orchestration,HttpRetryOptions, and token sources. The compat method's behavior is unchanged.Typing
FunctionsOrchestratorcoverstask.Orchestrator(sync and two-parameter async) plus single-parameterDurableOrchestrationContextcallables. The decorators and worker use it.Limitations
orchestrator_generator_wrappertesting helper drives generator orchestrators only. Test async orchestrators with the replay executor, a provider, or the in-memory backend.Tests
call_httpfor v1, eager, and async contexts (success, 202 polling, retry failure, cold validation, content encoding).as_task_context()+task.when_anyrace, and asynccall_httpprobes, whichtest_coroutine_e2e.pyruns against a real Functions host.call_httpoverloads and orchestrator registration.Layer 6 contains the release-facing docs (READMEs, migration guide, changelogs). This PR contains no version bumps.