LoopAI-103

Before you start

Short explainers for ideas this lesson builds on. Watch these first if they're new to you.

0 of 2 watched · about 4 min
Read this lesson

Launch it from your app

Once your workflow works in the designer, you can run it from your own software with the Azure AI Projects SDK. Think of mission control: the workflow is the rocket built and tested in the hangar, and your app presses the launch button. The designer stores the workflow as YAML in your project, and you can download that definition for your codebase too. From code, you refer to the workflow by its name. Connect with an AIProjectClient, get its OpenAI client, and create a conversation. Then call responses dot create with the conversation, an agent reference holding the workflow's name, and your input. The input might be a user's question, a ticket to classify, a data payload, or even an empty string that simply starts it.

Watching the telemetry

Turn on streaming, and events arrive while the workflow runs, like telemetry on the mission control screens. A response dot output item dot done event means one item finished, such as a workflow action, with its ID and status. Response dot completed means the whole run is done, with the final output. Use these events to show live progress, capture what agents produced, or trigger other actions. Or skip streaming and just wait for the final response. If the workflow stops to ask a person something, send another message to the same conversation to answer and let it carry on.

Where it fits

Running workflows from code opens up a lot. You can build them into web apps people use, expose them as APIs, process work in big batches, test them automatically in your CI CD pipeline, or build a custom interface for one specific job. You design visually in Foundry, and plug the result into the software you already have.

Facts from Microsoft's documentation: Build a workflow in Microsoft Foundry (Preview); Use and migrate declarative agent workflows with Microsoft Foundry Toolkit (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.