Problem
Dynamic Workflows registers the Durable orchestrator and Activities only when at least one agent has workflows.enabled: true. If the final workflow-enabled agent is removed, app composition returns to a plain FunctionApp and no longer registers those Durable Functions.
An existing orchestration may still have a queued but unexecuted Activity work item. After the final agent is removed, there is no registered Activity Function to receive that item, so the instance cannot reach the runtime's deployed-policy reauthorization boundary and fail explicitly. It may remain non-terminal in the Task Hub.
This differs from removing one of several workflow-enabled agents: the shared Durable runtime remains registered, so pending Activities for the removed agent execute and fail closed because its policy is absent.
Why this is not addressed with an application setting
PR #151 briefly introduced AZURE_FUNCTIONS_AGENTS_WORKFLOW_DRAIN_MODE to retain the Durable runtime with an empty policy catalog while blocking new application-level starts. After offline design review, we decided not to publish this customer-facing environment variable:
- this is an edge-case deployment lifecycle concern;
- a public operational switch would become a compatibility commitment once released;
- correct ownership may belong in Durable/runtime lifecycle semantics rather than the agent authoring surface;
- an application-level switch cannot guard privileged direct Durable control-plane starts and still requires external Task Hub inspection.
The setting and its implementation are being removed before release.
Desired outcome
Define the supported lifecycle and remediation for removing the final workflow-enabled agent while non-terminal instances may exist. Options to investigate include:
- Durable/runtime support for retiring orchestrators and Activities without stranding queued work.
- A deployment-time or Task Hub-aware mechanism that detects non-terminal instances before Durable Functions are unregistered.
- A runtime-managed tombstone/drain behavior that is not exposed as a permanent customer authoring or environment-variable contract.
- Explicitly documented operator behavior if this must remain an unsupported transition.
Acceptance criteria
- The owner of the behavior (agent runtime versus Durable Functions/Durable Task Scheduler) is identified.
- The final-agent removal sequence has defined behavior for queued Activities and non-terminal orchestrations.
- Existing instances either reach a terminal state or operators receive an actionable, supported remediation path.
- Ordinary apps with no workflow-enabled agents continue to avoid unnecessary Durable registration overhead.
- Any public surface is reviewed as a long-term compatibility commitment before release.
Reproduction scenario
- Deploy one workflow-enabled agent and start a workflow containing a capability-bearing Activity.
- Ensure the Activity work item is queued but has not executed.
- Deploy a version with no workflow-enabled agents.
- Observe that the app is now a plain
FunctionApp and the workflow orchestrator/Activities are absent.
- Observe whether the queued instance remains non-terminal because no Activity Function can receive the work item.
Problem
Dynamic Workflows registers the Durable orchestrator and Activities only when at least one agent has
workflows.enabled: true. If the final workflow-enabled agent is removed, app composition returns to a plainFunctionAppand no longer registers those Durable Functions.An existing orchestration may still have a queued but unexecuted Activity work item. After the final agent is removed, there is no registered Activity Function to receive that item, so the instance cannot reach the runtime's deployed-policy reauthorization boundary and fail explicitly. It may remain non-terminal in the Task Hub.
This differs from removing one of several workflow-enabled agents: the shared Durable runtime remains registered, so pending Activities for the removed agent execute and fail closed because its policy is absent.
Why this is not addressed with an application setting
PR #151 briefly introduced
AZURE_FUNCTIONS_AGENTS_WORKFLOW_DRAIN_MODEto retain the Durable runtime with an empty policy catalog while blocking new application-level starts. After offline design review, we decided not to publish this customer-facing environment variable:The setting and its implementation are being removed before release.
Desired outcome
Define the supported lifecycle and remediation for removing the final workflow-enabled agent while non-terminal instances may exist. Options to investigate include:
Acceptance criteria
Reproduction scenario
FunctionAppand the workflow orchestrator/Activities are absent.