Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 38 ยท Error Handling

Monitoring and Troubleshooting Flows

Find out why a flow failed: reading run history, inspecting inputs and outputs, common errors by status code, expression mistakes, resubmitting runs, and keeping watch with alerts and analytics.

A flow without monitoring is a promise nobody checks. Sooner or later something changes (a column is renamed, a connection expires, an API changes its reply) and the flow starts failing quietly. This lesson shows where to look, how to read a failed run in about a minute, which errors you will meet over and over, and how to set up a little monitoring so you hear about problems before your users do.

The portal is not available on this site. The places and buttons are described in words; the runnable examples are stand-ins for the log reading and the error lookup.

Where to look

  • My flows: choose a flow to see its details page. The 28-day run history table lists each run with its start time, duration and status (Succeeded, Failed, Running, Cancelled, Waiting).
  • Run details: select a run to see the flow drawn with a green check or red cross on each action, and the time it took. Select any action to see its Inputs and Outputs, which is where most mysteries end.
  • Analytics tab: counts of runs, failures, and the most common errors over time.
  • Monitor (in the left navigation): shows cloud flow runs across the environment you can access, and desktop flow runs, with filters by status and time.
  • Flow checker: in the designer, it lists errors and warnings (missing required fields, unused variables, performance tips) before you save.

Reading a failed run in four steps

  1. Open the run and find the first red action. Actions after it are usually grey (skipped) and are not the cause.
  2. Read its error message and code. The message often names the field, the id or the permission that is wrong.
  3. Check its inputs. Is a value empty, the wrong type, or from the wrong step? Expand each input to see the actual value used.
  4. Check the previous action's outputs to see whether the data arrived in the shape you expected.
flowchart TB
    S["Run failed"] --> R["Find first red action"]
    R --> M["Read code and message"]
    M --> I["Inspect its inputs"]
    I --> O["Inspect outputs of earlier steps"]
    O --> F["Fix, then Resubmit or Test"]

The cause is almost always visible in the inputs of the first red action.

Common errors

Symptom Likely cause Fix
401 Unauthorized or "connection is not valid" The sign-in expired, the password changed, or MFA is needed Open the flow's Connections, fix the connection (sign in again)
403 Forbidden The account lacks permission to the site, list, mailbox Grant access, or use a connection owned by the right account
404 Not Found The item, file or table was deleted or renamed; wrong id Re-select the item in the action, check dynamic values
400 Bad Request Invalid value: wrong type, missing required field, bad date Inspect inputs; convert types; add validation
429 Throttling Lower concurrency, reduce calls (see retry policies)
InvalidTemplate: "Unable to process template language expressions" A typo or bad reference in an expression Fix the expression (details below)
ActionFailed on a scope One action inside failed Open the scope and find the inner red action
Flow turned off or suspended Repeated failures, a broken connection, or license change Fix the cause, then turn the flow on
Trigger never fires The trigger connection is broken, filter too strict, or the site/folder changed Check the trigger history and connection

Flows that fail continuously for a long period can be turned off automatically (the period has been two weeks at the time of writing), and the owner is emailed, so keep the owner address current.

Expression errors

An InvalidTemplate failure shows the expression and the reason. Typical causes:

  • Wrong action name. body('Get_item') when the action was renamed. Names use underscores for spaces and are case-sensitive.
  • Missing property. body('Get_item')['Amount'] fails when Amount is absent. Use ?['Amount'] so the result is null instead, then coalesce() for a default.
  • Wrong type. Passing text to a function that wants a number; or add() on null.
  • Quotes and commas. A single quote inside text must be doubled ('It''s').
  • Referencing an action that did not run (it was in another branch or skipped). Reference only outputs that exist at that point.

When an expression is long, build it in a Compose action first and look at its output in the run history. Check the pieces one at a time.

JS Stand-in: classify an error and suggest a fix

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Resubmit, test and fix

  • Resubmit a failed run from the run page to run it again with the same trigger data after you fixed the cause. Only works for runs whose trigger inputs are still stored, and it creates a new run.
  • Test in the designer (top right): choose Manually (trigger it yourself) or Automatically with data from a previous run, which is the fastest loop when fixing a flow that depends on real event data.
  • Edit a flow in place only when it is not critical. For important flows, use a solution and separate environments so you test a copy first.
  • Turn on Secure inputs/outputs on actions that handle secrets, so passwords and tokens do not appear in run history. This also hides those values from you while debugging, so decide per action.

Keeping watch

  1. Failure emails. The owner receives emails on failures and a periodic digest. Use a shared mailbox as a co-owner for team flows, not one person's inbox.
  2. Alert from the flow itself. Use a Catch scope (run after) that posts to a Teams channel with the flow name, error and run link.
  3. Heartbeat check. For a scheduled flow that must run daily, create a small second flow that checks whether yesterday's output exists and alerts if not. This catches "nothing ran", which no error message announces.
  4. Analytics and the admin center. Admins can review failure rates, top failing flows and connection health across the environment.
  5. Logging table. Write one row per run (start, end, items processed, errors) to a list or a Dataverse table. It answers "when did this start going wrong?" in seconds.
JS Stand-in: failure rate from run history

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In a failed run, which action should you examine first?

    Later actions are usually skipped as a result of the first failure.
  2. 2. Which error most likely means a connection has expired?

    401 means the credentials are not valid anymore; repair the connection.
  3. 3. What does the ?['Amount'] form do compared with ['Amount']?

    The question mark is safe navigation.
  4. 4. A daily flow silently stops running. Which monitoring technique catches this?

    If nothing runs, no error is produced, so you must check for the expected result.

Summary

  • Use the run history: first red action, then its error, inputs and earlier outputs.
  • Learn the common errors by code (401, 403, 404, 400, 429, InvalidTemplate) and fix the cause, not the symptom.
  • Build long expressions in Compose, use ?[] and coalesce(), and test with data from previous runs.
  • Monitor with failure emails (to a shared owner), Catch-scope alerts, heartbeat flows, analytics and a log table.

Next: Environments and Solutions