Hosted agents in Azure AI Foundry must be invoked through their dedicated agent endpoint, not through the generic project/application endpoints used by prompt-based agents. The error message
"Hosted agents can only be called through the agent endpoint"
indicates that the workflow is attempting to call the hosted agent as if it were a prompt/workflow agent (via an application-style endpoint), instead of using the hosted agent’s own endpoint.
From the available information:
- Hosted agents are invoked via their own agent endpoint and do not require publishing for programmatic access:
- Responses:
{project_endpoint}/agents/{name}/endpoint/protocols/openai/responses
- Invocations:
{project_endpoint}/agents/{name}/endpoint/protocols/invocations
- Invocations (WebSocket):
.../invocations_ws (preview, region-limited)
- Hosted agents are containerized applications with their own lifecycle and identity, distinct from prompt-based agents and Agent Applications. Publishing an Agent Application and invoking it via the application endpoint is a different model than invoking a hosted agent.
Given the behavior described (agent works in Playground and via SDK, but fails only when used in a Workflow agent node), the workflow engine is likely trying to use an application-style agent invocation rather than the hosted agent endpoint, which triggers the error.
Based on the context:
- Are Hosted Agents currently supported as Agent nodes inside Foundry Workflows?
The provided documentation describes hosted agents, their endpoints, and how to invoke them directly (via SDK or HTTP) but does not describe using hosted agents as Workflow agent nodes. The error message and the lack of workflow-specific hosted-agent guidance in the context indicate that workflows are not (from this documentation) a supported or documented integration path for hosted agents as agent nodes.
- Additional deployment/endpoint/A2A/publishing requirements?
For hosted agents:
- Deploy the container image as a hosted agent version.
- Ensure the version status is
active before invoking.
- Use the hosted agent’s own endpoint (Responses or Invocations) for calls.
No additional publishing is required for programmatic access, and there is no documented requirement in the context for A2A or special publishing steps to make a hosted agent callable from workflows.
- Does the Workflow automatically invoke the Responses Protocol endpoint, or is additional configuration required?
The context only documents direct invocation patterns (SDK/OpenAI-compatible client or HTTP) against the hosted agent endpoint. It does not describe any workflow configuration that binds an agent node to a hosted agent’s Responses endpoint, nor any setting to switch an agent node from application-style invocation to hosted-agent endpoint invocation.
- Is this a known limitation or issue with Hosted Agent integration in Workflows?
The context does not list this specific error as a troubleshooting item, but it does clearly distinguish:
- Hosted agents: invoked via
{project_endpoint}/agents/{name}/endpoint/... and do not require publishing for programmatic access.
- Agent Applications / prompt-based agents: invoked via application endpoints and publishing flows.
The error text itself (“Hosted agents can only be called through the agent endpoint”) reflects this boundary and effectively describes a limitation: hosted agents must be called via their dedicated agent endpoint, not via the mechanism the workflow is currently using.
Actionable guidance from the available documentation:
- Continue invoking the hosted agent via:
- The SDK (
project.get_openai_client(agent_name="<hosted-agent-name>") then responses.create(...)), or
- Direct HTTP calls to the hosted agent’s Responses or Invocations endpoint.
- For workflow-style orchestration, model the call to the hosted agent as an HTTP/API call (if/when such a node type is available) targeting the hosted agent endpoint, rather than as a generic “Agent” node that expects a prompt-based or application-style agent.
The context does not provide a supported, documented way to configure a Foundry Workflow “Agent” node to correctly target a hosted agent endpoint, so the behavior observed aligns with the documented separation between hosted agents and application-style agents.
References: