analytics.
Fetch
GET https://workflows.pingmee.co.il/workflows/{workflowId} (URL-encode the id). Same Cookie + x-api-key as other Workflows calls.
analytics is present on the Expert AI plan. If the field is missing, do not invent numbers — tell the user the plan may not include canvas analytics. If it is present but totalStarted is 0, there is nothing to analyze yet (new workflow or a reset).
List (POST /workflows) returns minimal { id, name, folderId } only — it does not include analytics.
GET a fresh document immediately before you edit. A graph PUT prunes stats for removed node / edge / button ids. After you rewrite ids, old keys no longer match.
Shape
Still in progress:
max(0, totalStarted - totalCompleted - totalDropped).
Conversion (what the board shows): totalCompleted / totalStarted.
Edge keys and sourceHandle
Root outgoing edges use sourceHandle: "out". Sub-node outgoing edges (answers, If true/false, switch cases, fallback) use "in". Older runs may key a branch by the sub-node id instead of "in" — look up both {source}->{target}:in and {source}->{target}:{sourceNodeId}.
If/Else and switch paths are node + edge stats on the branch sub-node, not buttonStats.
Buttons
buttonStats maps to answer sub-nodes. Compare clickCount among siblings that share parentNodeId. A click also increments the answer’s nodeStats.enteredCount and the parent’s exitedCount.
Interpret
Use only fields that exist. Rank by counts; do not invent percentages the API does not store.Act
- GET the workflow. Keep
analytics,lastModified,data,parsedData, andtrigger. - If
analyticsis missing, stop (plan gating). IftotalStartedis0, say there is no data yet. - Propose concrete graph edits, for example: reroute or rewrite low-click buttons, add a fallback / timeout, change copy, split an If condition, or add a path after a drop-off node.
- PUT both
dataandparsedDataplustrigger/triggerType/variables, echoinglastModified. On 409, GET again and retry. - If the workflow is inactive, activate with
PUT { "isActive": true }only (no graph fields). - Do not send
analyticson PUT. The server prunes stats for node / edge / button ids that no longer exist on the new graph; totals stay. New or renamed ids have no stats until new executions.
Reset (optional)
POST /workflows//analytics/reset zeros every counter. It is destructive. Call it only when the user explicitly asks. Expert AI only (403 otherwise). The response is the updated workflow; use its lastModified on the next graph PUT.