Inferensys

Integration

AI Integration for Microsoft Power Automate AI Builder

Extend Power Automate AI Builder's capabilities with custom LLMs and external AI services to handle complex document processing, sentiment analysis, and decision-making workflows beyond pre-built connectors.
ML engineer developing custom LLM, model architecture diagrams on screens, technical deep work environment.
ARCHITECTURE AND ROLLOUT

Where AI Fits into Power Automate AI Builder

A practical guide to extending Power Automate AI Builder with custom models and external LLMs for complex, data-driven cloud flows.

Power Automate AI Builder provides a low-code surface for common pre-built AI tasks, but its real power for enterprise automation emerges when you connect it to custom models and external large language models (LLMs). The integration architecture typically involves using AI Builder's Custom Model capability to host a fine-tuned model for proprietary document types or data, or using the HTTP Request action within a cloud flow to call an external LLM API (like Azure OpenAI or Anthropic). This allows you to process complex documents—such as engineering drawings, specialized contracts, or non-standard invoices—that fall outside the scope of pre-built receipt or ID card models, and to generate nuanced text for communications, summaries, or data enrichment.

In practice, you design flows where the trigger (e.g., a new document in SharePoint, a form submission, or a record update in Dataverse) passes the unstructured data to your AI endpoint. The AI's output—a structured JSON payload with extracted fields, a classification, or generated text—is then used to populate downstream systems, make routing decisions, or create approval tasks. For example, a flow could: 1) Use a custom classifier to determine if an incoming vendor document is a W-9, Certificate of Insurance, or Invoice. 2) Route it to a specific LLM-powered extraction flow based on that classification. 3) Validate the extracted data against a vendor record in Dynamics 365. 4) Post the validated data and flag any discrepancies for human review in an Approvals action. This moves automation from simple template matching to context-aware, multi-step cognitive workflows.

Rollout and governance are critical. Start by piloting a single high-volume, high-variability document workflow. Use Power Automate's built-in run history and error handling to monitor performance and catch model drift or API failures. Implement a human-in-the-loop pattern using the Action Center or manual trigger flows for low-confidence predictions. For security, authenticate external AI calls via Azure Key Vault or Managed Identity, and ensure data residency compliance by processing documents within your tenant's geographic region. By treating AI Builder not as a standalone tool but as the orchestration layer between your data and more powerful AI services, you can build scalable, governed automations that handle real-world business complexity.

AI BUILDER AND BEYOND

Integration Touchpoints in the Power Platform

Extending Pre-Built AI Models

AI Builder provides pre-trained models for common tasks like receipt processing, form recognition, and sentiment analysis. The primary integration touchpoint is the Custom Model capability, where you can train models on your own document schemas and data. For production, you connect these models to Power Automate cloud flows via the dedicated AI Builder connector. Key actions include:

  • Extract information with a custom model to process uploaded documents.
  • Classify text with a custom model for routing or tagging.
  • Analyze sentiment from customer feedback to trigger service workflows.

To go beyond pre-built capabilities, you can call external AI services (like Azure OpenAI) from within the same flow, using the HTTP action with Azure AD authentication, to handle complex reasoning, summarization, or generation that AI Builder models cannot.

BEYOND PRE-BUILT CONNECTORS

High-Value Use Cases for Enhanced AI Builder

While AI Builder offers pre-built models, its real power is unlocked by integrating custom AI and external LLMs. These cards detail practical patterns for building intelligent, end-to-end automations that understand context, generate content, and handle complex logic within your Power Platform ecosystem.

01

Dynamic Contract Assembly & Risk Review

Integrate a custom LLM with Power Automate to analyze RFP requirements, draft contract clauses from a clause library, and flag non-standard terms. The flow uses AI Builder for initial document extraction, passes structured data to an LLM for assembly and review, and routes the final draft for approval in SharePoint or Dynamics 365. This moves contract generation from a manual, template-based process to a dynamic, risk-aware workflow.

Days -> Hours
Drafting cycle
02

Intelligent Customer Inquiry Triage

Build a flow that uses AI Builder's sentiment analysis on incoming emails, then passes the full email text and customer history (from Dataverse) to an LLM. The LLM classifies intent, extracts key entities (order #, issue type), and suggests a resolution or next step. The flow can then auto-create a case in Dynamics 365 Customer Service, assign it with priority, and draft a first-response email for agent review.

Batch -> Real-time
Response initiation
03

AI-Powered Invoice Exception Handling

Go beyond basic OCR. Create a flow where AI Builder extracts data from invoices, then an LLM cross-references line items against purchase orders (in Dynamics 365 Finance) and validates pricing against contracted rates. The LLM writes a plain-English summary of any discrepancies (e.g., 'Item XYZ billed at $12.50, PO shows $11.00'). The flow routes invoices with exceptions to a dedicated Approvals queue with full context, automating the most time-consuming part of AP processing.

Hours -> Minutes
Review preparation
04

Personalized Marketing Campaign Assembly

Trigger a cloud flow when a lead reaches a certain score in Dynamics 365 Marketing. The flow calls an LLM with the lead's profile and recent activity to generate a personalized email draft and suggest relevant content assets from your DAM. It uses AI Builder to analyze past successful campaigns for tone guidance. The assembled campaign is queued in Marketing for final review, enabling hyper-personalization at scale without manual copywriting for each segment.

1 sprint
Campaign setup
05

Automated Regulatory Report Drafting

For industries like finance or healthcare, build a scheduled flow that aggregates data from multiple sources (SQL DBs, SharePoint lists). Use an LLM to analyze the aggregated data, identify required disclosures based on a rules engine, and draft narrative sections of quarterly or compliance reports. The flow integrates with Power BI to generate supporting charts and saves the complete draft to a governed workspace in SharePoint for legal and compliance review.

Same day
First draft ready
06

Proactive Equipment Maintenance Scheduling

Connect IoT alerts from Azure IoT Hub to a Power Automate flow. The flow passes equipment sensor data and maintenance history (from Dataverse) to a custom predictive ML model deployed via Azure ML, then uses an LLM to interpret the model's output, generate a work order description with probable cause, and recommend parts. The flow creates a work order in Dynamics 365 Field Service, schedules a technician, and orders parts—transforming raw sensor data into actionable, intelligible maintenance operations.

Reactive -> Proactive
Maintenance mode
PRACTICAL IMPLEMENTATION PATTERNS

Example AI-Enhanced Power Automate Workflows

These workflows demonstrate how to move beyond AI Builder's pre-built models by integrating external LLMs and custom AI to handle complex reasoning, content generation, and unstructured data processing within your cloud flows.

This flow automates the initial review of incoming vendor contracts by extracting key clauses, comparing them against a playbook, and generating a summary with redline suggestions.

Trigger: A new contract PDF is uploaded to a SharePoint library. Context/Data Pulled:

  1. The flow uses the AI Builder 'Read Text from Image' action to perform OCR on the PDF.
  2. It retrieves the organization's standard contract playbook (a JSON file of preferred clauses) from a separate SharePoint list. Model/Agent Action:
  3. The extracted text and playbook are sent via an HTTP Request action to an external LLM endpoint (e.g., Azure OpenAI). A system prompt instructs the model to:
    • Identify key clauses (Term, Liability, IP, Termination).
    • Flag any deviations from the playbook.
    • Generate a concise summary of risks and suggested negotiation points. System Update/Next Step:
  4. The LLM's structured JSON response is parsed.
  5. A task is created in Microsoft Planner or a record is updated in Dataverse for the legal team, attaching the original contract, the AI summary, and a flagged list of clauses to review.
  6. An approval email with the summary is sent to the procurement manager. Human Review Point: The legal team's task is the explicit review point. The AI provides analysis but does not execute any modifications to the document automatically.
FROM AI BUILDER TO CUSTOM LLMS

Implementation Architecture & Data Flow

A practical blueprint for extending Power Automate AI Builder with custom models and external LLMs to handle complex, unstructured workflows.

A production integration typically layers external intelligence upstream, alongside, or downstream of AI Builder's native models. The core architecture involves using Power Automate Cloud Flows as the orchestration engine, with HTTP actions to call external APIs. For example, a flow might first use an AI Builder pre-built model to classify an invoice document, then pass the extracted vendor name and line items to a custom LLM via an Azure OpenAI endpoint for complex validation against procurement policies. The LLM's structured JSON output is then used to update a SharePoint list or create a Dynamics 365 Finance record, with approval steps routed through Microsoft Teams or Outlook.

Key implementation patterns include: 1) Pre-processing with LLMs: Use an LLM to summarize, structure, or translate raw text (from emails, chat logs, scanned forms) before feeding it into an AI Builder model for entity extraction. 2) Post-processing for reasoning: Send AI Builder's output (e.g., a sentiment score or extracted contract date) to an LLM to generate a narrative summary, suggest an action, or draft a response. 3) Hybrid validation: Run AI Builder and a custom model in parallel, using a separate flow to compare results and flag discrepancies for human review in a Power Apps canvas app or Action Center.

Governance and rollout require careful planning. All external API calls should be secured via Azure API Management with rate limiting and audit logging. Sensitive data must be masked or pseudonymized before leaving the Microsoft tenant. Start with a pilot flow that has a clear human-in-the-loop checkpoint, such as a Power Automate approval after the LLM generates a draft. Monitor costs and latency using Azure Application Insights integrated with your flow runs. For enterprise-scale deployments, consider provisioning a dedicated Azure Machine Learning workspace to host fine-tuned models, which can be registered and called securely by Power Automate, creating a centralized, governable AI layer beyond AI Builder's out-of-the-box scope.

EXTENDING AI BUILDER WITH EXTERNAL LLMS

Code & Payload Examples

HTTP Request to OpenAI API

Use the HTTP action in Power Automate to call external LLMs, augmenting AI Builder's pre-built models. This pattern is ideal for complex text generation, summarization, or classification tasks beyond AI Builder's scope.

json
// HTTP Request Action Configuration
{
  "method": "POST",
  "uri": "https://api.openai.com/v1/chat/completions",
  "headers": {
    "Authorization": "Bearer @{variables('OpenAI_Key')}",
    "Content-Type": "application/json"
  },
  "body": {
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Summarize the following customer feedback: @{triggerBody()?['text']}"
      }
    ],
    "temperature": 0.2
  }
}

After the call, parse the JSON response using the Parse JSON action to extract the content field for use in subsequent flow steps, such as updating a Dataverse record or sending an email.

AI-ENHANCED CLOUD FLOWS

Realistic Time Savings & Operational Impact

How integrating custom AI models and external LLMs with Power Automate AI Builder transforms common automation scenarios, moving beyond simple connectors to intelligent, adaptive workflows.

Workflow / TaskBefore AI Builder IntegrationAfter AI Builder + LLM IntegrationImplementation Notes

Complex Invoice Processing

Manual data entry from PDFs or template-based OCR with high error rates on line items.

AI classifies invoice type, extracts line items and totals with context, validates against PO data.

Requires custom model training in AI Builder and LLM integration for semantic validation.

Customer Feedback Triage

Manual tagging and routing of support emails or survey responses based on keywords.

Sentiment and intent analysis auto-tags tickets, suggests routing paths, and drafts initial responses.

Leverages pre-built AI Builder sentiment model + custom LLM prompt for intent classification.

Contract Review & Data Entry

Manual review of contracts to find key dates, parties, and clauses for CRM/ERP entry.

AI extracts entities and clauses, summarizes obligations, and populates a Dataverse table for review.

Combines AI Builder's entity recognition with an LLM for summarization and clause analysis.

Dynamic Form Processing

Static forms requiring rigid input; exceptions kicked out for manual handling.

AI validates uploaded documents, extracts unstructured data, and pre-fills forms or requests clarification.

Uses a cloud flow with AI Builder's pre-trained or custom form processing model.

Report Generation & Insight

Manual compilation of data from multiple sources into standardized PowerPoint or Word reports.

AI synthesizes data from SharePoint lists, Excel, and APIs, then generates narrative summaries and charts.

Orchestrates data connectors, uses LLM for narrative generation, and AI Builder for chart creation.

Anomaly Detection in Approvals

Approval workflows trigger on basic rules; fraudulent or anomalous submissions pass through.

AI analyzes submission history and attached documents, flags high-risk items for extra scrutiny before routing.

Integrates a custom anomaly detection model hosted in Azure ML or as an AI Builder custom model.

Multi-Channel Request Intake

Requests from email, Teams, and web forms handled in separate, siloed flows.

Unified intake flow uses AI to normalize requests from any channel, classify them, and trigger the correct process.

Central cloud flow uses AI Builder's language understanding to create a single classification layer.

ARCHITECTING FOR PRODUCTION

Governance, Security & Phased Rollout

A practical framework for deploying and governing custom AI models and LLM integrations within Power Automate.

Integrating external LLMs or custom models with Power Automate AI Builder introduces new governance surfaces: the AI service endpoints, the data flowing through your cloud flows, and the business logic that acts on AI outputs. A secure architecture typically involves:

  • API Gateway & Secure Key Management: Using Azure API Management or a similar gateway to proxy calls to OpenAI, Anthropic, or Azure OpenAI, centralizing rate limiting, logging, and credential rotation outside of individual flow definitions.
  • Data Residency & PII Handling: Configuring HTTP actions in your flows to ensure prompts and document payloads are scrubbed of sensitive data before leaving your tenant, or leveraging Azure AI Services within your preferred region.
  • Audit Trails: Enabling detailed logging in Power Automate analytics and supplementing with Azure Monitor to trace the full chain: trigger → AI call → decision → downstream action, which is critical for compliance and debugging.

Rollout should follow a phased, risk-aware approach. Start with a pilot flow that has a contained impact, such as a document classification model that tags internal PDFs and writes results to a SharePoint list for human review. Use the AI Builder model performance dashboard to monitor accuracy. For LLM integrations, implement a human-in-the-loop approval step in the flow for the first 100-200 executions, where a team member reviews the generated text (e.g., a customer email draft) before it's sent. This builds confidence and creates a labeled dataset for fine-tuning or prompt optimization.

For enterprise-scale deployment, establish environment strategy: develop and test models in a dedicated Power Platform environment, then package solutions using Power Platform ALM for controlled promotion to production. Implement robust error handling in your flows: catch AI service timeouts or content filter violations, route failures to a dedicated queue (via Azure Service Bus or a SharePoint list), and trigger alerts. Finally, define clear ownership and review cycles—treat custom AI models as assets that require periodic retraining based on new data, and LLM prompts as configuration that needs versioning and A/B testing for key workflows like sentiment analysis or contract clause extraction.

IMPLEMENTATION PATTERNS

Frequently Asked Questions

Common architectural and operational questions for integrating external AI models and LLMs with Microsoft Power Automate AI Builder to build production-grade cognitive automations.

You call external LLMs via HTTP actions in Power Automate, treating them as a secure API service. The core pattern involves:

  1. Trigger: Your flow is triggered by an event (e.g., a new document in SharePoint, a form submission, a scheduled timer).
  2. Context Assembly: Use Power Automate actions to gather the necessary context—this could be text from a document, data from Dataverse rows, or outputs from previous AI Builder models.
  3. Secure API Call: Use the HTTP action to POST to your LLM provider's endpoint.
    • Authentication: Store API keys in Azure Key Vault and retrieve them using the Get secret action. Never hardcode keys.
    • Request Body: Construct the prompt dynamically using your assembled context. Structure the JSON payload according to the provider's API (e.g., OpenAI's Chat Completion format).
  4. Response Parsing: Parse the JSON response using the Parse JSON action with a predefined schema to extract the generated text or structured data.
  5. System Update & Orchestration: Use the output to update records in Dataverse, send an email, create a Teams message, or trigger a downstream flow.

Example HTTP Action Configuration:

json
// Example Body for the HTTP action
{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "system",
      "content": "You are an assistant that extracts key terms from contracts."
    },
    {
      "role": "user",
      "content": "@{variables('DocumentText')}"
    }
  ],
  "temperature": 0.1
}

This pattern keeps your core business logic and orchestration in Power Automate while leveraging best-in-class language models.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.