Endpoint
Path Parameters
Hook ID or PR number to retrieve flow data for. Accepts multiple formats:
- Hook ID with prefix:
hook-abc123 - Hook ID without prefix:
abc123 - PR number with prefix:
pr-123 - PR number without prefix:
123(interpreted as PR number if numeric)
/logs/api/pr-flow/hook-abc123-def456/logs/api/pr-flow/abc123-def456/logs/api/pr-flow/pr-123/logs/api/pr-flow/123
Response
The identifier used in the request (hook ID or PR number)
Array of workflow stage objects in chronological order
Total duration from first to last stage in milliseconds
Whether the workflow completed successfully (
true) or encountered errors (false)Error message if workflow failed (only present when
success is false)Workflow Stages
The endpoint identifies these standard workflow stages by matching log message patterns:- Webhook Received - Initial webhook processing started
- Validation Complete - Signature verification and payload validation completed
- Reviewers Assigned - OWNERS file processed and reviewers assigned
- Labels Applied - Labels and tags applied to PR
- Checks Started - Automated checks/tests/builds initiated
- Checks Complete - Checks passed successfully
- Processing Complete - Webhook processing finished
Stages are detected using pattern matching on log messages. Not all stages may be present for every webhook, depending on the event type and configuration.
Examples
Get flow data by hook ID
Get flow data by PR number
Get flow data with prefixes
Error Responses
No log data found for the specified identifier
Invalid identifier format
Internal server error during processing
Use Cases
Workflow Visualization
Display visual timeline of webhook processing:Performance Monitoring
Identify slow stages in webhook processing:Error Detection
Check for failed stages:Success Rate Tracking
Monitor webhook processing success:Performance Notes
- Memory-efficient: Uses streaming to process logs
- Processing limits:
- Maximum 15 most recent log files examined
- Maximum 10,000 entries processed per request
- Pattern matching: Identifies stages using configurable regex patterns
- Response time: Typically sub-second for recent webhooks
Stage Pattern Configuration
The stage detection uses these patterns (defined inLogViewerController.WORKFLOW_STAGE_PATTERNS):
Integration with Log Viewer UI
The PR flow endpoint is used by the log viewer web interface to display:- Visual timeline of webhook processing
- Stage-by-stage breakdown with timing
- Error highlighting for failed stages
- Total duration and success indicators
- Interactive stage details on hover/click