Azure AI Foundry Workflow fails when invoking Hosted Agent with error "Hosted agents can only be called through the agent endpoint"

Rihan Mohamed 0 Reputation points
2026-06-15T07:46:32.0766667+00:00

I am testing Azure AI Foundry Workflows with a Hosted Agent and am seeing a runtime error when the workflow attempts to invoke the agent.

Environment


  • Azure AI Foundry
  • Agent Type: Hosted Agent
  • Agent Status: Running
  • Responses Protocol Endpoint: Active

What works


  • The Hosted Agent works correctly in the Playground.
  • The agent responds successfully to prompts.
  • The agent has been published.
  • The Responses Protocol endpoint is active.

Workflow Configuration


Simple workflow:

Start -> Agent Node

Agent node settings:

  • Conversation Context = System.ConversationId
  • Input Message = System.LastMessage.Text
  • Automatically include agent response as part of workflow conversation = Enabled
  • Save agent output message to a local variable

What happens


When the workflow runs, execution fails immediately when invoking the Hosted Agent.

Error returned:

"Hosted agents can only be called through the agent endpoint"

The workflow trace also shows:

"Error invoking agent"

and

"type":"invalid_request_error"

Troubleshooting already performed


  1. Verified the agent works in Playground.
  2. Verified the Responses Protocol endpoint is Active.
  3. Re-published the agent.
  4. Created a brand-new workflow with only: Start -> Agent
  5. Removed and re-added the Agent node.
  6. Confirmed the workflow is using the latest published agent version.

Result:

The same error occurs consistently.

Additional Observation


The Hosted Agent can be invoked successfully through the Azure AI Foundry SDK sample generated by Foundry using the Responses API and session APIs.

This suggests:

  • The Hosted Agent itself is healthy.
  • The endpoint is functional.
  • The failure appears to occur specifically when a Foundry Workflow attempts to invoke the Hosted Agent.

Questions


  1. Are Hosted Agents currently supported as Agent nodes inside Foundry Workflows?
  2. Are there any additional deployment, endpoint, A2A, or publishing requirements before a Hosted Agent can be used in a Workflow?
  3. Does the Workflow automatically invoke the Responses Protocol endpoint, or is additional configuration required?
  4. Is this a known limitation or issue with Hosted Agent integration in Workflows?

Any guidance would be appreciated.

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Rihan Mohamed 0 Reputation points
    2026-06-15T08:00:34.69+00:00

    Thanks for the clarification.

    Could you please confirm whether Hosted Agents are currently supported as Agent nodes in Azure AI Foundry Workflows?

    My Hosted Agent works in Playground and through the SDK, but fails when called from a Workflow with the error:

    "Hosted agents can only be called through the agent endpoint"

    Is this a supported scenario, or should Hosted Agents only be invoked through their Responses/Invocations endpoints?

    Thank you.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-06-15T07:46:56.43+00:00

    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:

    1. 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)
    2. 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:

    1. 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.
    2. 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.
    3. 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.
    4. 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:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.