Skip to Content
APIAnalytics

Analytics API

The Analytics API provides insights into workflow and direct execution performance, gas usage, and execution trends across your organization.

Get Analytics Summary

GET /api/analytics/summary

Returns aggregated analytics for the organization including run counts, success rates, and gas usage.

Query Parameters

ParameterTypeDescription
rangestringTime range: 24h, 7d, 30d, 90d, custom (default: 30d)
customStartstringISO timestamp for custom range start
customEndstringISO timestamp for custom range end

Response

{ "totalRuns": 1250, "successfulRuns": 1180, "failedRuns": 70, "successRate": 94.4, "totalGasUsedWei": "15000000000000000", "avgExecutionTimeMs": 2340 }

Field Definitions

FieldTypeDescription
totalRunsnumberCombined count of workflow executions and direct executions
successfulRunsnumberNumber of executions that completed successfully
failedRunsnumberNumber of executions that failed
successRatenumberPercentage of successful executions (0-100)
totalGasUsedWeistringTotal gas consumed in wei across both workflow executions and direct executions
avgExecutionTimeMsnumberAverage execution duration in milliseconds

Get Time Series Data

GET /api/analytics/time-series

Returns time-bucketed run counts for charting execution volume over time.

Query Parameters

Same as summary endpoint.

Response

{ "buckets": [ { "timestamp": "2024-01-01T00:00:00Z", "runCount": 42, "successCount": 40, "failedCount": 2 } ] }

Get Network Breakdown

GET /api/analytics/networks

Returns execution counts and gas usage grouped by blockchain network. Gas totals include both workflow executions and direct executions on each network.

Query Parameters

Same as summary endpoint.

Response

{ "networks": [ { "network": "ethereum", "runCount": 520, "gasUsedWei": "8000000000000000" }, { "network": "base", "runCount": 380, "gasUsedWei": "2500000000000000" } ] }

List Runs

GET /api/analytics/runs

Returns a unified list of both workflow executions and direct executions with pagination.

Query Parameters

ParameterTypeDescription
rangestringTime range filter (same as summary)
customStartstringISO timestamp for custom range start
customEndstringISO timestamp for custom range end
statusstringFilter by status: pending, running, success, error
sourcestringFilter by source: workflow, direct
limitnumberResults per page (default: 50)
cursorstringPagination cursor from previous response

Response

{ "runs": [ { "id": "exec_123", "source": "workflow", "workflowId": "wf_456", "workflowName": "Monitor ETH Balance", "status": "success", "createdAt": "2024-01-01T00:00:00Z", "completedAt": "2024-01-01T00:00:05Z", "durationMs": 5000 }, { "id": "direct_789", "source": "direct", "type": "transfer", "network": "ethereum", "status": "success", "transactionHash": "0x...", "gasUsedWei": "21000000000000", "createdAt": "2024-01-01T00:01:00Z", "completedAt": "2024-01-01T00:01:15Z" } ], "nextCursor": "cursor_abc123" }

Get Run Step Logs

GET /api/analytics/runs/{executionId}/steps

Returns detailed step-by-step logs for a specific execution.

Response

{ "steps": [ { "nodeId": "node_1", "nodeName": "Trigger", "status": "success", "input": {...}, "output": {...}, "durationMs": 120, "timestamp": "2024-01-01T00:00:00Z" } ] }

Get Spend Cap Data

GET /api/analytics/spend-cap

Returns current spending status against configured daily spending caps.

Response

{ "dailyCapWei": "100000000000000000", "spentTodayWei": "25000000000000000", "remainingWei": "75000000000000000", "percentUsed": 25.0 }

Stream Analytics (SSE)

GET /api/analytics/stream

Server-Sent Events endpoint for real-time analytics updates.

Query Parameters

Same as summary endpoint.

Event Format

data: {"type":"summary","data":{...}} data: {"type":"summary","data":{...}}

The stream sends updated summary data every 2 seconds when changes are detected, with automatic reconnection and heartbeat support.