Outcome
Read workspace-scoped automation and run metrics in the canonical dashboard widget.
Before you start
- Verify authenticated identity, environment and the approved organization context before preparing an action.
- The published application permission is workspace:read. Discover and bind the exact granted Flow workspace. Supplied ids do not grant access.
Discover the target
topolo whoami --json
topolo actions get app_topolo_flow.widget.get --detail --json
topolo resources topolo-flow --json
topolo workspaces list topolo-flow --json
- Set FLOW_WORKSPACE_ID to the exact id returned by granted workspace discovery.
Request
GET /api/widget
Inspect and test this action. Save the exact input object as payload.json; resource context is supplied separately.
Input fields
Use an empty input object. Identity and resource context are separate from action input.
View the full input schema through the action reference or CLI/MCP discovery.
Effects
- Reads active and total flow counts plus retained run count for the granted workspace; a missing workspace produces the documented empty widget rather than granting organization-wide access.
Interpret the response
Read $.widgets[].id for the returned widget identifier. An empty collection does not discover a target.
Compare widgets[].resource with the granted workspace and interpret metrics/state; a ready empty dataset has zero counts.
View the complete success schema. Success examples below preserve the actual exported Worker responses; errors have their original refusal shapes. CLI/MCP add their transport envelope, and --detail requests the full CLI response.
Worked examples
Captured from the actual exported Flow Worker with both local SQLite D1 stores and all committed migrations, synthetic Auth identity/grants and simulated Nexus, archive and Workflow-acceptance transports. Fixture credentials and identifiers authorize no live operation. No live provider invocation, credential storage, notification delivery, metering acceptance, durable Workflow execution, deployment, backup erasure or production completion is established by these captures. Refused examples explain boundaries and must not be executed as successful workflows.
Successful request
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Nexus/archive transport. No live credentials, provider calls, delivery, deployment or durable Workflow execution proof. Scenario: widget.get.
Input · payload.json:
{}
CLI:
topolo actions validate app_topolo_flow.widget.get --data @payload.json --json
topolo actions plan app_topolo_flow.widget.get --resource-type workspace --resource-id "$FLOW_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_flow.widget.get --resource-type workspace --resource-id "$FLOW_WORKSPACE_ID" --data @payload.json --detail --json
MCP tool and arguments:
{
"tool": "topolo_read_action",
"arguments": {
"actionId": "app_topolo_flow.widget.get",
"input": {},
"resourceType": "workspace",
"resourceId": "<id returned by granted resource discovery>"
}
}
Captured local response · HTTP 200:
{
"success": true,
"contractVersion": "3.0.0",
"appId": "app_topolo_flow",
"serviceName": "Flow",
"generatedAt": "2026-10-05T16:41:57.904Z",
"widgets": [
{
"id": "flow.workspace-summary",
"version": "3.0.0",
"type": "stats",
"presentation": {
"title": "Flow workspace",
"description": "0 active automations, 0 total, 0 runs.",
"contexts": [
"workspace"
],
"supportedSizes": [
"compact",
"medium",
"wide"
],
"defaultSize": "medium"
},
"resource": {
"resourceType": "workspace",
"resourceId": "ws_flow_fixture",
"requiredPermissions": [
"workspace:read"
]
},
"state": {
"status": "ready",
"observedAt": "2026-10-05T16:41:57.903Z",
"lastSuccessfulAt": "2026-10-05T16:41:57.903Z"
},
"refresh": {
"intervalSeconds": 60,
"timeoutSeconds": 10,
"maxAgeSeconds": 60,
"staleWhileRevalidateSeconds": 120
},
"configuration": {
"allowMultipleInstances": true,
"fields": [
{
"key": "metricKeys",
"label": "Metrics",
"type": "multi-select",
"required": true,
"options": [
{
"value": "active_flows",
"label": "Active flows"
},
{
"value": "total_flows",
"label": "Total flows"
},
{
"value": "runs",
"label": "Runs"
}
]
}
],
"defaults": {
"metricKeys": [
"active_flows",
"total_flows",
"runs"
]
}
},
"drilldowns": [
{
"id": "workspace",
"label": "Open Flow workspace",
"href": "/dashboard/workspace"
},
{
"id": "runs",
"label": "Review runs",
"href": "/dashboard/runs"
}
],
"controls": [],
"localization": {
"locale": "en",
"titleKey": "flow.widget.title",
"descriptionKey": "flow.widget.summary"
},
"accessibility": {
"label": "Flow workspace metrics",
"description": "0 active automations, 0 total, 0 runs."
},
"contribution": {
"summary": "Automation inventory and execution activity for the selected Flow workspace.",
"identity": {
"iconSource": "catalog"
},
"workspaceSelector": {
"mode": "required",
"resourceType": "workspace",
"label": "Flow workspace",
"supportsMultiple": false
},
"metricDefinitions": [
{
"key": "active_flows",
"label": "Active flows",
"description": "Automations currently active in the workspace.",
"unit": "count",
"semantic": "gauge",
"aggregation": "last"
},
{
"key": "total_flows",
"label": "Total flows",
"description": "All automations in the workspace.",
"unit": "count",
"semantic": "gauge",
"aggregation": "last"
},
{
"key": "runs",
"label": "Runs",
"description": "Automation runs recorded in the workspace.",
"unit": "count",
"semantic": "counter",
"aggregation": "count"
}
],
"seriesDefinitions": [],
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"description": "The workspace whose automation data is included.",
"valueType": "string"
},
{
"key": "automation_measure",
"label": "Automation measure",
"description": "The inventory or execution measure represented by the metric.",
"valueType": "string"
}
],
"lifecycleStages": [],
"events": [
{
"key": "flow_activated",
"label": "Flow activated",
"description": "An automation became active."
},
{
"key": "run_recorded",
"label": "Run recorded",
"description": "An automation run was recorded."
}
],
"datasets": [
{
"id": "automation_operations",
"label": "Automation operations",
"description": "Workspace-scoped automation inventory and execution totals.",
"grain": "One aggregate row per selected Flow workspace and automation measure.",
"metricKeys": [
"active_flows",
"total_flows",
"runs"
],
"seriesKeys": [],
"dimensionKeys": [
"workspace_scope",
"automation_measure"
],
"eventKeys": [
"flow_activated",
"run_recorded"
],
"actionIds": []
}
],
"compatibleVisualizations": [
"number",
"bar",
"table"
],
"defaultVisualization": "bar"
},
"metrics": [
{
"key": "active_flows",
"label": "Active flows",
"value": 0,
"unit": "count",
"semantic": "gauge",
"aggregation": "last",
"period": {
"start": "2026-10-05T16:41:57.903Z",
"end": "2026-10-05T16:41:57.903Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "active_flows"
}
]
},
{
"key": "total_flows",
"label": "Total flows",
"value": 0,
"unit": "count",
"semantic": "gauge",
"aggregation": "last",
"period": {
"start": "2026-10-05T16:41:57.903Z",
"end": "2026-10-05T16:41:57.903Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "total_flows"
}
]
},
{
"key": "runs",
"label": "Runs",
"value": 0,
"unit": "count",
"semantic": "counter",
"aggregation": "count",
"period": {
"start": "2026-10-05T16:41:57.903Z",
"end": "2026-10-05T16:41:57.903Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "runs"
}
]
}
],
"appId": "app_topolo_flow",
"serviceName": "Flow",
"lastUpdated": "2026-10-05T16:41:57.904Z"
}
],
"workspace": {
"id": "ws_flow_fixture",
"name": "Fixture automations"
},
"workspaces": [
{
"id": "ws_flow_fixture",
"name": "Fixture automations",
"isDefault": true
}
]
}
HTTP 200. Compare widgets[].resource with the granted workspace and interpret metrics/state; a ready empty dataset has zero counts.
Another supported response
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Nexus/archive transport. No live credentials, provider calls, delivery, deployment or durable Workflow execution proof. Scenario: widget.get.
Input · payload.json:
{}
CLI:
topolo actions validate app_topolo_flow.widget.get --data @payload.json --json
topolo actions plan app_topolo_flow.widget.get --resource-type workspace --resource-id "$FLOW_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_flow.widget.get --resource-type workspace --resource-id "$FLOW_WORKSPACE_ID" --data @payload.json --detail --json
MCP tool and arguments:
{
"tool": "topolo_read_action",
"arguments": {
"actionId": "app_topolo_flow.widget.get",
"input": {},
"resourceType": "workspace",
"resourceId": "<id returned by granted resource discovery>"
}
}
Captured local response · HTTP 200:
{
"success": true,
"contractVersion": "3.0.0",
"appId": "app_topolo_flow",
"serviceName": "Flow",
"generatedAt": "2026-10-05T16:42:00.145Z",
"widgets": [
{
"id": "flow.workspace-summary",
"version": "3.0.0",
"type": "stats",
"presentation": {
"title": "Flow workspace",
"description": "1 active automation, 1 total, 1 run.",
"contexts": [
"workspace"
],
"supportedSizes": [
"compact",
"medium",
"wide"
],
"defaultSize": "medium"
},
"resource": {
"resourceType": "workspace",
"resourceId": "ws_flow_fixture",
"requiredPermissions": [
"workspace:read"
]
},
"state": {
"status": "ready",
"observedAt": "2026-10-05T16:42:00.145Z",
"lastSuccessfulAt": "2026-10-05T16:42:00.145Z"
},
"refresh": {
"intervalSeconds": 60,
"timeoutSeconds": 10,
"maxAgeSeconds": 60,
"staleWhileRevalidateSeconds": 120
},
"configuration": {
"allowMultipleInstances": true,
"fields": [
{
"key": "metricKeys",
"label": "Metrics",
"type": "multi-select",
"required": true,
"options": [
{
"value": "active_flows",
"label": "Active flows"
},
{
"value": "total_flows",
"label": "Total flows"
},
{
"value": "runs",
"label": "Runs"
}
]
}
],
"defaults": {
"metricKeys": [
"active_flows",
"total_flows",
"runs"
]
}
},
"drilldowns": [
{
"id": "workspace",
"label": "Open Flow workspace",
"href": "/dashboard/workspace"
},
{
"id": "runs",
"label": "Review runs",
"href": "/dashboard/runs"
}
],
"controls": [],
"localization": {
"locale": "en",
"titleKey": "flow.widget.title",
"descriptionKey": "flow.widget.summary"
},
"accessibility": {
"label": "Flow workspace metrics",
"description": "1 active automation, 1 total, 1 run."
},
"contribution": {
"summary": "Automation inventory and execution activity for the selected Flow workspace.",
"identity": {
"iconSource": "catalog"
},
"workspaceSelector": {
"mode": "required",
"resourceType": "workspace",
"label": "Flow workspace",
"supportsMultiple": false
},
"metricDefinitions": [
{
"key": "active_flows",
"label": "Active flows",
"description": "Automations currently active in the workspace.",
"unit": "count",
"semantic": "gauge",
"aggregation": "last"
},
{
"key": "total_flows",
"label": "Total flows",
"description": "All automations in the workspace.",
"unit": "count",
"semantic": "gauge",
"aggregation": "last"
},
{
"key": "runs",
"label": "Runs",
"description": "Automation runs recorded in the workspace.",
"unit": "count",
"semantic": "counter",
"aggregation": "count"
}
],
"seriesDefinitions": [],
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"description": "The workspace whose automation data is included.",
"valueType": "string"
},
{
"key": "automation_measure",
"label": "Automation measure",
"description": "The inventory or execution measure represented by the metric.",
"valueType": "string"
}
],
"lifecycleStages": [],
"events": [
{
"key": "flow_activated",
"label": "Flow activated",
"description": "An automation became active."
},
{
"key": "run_recorded",
"label": "Run recorded",
"description": "An automation run was recorded."
}
],
"datasets": [
{
"id": "automation_operations",
"label": "Automation operations",
"description": "Workspace-scoped automation inventory and execution totals.",
"grain": "One aggregate row per selected Flow workspace and automation measure.",
"metricKeys": [
"active_flows",
"total_flows",
"runs"
],
"seriesKeys": [],
"dimensionKeys": [
"workspace_scope",
"automation_measure"
],
"eventKeys": [
"flow_activated",
"run_recorded"
],
"actionIds": []
}
],
"compatibleVisualizations": [
"number",
"bar",
"table"
],
"defaultVisualization": "bar"
},
"metrics": [
{
"key": "active_flows",
"label": "Active flows",
"value": 1,
"unit": "count",
"semantic": "gauge",
"aggregation": "last",
"period": {
"start": "2026-10-05T16:42:00.145Z",
"end": "2026-10-05T16:42:00.145Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "active_flows"
}
]
},
{
"key": "total_flows",
"label": "Total flows",
"value": 1,
"unit": "count",
"semantic": "gauge",
"aggregation": "last",
"period": {
"start": "2026-10-05T16:42:00.145Z",
"end": "2026-10-05T16:42:00.145Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "total_flows"
}
]
},
{
"key": "runs",
"label": "Runs",
"value": 1,
"unit": "count",
"semantic": "counter",
"aggregation": "count",
"period": {
"start": "2026-10-05T16:42:00.145Z",
"end": "2026-10-05T16:42:00.145Z",
"timezone": "UTC"
},
"dimensions": [
{
"key": "workspace_scope",
"label": "Flow workspace",
"value": "ws_flow_fixture"
},
{
"key": "automation_measure",
"label": "Automation measure",
"value": "runs"
}
]
}
],
"appId": "app_topolo_flow",
"serviceName": "Flow",
"lastUpdated": "2026-10-05T16:42:00.145Z"
}
],
"workspace": {
"id": "ws_flow_fixture",
"name": "Fixture automations"
},
"workspaces": [
{
"id": "ws_flow_fixture",
"name": "Fixture automations",
"isDefault": true
}
]
}
HTTP 200. Compare widgets[].resource with the granted workspace and interpret metrics/state; a ready empty dataset has zero counts.
Refused request · HTTP 401
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Nexus/archive transport. No live credentials, provider calls, delivery, deployment or durable Workflow execution proof. Scenario: anonymous action.
Input · payload.json:
{}
CLI:
topolo actions validate app_topolo_flow.widget.get --data @payload.json --json
topolo actions plan app_topolo_flow.widget.get --resource-type workspace --resource-id "$FLOW_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 401:
{
"error": "Authentication token required"
}
HTTP 401. The handler refused this request. Resolve the exact cause before retrying; invalid input can be refused by CLI validation before reaching the handler.
Verify the result
- Compare widgets[].resource with the granted workspace and interpret metrics/state; a ready empty dataset has zero counts.
Errors and recovery
Authentication token required(HTTP 401): Authenticate normally in the approved environment and organization, verify identity, then rediscover the action and its granted resource before retrying.organization_required(HTTP 403): Authenticate into the specifically approved organization. Do not guess a different organization or bypass the refusal.action_permission_required(HTTP 403): The credential lacks the exact published application permission. Stop and obtain authorized access; changing target ids cannot grant it.workspace_required(HTTP 400): Discover an explicitly granted Flow workspace and bind its exact resource id.
Preserve the exact status, response, request id and resource context. Runtime input validation, authentication and platform resource resolution can refuse a request before the handler. Dynamic dependency messages are not stable provider error codes.
Recovery boundary
Re-discover the permitted workspace and retry this read; widget counts do not establish execution or delivery.
Related actions
- Get Flow statistics: Read workspace flow totals and run results from the preceding 24 hours.
- List Flow runs: Read the newest retained run records for the selected workspace.
Evidence
Captured from the actual exported Flow Worker with both local SQLite D1 stores and all committed migrations, synthetic Auth identity/grants and simulated Nexus, archive and Workflow-acceptance transports. Fixture credentials and identifiers authorize no live operation. No live provider invocation, credential storage, notification delivery, metering acceptance, durable Workflow execution, deployment, backup erasure or production completion is established by these captures. Original scenario labels and response digests are retained in the source fixtures.