flowstudio-power-automate-monitoring

flowstudio-power-automate-monitoring

热门

需要订阅 Pro+。使用 FlowStudio MCP 缓存数据存储进行全租户 Power Automate 监控:失败率、运行健康趋势、创作者/应用资产清单、非活跃所有者以及合规/健康报告。仅用于聚合的租户视图。对于单个环境、单个流程、运行控制或根因调试,请使用 flowstudio-power-automate-mcp、flowstudio-power-automate-debug 或服务器 monitor-flow 捆包。需要 FlowStudio for Teams 或 MCP Pro+。

4万Star
5048Fork
更新于 2026/10/1
SKILL.md
只读
名称
flowstudio-power-automate-monitoring
描述

需要订阅 Pro+。使用 FlowStudio MCP 缓存数据存储进行全租户 Power Automate 监控:失败率、运行健康趋势、创作者/应用资产清单、非活跃所有者以及合规/健康报告。仅用于聚合的租户视图。对于单个环境、单个流程、运行控制或根因调试,请使用 flowstudio-power-automate-mcp、flowstudio-power-automate-debug 或服务器 monitor-flow 捆包。需要 FlowStudio for Teams 或 MCP Pro+。

使用 FlowStudio MCP 进行 Power Automate 监控

通过 FlowStudio MCP 缓存数据存储(快速读取、无 PA API 速率限制,并补充了治理元数据和修复提示)监控流程健康状况、跟踪失败率并盘点租户资产。

⚠️ 需要订阅 Pro+。 此技能调用的 store_* 工具仅对 FlowStudio for Teams 或 MCP Pro+ 订阅者有效。

如果用户未获取 Pro+ 权限: 首次调用 store_* 工具将返回 403/404 错误。当发生这种情况时:

  1. 停止调用存储工具
  2. 告知用户此功能需要订阅 Pro+
  3. 为他们提供链接:https://mcp.flowstudio.app/pricing
  4. 如果他们的问题可以使用实时工具解决(例如“列出单个环境中的流程”),建议改用 flowstudio-power-automate-mcp 技能

发现工具: 请通过 tool_search 而非 tools/list 加载工具 Schema — 常用监控工具可以通过 query: "select:list_store_flows,get_store_flow_summary" 进行调用,或使用 query: "skill:governance" 加载全套工具(服务器的治理捆包也涵盖了大部分监控读取工具 — 本技能与 flowstudio-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(如何选择流程)。

指定关键流程: 对业务关键流程使用带有 critical=true 的 update_store_flow。这将启用治理技能的通知规则管理,从而在关键流程上自动配置失败警报。


工具

工具 用途
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) vs 实时 (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

存储工具回答“发生了什么?”和“健康状况如何?”
实时工具回答“到底出了什么问题?”和“立即修复。”

如果 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": "user@contoso.com",
    "createdBy": "{\"id\":\"...\",\"displayName\":\"...\",\"email\":\"...\"}",
    "environmentName": "...",
    "statuses": "[{\"status\":\"Connected\"}]"
  }
]

createdBy 和 statuses 是 JSON 字符串 — 请使用 json.loads() 解析。

list_store_makers

直接数组。

[
  {
    "id": "09dbe02f-...",
    "displayName": "Sample Maker",
    "mail": "maker@contoso.com",
    "deleted": false,
    "ownerFlowCount": 199,
    "ownerAppCount": 209,
    "userIsServicePrinciple": false
  }
]

已删除的创作者带有 deleted: true,且没有 displayName/mail 字段。

get_store_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. 过滤 runPeriodFailRate > 0.1 且 runPeriodTotal >= 5 的流程
3. 按 runPeriodFailRate 降序排序
4. 针对每个流程:调用 get_store_flow 获取完整详情

检查特定流程的健康状况

1. get_store_flow → 检查 scanned(新鲜度)、runPeriodFailRate、runPeriodTotal
2. get_store_flow_summary → 聚合统计信息,可选指定时间窗口
3. get_store_flow_runs(status=["Failed"]) → 带有修复提示的单次运行失败详情
4. 如果需要更深入的诊断 → 切换到实时工具:
   get_live_flow_runs → get_live_flow_run_action_outputs

开启对某个流程的监控

1. 使用 monitor=true 调用 update_store_flow
2. (可选)设置 rule_notify_onfail=true, rule_notify_email="user@domain.com"
3. 运行数据将在下一次每日扫描后出现

每日健康检查

1. list_store_flows
2. 标记 runPeriodFailRate > 0.2 且 runPeriodTotal >= 3 的流程
3. 标记带有 state="Stopped" 的受监控流程(可能表示自动暂停)
4. 对于关键失败 → 调用 get_store_flow_runs(status=["Failed"]) 获取修复提示

创作者审计

1. list_store_makers
2. 识别仍拥有流程的已删除账户(deleted=true,ownerFlowCount > 0)
3. 调用 get_store_maker 获取特定用户的完整详情

资产盘点

1. list_store_environments → 环境数量、SKU、位置
2. list_store_flows → 按状态、触发器类型、失败率统计的流程数量
3. list_store_power_apps → 应用数量、所有者、共享情况
4. list_store_connections → 每个环境的连接数量

相关技能

  • flowstudio-power-automate-mcp — 基础技能:连接设置、MCP 助手、工具发现
  • flowstudio-power-automate-debug — 包含操作级输入/输出的深层诊断(实时 API)
  • flowstudio-power-automate-build — 构建和部署流程定义
  • flowstudio-power-automate-governance — 治理元数据、标签、通知规则、CoE 模式