Skip to content

Configuration AI Enrichment

Lewis Ginn edited this page Jun 9, 2026 · 1 revision

Configuration — AI Enrichment

AI Enrichment is an optional feature that generates short, plain-English summaries for the harder-to-read parts of a solution and injects them into the documentation as a Summary section on each component's page.

It is off by default. Your base documentation is fully deterministic and identical whether or not AI Enrichment is enabled.

What it summarises

Component What the summary covers
Power Automate Flows Trigger, overall purpose, key actions and branching logic
Classic Workflows Trigger conditions and step sequence
Business Rules The condition being evaluated and what each branch does
Plugin Assemblies What the plugin does, which entity/message it's registered on
Web Resources (JS) A file-level summary, plus a one-line description per function

The per-function descriptions for Web Resources replace the "Description" column in the functions table, which is almost always empty in real client code.

How the cache works

Every component is reduced to a small snapshot of its meaningful content, hashed, and checked against a committed cache file (.powerautodocs-ai-cache.json). If the component hasn't changed since the last run, the cached summary is reused — no API call, no cost.

This means:

  • Re-runs are fast and free for unchanged components
  • The cache file is committed to your repo, so AI-written summaries are reviewed in pull requests before they're published
  • Summaries don't change unexpectedly between runs

Run with --regenerate-ai to force every summary to be regenerated, ignoring the cache.

Providers

PowerAutoDocs supports two AI providers. Choose the one that fits your setup.

Anthropic (Claude)

Best choice if you don't already have Azure OpenAI provisioned. Uses the Anthropic API directly.

aiEnrichment:
  enabled: true
  provider: anthropic
  cacheFile: .powerautodocs-ai-cache.json

  anthropic:
    apiKeyEnv: ANTHROPIC_API_KEY    # name of the env var holding your key
    model: claude-haiku-4-5         # optional — haiku is fast and cost-effective

  components:
    flows: true
    classicWorkflows: true
    businessRules: true
    plugins: true
    webResources: true

Get an API key at console.anthropic.com. The model field is optional — claude-haiku-4-5 is the default and is optimised for batch summarisation. Switch to claude-sonnet-4-6 for higher quality summaries at higher cost.

Azure OpenAI

Best choice for organisations already using Azure OpenAI, particularly where data residency and compliance matter.

aiEnrichment:
  enabled: true
  provider: azure-openai
  cacheFile: .powerautodocs-ai-cache.json

  azureOpenAI:
    endpointEnv: AZURE_OPENAI_ENDPOINT    # name of the env var holding your endpoint URL
    apiKeyEnv: AZURE_OPENAI_API_KEY       # omit if using managed identity
    deployment: my-gpt4o-deployment       # your Azure OpenAI deployment name

  components:
    flows: true
    classicWorkflows: true
    businessRules: true
    plugins: true
    webResources: true

Managed identity — if your ADO pipeline agent has managed identity access to the Azure OpenAI resource, you can omit apiKeyEnv entirely. No API key management needed.

Supplying keys at runtime

The apiKeyEnv and endpointEnv fields hold the name of an environment variable — not the actual value. The real key is supplied at runtime, never stored in the config file.

Locally:

export ANTHROPIC_API_KEY=sk-ant-...
npx powerautodocs@latest

ADO Pipeline — add the key as a secret pipeline variable. The variable name must match what you set in apiKeyEnv. See Running via ADO Pipeline for how to add pipeline variables.

Enabling per component

You can turn enrichment on or off for each component type independently:

components:
  flows: true           # summarise flows
  classicWorkflows: false  # skip classic workflows
  businessRules: true
  plugins: false
  webResources: true

Only the enabled types will make API calls. Disabled types use no quota and have no cache entries.

Clone this wiki locally