> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cradl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Power Automate

> Production-ready document data extraction for Power Automate.

export const Row = ({children}) => {
  return <div className="flex gap-2 ">
    {children}
  </div>;
};

export const Image = ({style, ...rest}) => {
  let sizeStyle = {
    width: '75%'
  };
  return <Frame><img {...rest} style={{
    ...style,
    ...sizeStyle
  }} /></Frame>;
};

## Before you begin

* Verify the **Cradl AI for Power Automate** connector is available in your tenant (through a premium license or custom connector deployment).
* Prepare a test document to upload when you run the flow.

## Setting up your Power Automate flow

Follow these steps to set up your Power Automate flow with Cradl AI.

<Steps>
  <Step title="Add a Power Automate trigger">
    In Cradl AI, open your agent and add a new trigger. Choose **Power Automate**, then select **Import from Power Automate**. Copy the **Client Credentials** value from the configuration panel.

    <Image src="/images/download.png" alt="Copy client credentials from the Cradl AI Integration panel" />
  </Step>

  <Step title="Add the Extract Data from Document action">
    In your Power Automate flow, add the **Extract data from document** action.

    <Image src="/images/Screenshotfrom2025-10-0815-49-57.png" alt="Adding the Extract data from document action in Power Automate" />
  </Step>

  <Step title="Create a connection to Cradl AI">
    In the **Client Credentials** field, paste the value you copied in Step 1.

    <Image src="/images/Screenshotfrom2025-10-0815-46-33.png" alt="Pasting client credentials to create the Cradl AI connection" />
  </Step>

  <Step title="Configure the action">
    Open the **Extract data from document** action settings and choose the Cradl AI **Agent** that should process the file.
    For **Document**, select the binary file content from an earlier step, such as the `File Content` output from **Get file content (OneDrive)** or a file supplied by a manual trigger.
    For **Export action**, choose the Power Automate export you added to your Cradl AI agent.
    Optionally, set **Title** to pass along the file name and extension.

    <Image src="/images/powerautomate-configure-action.png" alt="Configuring the Extract data from document action with Agent and Document inputs" title="Configure Extract data from document" />
  </Step>

  <Step title="Use the extracted fields">
    After the action runs, the fields from your Cradl AI agent are available as dynamic content in Power Automate. Select these values in later actions the same way you use other outputs from the flow.

    <Image src="/images/powerautomate-select-variables.png" alt="Selecting extracted Cradl AI fields as dynamic content in Power Automate" title="Use extracted fields in later actions" />
  </Step>
</Steps>

Your flow now sends documents from Power Automate to your Cradl AI agent and makes the extracted fields available to later actions.

## Troubleshooting

* Run the flow manually with your sample document and review the **Run history** entry. Expand the **Extract data from document** action and confirm its status code is `200`.
* If Power Automate reports `401 Unauthorized` or `404 Forbidden`, reopen the Cradl AI integration, copy fresh client credentials, and update the connection.
* For other errors, make sure the file format is supported, the document is not encrypted, and your Cradl AI usage limits have not been exceeded. The message under **Outputs → Body** provides details when validation fails.
