Browse documentation

Integrations

Power Automate

A Power Platform custom connector that lets a flow read your AI-coding spend, savings, allowance and cost alerts from Lineman. The same definition also imports into Power Apps and Azure Logic Apps, so you set it up once and reuse it.

Not generally available yet. The Power Automate connector sits behind a feature flag, so the definition only appears at Dashboard → Integrations → Power Automate for accounts that have it switched on. If the download is not there, that is why, and the steps below cannot be completed until it is.

Two things that catch people out

  • The definition is OpenAPI 2.0 on purpose. Power Platform rejects OpenAPI 3.x at import, so a converted file fails before you ever reach the connection screen. Import the file exactly as it downloads, and do not run it through a converter to bring it up to a newer version first.
  • Paste the API key on its own. The connector adds the word Bearer for you. Typing it yourself produces a key that fails to authenticate on every call, and the error reads like a bad key rather than a bad paste, so people usually go and make a second key instead of removing the word.

Set it up

  1. 1In Lineman, go to Dashboard → Keys and create an API key, then copy it.
  2. 2Go to Dashboard → Integrations → Power Automate and download the connector definition. It is a single file that describes every operation.
  3. 3In Power Automate, open Data → Custom connectors, then choose New custom connector → Import an OpenAPI file, name the connector and select the file you downloaded.
  4. 4Create a connection and paste the key into it, on its own and with no Bearer in front. The Lineman actions then appear in the flow designer alongside the built-in ones.

What the connector does

  • Every operation is read-only. The connector fetches spend, savings, allowance and alerts. Nothing in it sets a budget, dismisses an alert or edits a cost centre, so a flow cannot change your Lineman account by accident.
  • One definition, three products. The same file imports into Power Apps and Azure Logic Apps, so a connector you set up for a flow can be reused in an app or a logic app without downloading anything again.

What the connection can see

A connection can do only what the person who created the key can do in Lineman. Their role, not the flow, decides what comes back:

  • Administrator - company-wide figures, across every member and repository.
  • Auditor - the same company-wide figures.
  • Everyone else - their own spend and savings only.

Four operations return an error rather than a narrowed answer. The company-wide ones do not quietly shrink to one person's figures when the key belongs to an ordinary member, they fail the run instead. That is deliberate: a silently narrowed number sitting in a report is worse than a flow that stops. If a flow needs company totals, build it on a key made by an administrator or an auditor.

Reading the numbers

  • Every amount comes back twice. One field is marked (USD) and is meant for display; the other is marked (micro-USD) and is a whole number meant for arithmetic. Sum the micro-USD field and convert once at the end, because adding up the display values across a long list drifts as the rounding accumulates. Lineman never returns cents.
  • Two fields are JSON text, not objects. An alert's detail and a cost centre's rules arrive as a string, because their keys differ from one row to the next and a fixed shape would drop half of them. Run those two through the Parse JSON action before reading anything inside them.
  • Spend takes days, savings takes a month. Spend operations accept a Days value from 1 to 92 and default to 7 if you leave it blank. Savings operations take a calendar Month instead. Anything longer than 92 days is refused rather than quietly truncated, so a bigger export has to be split into chunks.