How to Extract Data from Invoices in Power Automate

Learn how to set up a production-ready invoice processing flow in Power Automate using AI models and human-in-the-loop validation.

A Cradl AI agent with a Power Automate trigger and export

This guide shows how to extract structured information from invoices in Power Automate using an AI model. By the end, you’ll have an invoice processing flow that can write extracted data to Excel, Dataverse, SQL, or SharePoint. We’ll also set up a human-in-the-loop step to review uncertain predictions.

For broader accounts-payable process design, start with How to Automate Invoice Data Extraction with AI in 2026. If your workflow needs to handle PDFs beyond invoices, use the companion guide on extracting data from PDFs in Power Automate.

For a product overview of the Microsoft-specific setup, see Power Automate invoice data extraction.

By the end, you’ll have a flow like the diagram below:

A Power Automate flow that receives an email, downloads each PDF attachment, extracts data from the document and appends each invoice line to a table in Excel
The Power Automate flow.

Before we start

You’ll need:

Step 1: Set up your AI agent

In Cradl AI, create a new agent and choose Invoices as the document type. This gives you a starting point with a set of suggested fields. You can customize the fields to fit your exact requirements at any time. For now, we’ll stick with the suggested ones to keep things simple.

Creating a new agent in Cradl AI by describing the document type, with Invoices selected
Creating a new agent.

Next, go to the Builder tab. Click Add trigger and choose Power Automate, then click Add export and choose Power Automate again. When you’re done, your agent should look something like this:

A Cradl AI agent in the builder with an Import from Power Automate trigger, a Document AI step, a Human review step and an Export to Power Automate step
The agent with a Power Automate trigger and export.

Step 2: Create a connection

Next, head over to Power Automate and either open an existing flow or create a new one.

In this example, we’ll assume invoices arrive by email and that we want to write the extracted data to an Excel sheet. In a real-world setup, you’d likely send the data to an ERP system or store it in something like a Dataverse table, but we’ll use Excel here to keep things simple.

To connect Cradl AI to your Power Automate flow, add a new action and search for “Extract data from document”. Select it, then create a new connection to your Cradl AI account:

The Export to Power Automate panel in Cradl AI, showing the client credentials field and the remaining setup steps
The client credentials are in the Export to Power Automate panel.

In Cradl AI, open the Builder tab, select the “Export to Power Automate” node, and copy the client credentials. Then paste those credentials into the Client Credentials field in Power Automate. Only developers and admins in your Cradl AI workspace can see the credentials.

Next, configure the Extract data from document action. Select your newly created Invoices agent from the dropdown. In Export action, pick the Power Automate export you added in step 1. For the Document field, choose the Content Bytes variable from the Download the email attachment step.

The Extract data from document action in Power Automate, with an agent selected and the file content mapped to the document input
Configuring the Power Automate action.

Step 3: Build the Power Automate flow

Now let’s put everything together by building a Power Automate flow that:

  • Retrieves emails from Outlook
  • Downloads any PDF attachments
  • Sends those attachments to Cradl AI for processing
  • Writes the extracted data to an Excel sheet

When we’re done, your flow will look like the diagram below. If you’d rather skip ahead, you can download the complete Power Automate solution from the Power Automate integration page and start using it right away.

A Power Automate flow that receives an email, downloads each PDF attachment, extracts data from the document and appends each invoice line to a table in Excel
The Power Automate flow.

Here’s how to configure each action:

When a New Email Arrives (V3): In the trigger, enable Include Attachments. You can also enable Only with Attachments to ensure the flow only runs for emails that actually contain attachments.

Get Attachment (V2): Use the Message ID and Attachment ID from the previous step. Because Attachments is an array, Power Automate will automatically create an Apply to each loop, so the flow runs once for every attachment on the email.

Condition: Next, add a Condition to avoid processing unnecessary files. In this example, we only want to process PDFs, so configure the condition to continue only when the Content-Type equals application/pdf.

Extract Data from Document: Select the agent you created earlier and map the downloaded attachment from the previous step as the document input.

Add a Row into a Table: Finally, append the extracted data to your Excel table. Select the appropriate workbook and table, then map each extracted field to the corresponding column.

Step 4: Take it for a spin!

Now you’re ready to test the flow. Because we set it up to process invoices received by email, send a sample invoice to the email address you configured and make sure everything runs as expected:

Reviewing extracted values in Cradl AI next to the source document, with one value flagged for review
Reviewing flagged values next to the source document.

Since this is the first document being processed, the AI will be conservative about what it approves automatically. In this case, you might be asked to confirm that the invoice date was interpreted correctly. After you’ve validated a few invoices, the AI will become more confident over time. If you want more, or less, automatic approval, open a field in the Document AI node and edit its Guardrails.

Back in Cradl AI, the Export to Power Automate panel shows whether your flow has connected.

The Export to Power Automate panel in Cradl AI showing the account as connected
The export shows as connected once the flow has run.

What if a document is waiting for review?

By default, the Extract data from document action waits until the extracted data is ready, which includes any human review. If your documents often need review and you don’t want a flow run to sit waiting, change Action mode in the Export to Power Automate panel from “Wait for result” to “Trigger a flow”. Cradl AI then starts a separate flow, using the “Extracted data from document” trigger, when the data is ready. In the first flow, leave Export action empty in the Extract data from document action, so it sends the document and moves on.

For the reasoning behind confidence-based review, see Using LLMs for OCR and PDF Parsing.

Wrapping up

That’s all you need to build a basic invoice processing pipeline in Power Automate using Cradl AI.

The next step is to add more advanced processing and validation logic. For example, you can match invoices against purchase orders to automatically verify amounts, line items, or vendors. This helps you build a more robust and reliable accounts payable process, with fewer manual checks and fewer surprises downstream.

If your team prefers n8n, the same pattern is covered in the n8n invoice extraction workflow guide.

Document automation for the agentic era.

Build your first agent in minutes, and let your business users review and train it from day one.