关于 power-automate-monitoring
此技能通过 FlowStudio MCP 的缓存存储监控 Power Automate 流和租户资产,适合需要检查流运行状况、故障及治理信息的管理员。它基于扫描数据而非实时 API 调用提供分析。
主要功能
- 01缓存流健康状况与运行统计
- 02逐次运行故障详情及修复提示
- 03环境、连接、Maker 和应用清单
- 04更新监控标记与治理元数据
- 05检查每日扫描数据的新鲜度
适用场景
- 01筛选故障率较高的流
- 02查看失败运行及修复提示
- 03审计 Maker 及其拥有的流
- 04盘点 Power Platform 环境与资产
MCP 相关
使用 FlowStudio MCP 的 store_* 工具读取 Power Automate 缓存数据,并更新流的监控与治理元数据。技能说明通过 tool_search 查找相关工具架构。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ ninihen1/ power-automate-mcp-skills --skill power-automate-monitoring安装后在 Claude Code 中输入/power-automate-monitoring确认已加载。
详细介绍
使用 FlowStudio MCP 监控 Power Automate
通过 FlowStudio MCP 缓存存储监控流运行状况、跟踪失败率并盘点租户资产——读取速度快、不受 PA API 速率限制,并附带治理元数据和修复建议。
⚠️ 需要 Pro+ 订阅。 此技能会调用
store_*工具,这些工具仅适用于 FlowStudio for Teams 或 MCP Pro+ 订阅用户。**如果用户没有 Pro+ 访问权限:**首次调用
store_*工具时会返回 403/404 错误。出现这种情况时:
- 停止调用存储工具
- 告知用户此功能需要 Pro+ 订阅
- 提供链接:https://mcp.flowstudio.app/pricing
- 如果可以使用实时工具回答用户的问题(例如“列出一个环境中的流”),则建议改用
power-automate-mcp技能**工具发现:**使用
tool_search加载工具架构,而不是使用tools/list——对于常用监控工具,调用时使用query: "select:list_store_flows,get_store_flow_summary";或者使用query: "skill:governance"加载完整工具集(服务器的治理工具包也涵盖大多数监控读取操作——此技能与power-automate-governance共用底层工具系列)。此技能介绍响应结构、行为说明和工作流模式——这些内容无法通过tool_search获取。如果本文档与实际 API 响应不一致,以 API 响应为准。
监控的工作方式
FlowStudio 每天为每位订阅用户扫描 Power Automate API,并缓存扫描结果。监控分为两个级别:
- 所有流都会扫描元数据:定义、连接、所有者、触发器类型和汇总运行统计信息(
runPeriodTotal、runPeriodFailRate等)。环境、应用、连接和创建者也会被扫描。 - 受监控的流(
monitor: true)还会获取逐次运行的详细信息:包含状态、持续时间、失败操作名称和修复建议的单条运行记录。这些数据会填充get_store_flow_runs和get_store_flow_summary。
**数据新鲜度:**查看 get_store_flow 的 scanned 字段,了解流上次扫描的时间。如果数据过期,扫描管道可能未运行。
**启用监控:**通过 update_store_flow 或 FlowStudio for Teams 应用设置 monitor: true
(如何选择流)。
**指定关键流:**使用 update_store_flow,将业务关键流的 critical=true。这会启用治理技能的通知规则管理功能,自动为关键流配置失败警报。
工具
| 工具 | 用途 |
|---|---|
list_store_flows | 列出流,并显示失败率和监控筛选条件 |
get_store_flow | 完整缓存记录:运行统计信息、所有者、层级、连接、定义(包含 triggerUrl 字段) |
get_store_flow_summary | 汇总运行统计信息:成功率/失败率、平均/最长持续时间 |
get_store_flow_runs | 逐次运行历史记录,包含持续时间、状态、失败操作和修复建议(筛选 status="Failed" 仅查看错误) |
update_store_flow | 设置监控标记、通知规则、标签和治理元数据 |
list_store_environments | 列出所有 Power Platform 环境 |
list_store_connections | 列出所有连接 |
list_store_makers | 列出所有创建者(公民开发者) |
get_store_maker | 创建者详细信息:流/应用数量、许可证、帐户状态 |
list_store_power_apps | 列出所有 Power Apps 画布应用 |
如需启动/停止,请使用
monitor-flow工具包中的set_live_flow_state(tool_search query: "select:set_live_flow_state")——缓存会在下次扫描时重新同步。此前的便捷封装set_store_flow_state已弃用。
Store 与 Live 的对比
| 问题 | 使用 Store | 使用 Live |
|---|---|---|
| 有多少流程正在失败? | list_store_flows | — |
| 30 天内的失败率是多少? | get_store_flow_summary | — |
| 显示某个流程的错误历史 | get_store_flow_runs(筛选 status="Failed") | — |
| 这个流程是谁创建的? | get_store_flow → 解析 owners | — |
| 读取完整的流程定义 | get_store_flow 中有(JSON 字符串) | get_live_flow(结构化) |
| 从某次运行检查操作的输入/输出 | — | get_live_flow_run_action_outputs |
| 重新提交失败的运行 | — | resubmit_live_flow_run |
Store 工具回答"发生了什么?"和"它有多健康?" Live 工具回答"具体哪里出错了?"和"现在修复它。"
如果
get_store_flow_runs或get_store_flow_summary返回空结果, 请检查:(1) 流程上的monitor: true是否开启?以及 (2)scanned字段 是否是最新的?使用get_store_flow来验证这两项。
响应结构
list_store_flows
直接返回数组。筛选条件:monitor(bool)、rule_notify_onfail(bool)、
rule_notify_onmissingdays(bool)。
[
{
"id": "Default-<envGuid>.<flowGuid>",
"displayName": "Stripe subscription updated",
"state": "Started",
"triggerType": "Request",
"triggerUrl": "https://...",
"tags": ["#operations", "#sensitive"],
"environmentName": "Default-aaaaaaaa-...",
"monitor": true,
"runPeriodFailRate": 0.012,
"runPeriodTotal": 82,
"createdTime": "2025-06-24T01:20:53Z",
"lastModifiedTime": "2025-06-24T03:51:03Z"
}
]
id格式:Default-<envGuid>.<flowGuid>。在第一个.处分割即可得到environmentName和flowName。
triggerUrl和tags是可选的。有些条目信息稀疏(只有id+monitor)—— 跳过没有displayName的条目。
list_store_flows上的标签是从流程的description字段自动提取的(制作者的话题标签,如#operations)。通过update_store_flow(tags=...)写入的标签单独存储,只会在get_store_flow中可见 —— 它们不会出现在列表响应中。
get_store_flow
完整的缓存记录。关键字段:
| 类别 | 字段 |
|---|---|
| 身份 | name、displayName、environmentName、state、triggerType、triggerKind、tier、sharingType |
| 运行统计 | runPeriodTotal、runPeriodFails、runPeriodSuccess、runPeriodFailRate、runPeriodSuccessRate、runPeriodDurationAverage/Max/Min(毫秒)、runTotal、runFails、runFirst、runLast、runToday |
| 治理 | monitor(bool)、rule_notify_onfail(bool)、rule_notify_onmissingdays(number)、rule_notify_email(string)、log_notify_onfail(ISO)、description、tags |
| 新鲜度 | scanned(ISO)、nextScan(ISO) |
| 生命周期 | deleted(bool)、deletedTime(ISO) |
| JSON 字符串 | actions、connections、owners、complexity、definition、createdBy、security、triggers、referencedResources、runError —— 全部都需要 json.loads() 来解析 |
时长字段(
runPeriodDurationAverage、Max、Min)的单位是 毫秒。除以 1000 得到秒数。
runError以 JSON 字符串形式包含上一次运行的错误。解析它:json.loads(record["runError"])—— 无错误时返回{}。
get_store_flow_summary
某个时间窗口内的聚合统计(默认:最近 7 天)。
{
"flowKey": "Default-<envGuid>.<flowGuid>",
"windowStart": null,
"windowEnd": null,
"totalRuns": 82,
"successRuns": 81,
"failRuns": 1,
"successRate": 0.988,
"failRate": 0.012,
"averageDurationSeconds": 2.877,
"maxDurationSeconds": 9.433,
"firstFailRunRemediation": null,
"firstFailRunUrl": null
}
当该流程在此窗口内没有运行数据时,返回全零。 使用
startTime和endTime(ISO 8601)参数来更改窗口。
get_store_flow_runs
直接返回缓存的运行记录数组。参数:startTime、endTime、
status(数组 —— 传入 ["Failed"] 仅查看错误,传入 ["Succeeded"],
或省略以查看全部)。
当窗口内没有运行数据时返回
[]。
触发器 URL
直接从 get_store_flow(缓存)或
get_live_flow(实时)读取 triggerUrl 字段。对于非 HTTP 触发器,它为 null。
启动 / 停止流程
使用 monitor-flow 服务包中的 set_live_flow_state。缓存在
下一次每日扫描时更新;如果你需要更快的缓存新鲜度,请在状态变更后
调用 get_live_flow 来确认,并让下一次扫描同步。
update_store_flow
更新治理元数据。仅更新提供的字段(合并)。
返回完整的更新后记录(形状与 get_store_flow 相同)。
可设置的字段:monitor(bool)、rule_notify_onfail(bool)、
rule_notify_onmissingdays(number,0=禁用)、
rule_notify_email(逗号分隔)、description、tags、
businessImpact、businessJustification、businessValue、
ownerTeam、ownerBusinessUnit、supportGroup、supportEmail、
critical(bool)、tier、security。
list_store_environments
直接返回数组。
[
{
"id": "Default-aaaaaaaa-...",
"displayName": "Flow Studio (default)",
"sku": "Default",
"type": "NotSpecified",
"location": "australia",
"isDefault": true,
"isAdmin": true,
"isManagedEnvironment": false,
"createdTime": "2017-01-18T01:06:46Z"
}
]
sku的取值:Default、Production、Developer、Sandbox、Teams。
list_store_connections
直接返回数组。可能非常大(1500+ 项)。
[
{
"id": "<environmentId>.<connectionId>",
"displayName": "[email protected]",
"createdBy": "{\"id\":\"...\",\"displayName\":\"...\",\"email\":\"...\"}",
"environmentName": "...",
"statuses": "[{\"status\":\"Connected\"}]"
}
]
createdBy和statuses是 JSON 字符串——使用json.loads()解析。
list_store_makers
直接返回数组。
[
{
"id": "09dbe02f-...",
"displayName": "Sample Maker",
"mail": "[email protected]",
"deleted": false,
"ownerFlowCount": 199,
"ownerAppCount": 209,
"userIsServicePrinciple": false
}
]
已删除的 maker 会有
deleted: true,且没有displayName/
get_store_maker
完整的 maker 记录。关键字段:displayName、mail、userPrincipalName、
ownerFlowCount、ownerAppCount、accountEnabled、deleted、country、
firstFlow、firstFlowCreatedTime、lastFlowCreatedTime、
firstPowerApp、lastPowerAppCreatedTime、
licenses(M365 SKU 的 JSON 字符串)。
list_store_power_apps
直接返回数组。
[
{
"id": "<environmentId>.<appId>",
"displayName": "My App",
"environmentName": "...",
"ownerId": "09dbe02f-...",
"ownerName": "Catherine Han",
"appType": "Canvas",
"sharedUsersCount": 0,
"createdTime": "2023-08-18T01:06:22Z",
"lastModifiedTime": "2023-08-18T01:06:22Z",
"lastPublishTime": "2023-08-18T01:06:22Z"
}
]
常见工作流
查找运行状况不佳的流
1. list_store_flows
2. Filter where runPeriodFailRate > 0.1 and runPeriodTotal >= 5
3. Sort by runPeriodFailRate descending
4. For each: get_store_flow for full detail
检查特定流的运行状况
1. get_store_flow → check scanned (freshness), runPeriodFailRate, runPeriodTotal
2. get_store_flow_summary → aggregated stats with optional time window
3. get_store_flow_runs(status=["Failed"]) → per-run failure detail with remediation hints
4. If deeper diagnosis needed → switch to live tools:
get_live_flow_runs → get_live_flow_run_action_outputs
启用流监控
1. update_store_flow with monitor=true
2. Optionally set rule_notify_onfail=true, rule_notify_email="[email protected]"
3. Run data will appear after the next daily scan
每日运行状况检查
1. list_store_flows
2. Flag flows with runPeriodFailRate > 0.2 and runPeriodTotal >= 3
3. Flag monitored flows with state="Stopped" (may indicate auto-suspension)
4. For critical failures → get_store_flow_runs(status=["Failed"]) for remediation hints
Maker 审计
1. list_store_makers
2. Identify deleted accounts still owning flows (deleted=true, ownerFlowCount > 0)
3. get_store_maker for full detail on specific users
清单
1. list_store_environments → environment count, SKUs, locations
2. list_store_flows → flow count by state, trigger type, fail rate
3. list_store_power_apps → app count, owners, sharing
4. list_store_connections → connection count per environment
相关技能
power-automate-mcp— 基础技能:连接设置、MCP 辅助工具、工具发现power-automate-debug— 深入诊断操作级输入/输出(实时 API)power-automate-build— 构建和部署流定义power-automate-governance— 治理元数据、标记、通知规则、CoE 模式