Skip to main content

Flow Analysis

Endpoints for analyzing flows and identifying potential issues or improvements.

Flow Analysis

GET /api/analysis/flows/verify-screen

Analyzes flows to identify those without verify_screen steps.

Response:

{
"success": true,
"data": {
"totalFlows": 50,
"totalMainFlows": 30,
"totalSubflows": 20,
"flowsWithoutVerifyScreen": [
{
"id": "flow-123",
"name": "Login Flow",
"isSubflow": false,
"stepCount": 5,
"hasVerifyScreen": false
}
],
"subflowsWithoutVerifyScreen": [
{
"id": "subflow-456",
"name": "Navigate to Settings",
"isSubflow": true,
"stepCount": 3,
"hasVerifyScreen": false
}
],
"summary": {
"hierarchiesWithoutVerifyScreen": 5,
"hierarchiesPartiallyWithVerifyScreen": 10,
"hierarchiesFullyWithVerifyScreen": 15
}
},
"message": "Flow analysis completed successfully"
}

Response Fields:

  • data: Analysis results object
    • totalFlows: Total number of flows analyzed
    • totalMainFlows: Number of main flows
    • totalSubflows: Number of subflows
    • flowsWithoutVerifyScreen: Array of main flows without verify_screen steps
    • subflowsWithoutVerifyScreen: Array of subflows without verify_screen steps
    • summary: Summary statistics
      • hierarchiesWithoutVerifyScreen: Number of flow hierarchies with no verify_screen steps
      • hierarchiesPartiallyWithVerifyScreen: Number of flow hierarchies with some verify_screen steps
      • hierarchiesFullyWithVerifyScreen: Number of flow hierarchies with all verify_screen steps

Error Response:

{
"success": false,
"error": "Error message",
"code": "ANALYSIS_ERROR",
"message": "Failed to analyze flows"
}

GET /api/analysis/flows/summary

Gets a summary of flow analysis without verify_screen steps.

Response:

{
"success": true,
"data": {
"totalFlows": 50,
"totalMainFlows": 30,
"totalSubflows": 20,
"summary": {
"hierarchiesWithoutVerifyScreen": 5,
"hierarchiesPartiallyWithVerifyScreen": 10,
"hierarchiesFullyWithVerifyScreen": 15
},
"quickStats": {
"flowsWithoutVerifyScreen": 8,
"subflowsWithoutVerifyScreen": 12,
"hierarchiesWithoutVerifyScreen": 5,
"hierarchiesPartiallyWithVerifyScreen": 10,
"hierarchiesFullyWithVerifyScreen": 15
}
},
"message": "Flow analysis summary retrieved successfully"
}

Response Fields:

  • data: Summary object
    • totalFlows: Total number of flows
    • totalMainFlows: Number of main flows
    • totalSubflows: Number of subflows
    • summary: Summary statistics
    • quickStats: Quick statistics for dashboard display

Flow Analysis Export

POST /api/analysis/flows/export

Exports flow analysis results in different formats.

Request Body:

{
"format": "json"
}

Supported Formats:

  • json: JSON format
  • markdown: Markdown format
  • csv: CSV format

Response (JSON format):

{
"success": true,
"data": {
"totalFlows": 50,
"flowsWithoutVerifyScreen": []
},
"message": "Flow analysis exported successfully"
}

Response (Markdown/CSV format):

  • Content-Type: text/markdown or text/csv
  • Content-Disposition: attachment; filename="flow-analysis-{timestamp}.{format}"
  • Body: Exported data in requested format

Error Responses:

Invalid format (400):

{
"success": false,
"error": "Invalid export format. Must be 'json', 'markdown', or 'csv'",
"code": "INVALID_EXPORT_FORMAT"
}

Export error (500):

{
"success": false,
"error": "Error message",
"code": "EXPORT_ERROR",
"message": "Failed to export flow analysis"
}

Usage Examples

Analyze Flows

curl -X GET http://localhost:3000/api/analysis/flows/verify-screen

Get Analysis Summary

curl -X GET http://localhost:3000/api/analysis/flows/summary

Export Analysis as JSON

curl -X POST \
-H "Content-Type: application/json" \
-d '{"format": "json"}' \
http://localhost:3000/api/analysis/flows/export

Export Analysis as Markdown

curl -X POST \
-H "Content-Type: application/json" \
-d '{"format": "markdown"}' \
-o analysis.md \
http://localhost:3000/api/analysis/flows/export

Export Analysis as CSV

curl -X POST \
-H "Content-Type: application/json" \
-d '{"format": "csv"}' \
-o analysis.csv \
http://localhost:3000/api/analysis/flows/export

Integration Notes

  • Analysis is performed on all flows in the system
  • Flow hierarchies include main flows and their subflows
  • Verify screen detection checks for verify_screen action type
  • Export formats are optimized for different use cases:
    • JSON: For programmatic processing
    • Markdown: For documentation and reports
    • CSV: For spreadsheet analysis
  • Analysis results are computed in real-time and not cached