Share via

Sequential workflow in Foundry — how to show only the final agent's response in Teams/Copilot?

Benoit Lalonde 20 Reputation points
2026-04-23T18:55:26.5033333+00:00

Hi everyone,

I've built a sequential multi-agent workflow in Microsoft Azure AI Foundry that is published to Teams/Copilot via an Azure Bot Service. The workflow works correctly and produces quality outputs, but I'm facing a display issue I can't resolve.

What I'm trying to achieve

I want only the final agent's response to be displayed to the end user in Teams/Copilot. The outputs of the intermediate agents should remain internal to the workflow.

My workflow structure

My workflow structure

Three sequential agents:

  • Agent 1 : connected to an Azure AI Search tool (index #1), returns a JSON output (with strict JSON schema enforced)
  • Agent 2 : connected to an Azure AI Search tool (index #2), returns a JSON output (with strict JSON schema enforced)
  • Agent 3 : no tools, returns plain text formatted for the end user
yamlkind: workflow
trigger:
  kind: OnConversationStart
  id: trigger_wf
  actions:
    - kind: InvokeAzureAgent
      id: agent_1
      agent:
        name: first-agent
      conversationId: =System.ConversationId
      input:
        messages: =System.LastMessage.Text
      output:
        autoSend: false
        responseObject: Local.agent_1_output
    
    - kind: InvokeAzureAgent
      id: agent_2
      agent:
        name: second-agent
      conversationId: =System.ConversationId
      input:
        messages: =Local.agent_1_output
      output:
        autoSend: false
        responseObject: Local.agent_2_output
    
    - kind: InvokeAzureAgent
      id: agent_3
      agent:
        name: third-agent
      conversationId: =System.ConversationId
      input:
        messages: =Local.agent_2_output
      output:
        autoSend: true
    
    - kind: EndConversation
      id: node-end

What's happening

Despite having autoSend: false on the first two agents, all three agents' outputs appear in the Teams/Copilot conversation. The user sees:

  1. The raw JSON output of agent 1
  2. The raw JSON output of agent 2
  3. The final formatted text of agent 3

Sometimes the final response is also duplicated 2-3 times.

What I've already tried

  • Setting autoSend: false on agents 1 and 2 → no effect
  • Adding a 4th normalizer agent with plain text output → intermediate outputs still visible
  • Using a "Send message" node after agent 3 with a local variable → intermediate outputs still visible
  • Changing conversationId of intermediate agents to a local variable → broke the workflow because agents lose access to the input
  • Disabling the "Include agent response in workflow conversation" toggle on each agent in the visual editor → no effect (documentation says this toggle has no impact when conversationId matches the workflow conversation)

My questions

  1. Is there a way to prevent intermediate agents from displaying their outputs in Teams/Copilot, while still keeping their outputs accessible as variables for downstream agents?
  2. Is it expected behavior that all agent outputs are shown to the end user in a sequential workflow, regardless of autoSend setting?
  3. Is the only viable solution to wrap the workflow in custom code (Azure Function) that filters the events stream as shown in the Python SDK samples?
  4. Is there a setting somewhere (workflow-level, bot service level, or Teams channel level) that controls which agents' outputs are visible to the end user?

Any guidance would be much appreciated. Thanks!

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


Answer accepted by question author

Karnam Venkata Rajeswari 3,655 Reputation points Microsoft External Staff Moderator
2026-04-26T10:15:21.2+00:00

Hello @Benoit Lalonde ,

Welcome to Microsoft Q&A .Thank you for reaching out to us.

The behavior observed aligns with how multi-agent workflows function when executed within a shared conversation context. In sequential workflows, each agent processes input and contributes output to the same conversation stream, which is then rendered by the client interface such as Teams or Copilot.

When multiple agents operate using a common conversationId, the conversation maintains continuity across steps. This allows downstream agents to receive prior outputs as context, which is essential for chaining logic and building a coherent final response. However, this shared context also results in intermediate outputs being included in the activity stream.

Although autoSend: false is configured for certain steps, this setting primarily controls whether a workflow step explicitly emits a message, but it does not guarantee suppression of all outputs from appearing in the conversation. Since the conversation is shared and activity events are streamed through the bot runtime, intermediate outputs may still be surfaced.

It is important to clarify that there is currently no workflow-only configuration that ensures intermediate agent outputs remain completely hidden while retaining a shared conversation context. This behavior is tied to how conversation history persisted and rendered as part of the workflow execution model.

Please check if the following workarounds help -

  1. Introducing filtering at the bot layer - A middleware layer can be added in the bot pipeline to control which activities are passed to the client.
    1. Middleware processes every incoming and outgoing activity in the conversation pipeline
    2. It enables inspection and modification of messages before they are rendered
    3. Filtering can be applied based on:
      • Agent identity
      • Message metadata or structure
    4. Only the final agent response can be allowed to pass through while suppressing intermediate outputs
  2. Using external orchestration - Instead of relying on conversation-bound workflows
    1. Execute intermediate agents outside the client-facing conversation
    2. Pass outputs internally between agents
    3. Send only the final response back to the user interface
  3. Applying limited workflow adjustments - This may reduce visibility but does not guarantee suppression in all cases.
    1. Enable autoSend only for the final agent
    2. Keep intermediate outputs as structured data rather than conversational messages

The following references might be helpful , please check them out

Thank you

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-04-23T18:55:48.25+00:00

    Foundry sequential workflows and Agent Framework workflows are designed so that each agent’s output becomes part of the shared conversation context. In the provided context, there is no documented mechanism to selectively hide intermediate agent messages from the end user when the workflow is invoked directly as a Foundry workflow and surfaced via Bot Service/Teams.

    Key points from the context:

    • Sequential workflows in Foundry and Agent Framework use a shared conversation model: each participant (agent or executor) receives and appends to the same conversation history, and that conversation is what the user sees.
    • In the Agent Framework sequential orchestration, “Each agent/executor appends to the conversation, building a complete dialogue,” and the shared context is what flows through the pipeline.
    • The Foundry workflow guidance for sequential patterns focuses on orchestration and variable passing, not on per-agent visibility control. The documented behavior is that the workflow passes results from one agent to the next in order and the user interacts with the workflow as a whole.
    • The context does not document any workflow-level, Bot Service–level, or Teams-level setting that filters which agents’ messages are visible when using a Foundry workflow as the backing logic.

    Given only the information in the context:

    1. There is no documented way in Foundry’s workflow model to keep intermediate agents’ outputs available as variables while hiding them from the user when the workflow is surfaced directly to Teams/Copilot.
    2. The documented model for sequential workflows assumes that agents contribute to a shared conversation; the context does not describe autoSend or any other setting as a supported way to suppress intermediate messages in this scenario.
    3. The context does show that when using the Agent Framework directly (for example, from .NET MAUI or Python), it is possible to control what is shown to the user by consuming streaming/non-streaming events and deciding what to render in the UI. That pattern aligns with wrapping the workflow in custom code that filters events and only surfaces the final agent’s output.
    4. No setting is documented at workflow, bot, or Teams level that controls per-agent visibility of outputs for Foundry workflows.

    Within the scope of the provided documentation, the only clearly supported way to show only the final response to end users is to host the workflow behind custom code (for example, using Agent Framework clients) and render only the final agent’s output in the channel UI.


    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.