Forum Discussion
Agent response duplicated in email
Hi,
I have created a Copilot Studio Flow which has 3 agents. 2 agents do some research in parallel, I catch the results in 2 different string variables and hand the variables over to a third agent. The third agent should merge both variables, format them and hand them over to "Send Email". In the email body I add the output of agent 3.
The workflow itself works. But I always have the complete email body text twice in the email received by the recipients. Where is the duplicate of the agent output coming from?
I have this issue also when I add the agent response of agent 1 and agent 2 directly to the "send email" node.
Does anyone have an idea? Would be great to get feedback. Appreciate it.
Thanks!
3 Replies
- SpitzingerCopper Contributor
Thank you for your response.
The behaviour is independent from having a variable in between or not. Here are some screenshots.
Here is what I do in the agent 3, where I summarize the output of agent 1 and agent 2.
And this screenshot shows the email send node setup.
Any idea what I can change to get it solved?
Thanks again for checking. I appreciate the help!
Steffen
- CoralieSimonaireBrass Contributor
Thanks for sharing the screenshots.
I don't see anything obviously wrong in the configuration shown. The email body appears to contain only a single Agent 3.Agent Response token, although the advanced settings of the Send Email action aren't visible.
At this point, I'm not able to tell where the duplication is being introduced based on the screenshots alone.
The most useful next step would be to review:
- The output of Agent 3 from the run history.
- The exact content of the received email showing the duplication.
- The Send Email advanced settings, if possible.
That should help narrow down whether the duplication is already present in the agent output or whether it is introduced later in the email process.
- CoralieSimonaireBrass Contributor
Hi,
Without seeing the exact configuration of your Send Email node, it is difficult to pinpoint the root cause. The duplication you describe, including when you use the outputs of agents 1 and 2 directly, suggests that the content is being referenced twice in the Body field, either through two separate dynamic content tokens or through a combination of a variable and a dynamic content reference.
Microsoft recommends using exclusively the "agent response" dynamic content from the "Run an agent" step, without an intermediate string variable.
Could you share a screenshot of the Body field in your Send Email node, as well as the message sent to each agent? That would help identify exactly where the duplication is coming from.