UiPath Documentation
activities
latest
false
Integration Service activities

Invoke Agent

Invoke a Microsoft Azure AI Foundry agent built on the Responses API in a Maestro agentic process.

Description

This activity enables the use of Microsoft Azure AI Foundry agents built on the Responses API as participants in an automated process orchestrated by Maestro.

Foundry agent surfaces

Azure AI Foundry exposes two separate agent surfaces on the same project endpoint:

  • Assistants (classic) — created via the /assistants API. Use the Execute the thread activity for these.
  • Agents (Foundry portal) — created in the Azure AI Foundry portal and invoked through the Responses API. Use Invoke Agent for these.
Note:

Only agents of kind prompt and hosted are verified to work with this activity. Agents of kind workflow or external have not been validated and are not confirmed to work.

How to use the activity

To use this activity in a Maestro agentic process, follow these steps:

  1. Add a service task element to the canvas and open the task's Properties panel.

  2. In the Implementation section, from the Action dropdown list, select Start and wait for external agent.

  3. Select the Microsoft Azure AI Foundry connector.

  4. Select an existing connection or create a new one. For more information, see Microsoft Azure AI Foundry authentication.

  5. From Activity, select Invoke Agent.

  6. From Agent, select an agent from the list of agents in your Azure AI Foundry project. Each entry shows the agent's kind next to its name, for example ah-vo-script-agent (hosted).

  7. In Message, enter the prompt to send to the agent.

  8. Connect the start event to the service task, and the service task to an end event node in the canvas.

  9. Select Debug to run this process.

    The activity always runs asynchronously: Integration Service polls the agent's response and resumes the Maestro step once the run completes.

Output

ParameterDescription
Response identifierUnique identifier of the agent response.
StatusCurrent status of the response: queued, in_progress, completed, failed, or incomplete.
Output textThe agent's answer text.
Model identifierThe model that produced the response.
Error codeError code when the run did not complete successfully (status is failed). Empty on success.
Error messageHuman-readable reason the run failed (status is failed). Empty on success.
Incomplete reasonWhy the run ended incomplete (status is incomplete), for example content_filter or max_output_tokens. Empty on success.
Input tokens usedNumber of input tokens consumed.
Output tokens usedNumber of output tokens produced.
Total tokens usedTotal tokens consumed during the request.

Assign the output to a process variable so it can influence the progress of the Maestro process, for example to branch on Status, or to use the answer from Output text.

Note:

The activity's response time depends on the connection's polling interval, which defaults to 5 minutes. A completed run can therefore appear slower than its actual completion time.

  • Description
  • Foundry agent surfaces
  • How to use the activity
  • Output

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated