Hi Mohamed ZAIEM ,
Thanks for the question.
At the moment, Azure AI Foundry Workflows (UI) do not fully support agents that use the Knowledge Retrieval tool, regardless of whether the agent is created from the UI or via code.
What is happening
UI-created agents
When you create an agent with a Knowledge Base from the Foundry UI, the Knowledge Retrieval tool requires approval. Foundry Workflows do not support approval steps, so the workflow blocks. This is expected behavior.
Code-created agents (Python / REST)
Agents created via code are valid, but when used inside a Foundry Workflow, execution fails with:
The requested operation requires an element of type 'Object', but the target element has type 'Array'.
This happens because Foundry Workflows expect tool outputs to be JSON objects, while the Knowledge Retrieval tool returns an array-based response, which the workflow runtime cannot process.
Current supported state
Knowledge Retrieval works when running agents directly (SDK / Playground)
Knowledge Retrieval is not supported in Foundry Workflow (UI) today
This limitation is documented implicitly by the workflow and tool behavior
Recommended approach
If you need workflows today:
Expose Azure AI Search as an explicit tool (OpenAPI or Azure Function), or
Run the agent outside the Workflow UI and orchestrate in your application
References
Knowledge Retrieval tool for agents
https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/knowledge-retrieval
Tools in Azure AI Foundry agents
https://learn.microsoft.com/azure/ai-foundry/agents/how-to/tools/overview
Azure AI Foundry Agents overview (workflow limitations implied)
https://learn.microsoft.com/azure/ai-foundry/agents/overview
I hope this clarifies the current behavior.
If the answer is useful, please accept it to close the thread.