:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(canvas): document live task queries (#85467)
Adam Bowkerb4f9acee62a5
diff --git a/products/canvas/skills/querying-canvas-data/SKILL.md b/products/canvas/skills/querying-canvas-data/SKILL.mdindex 23ec2237562e..5bd2a56e2388 100644--- a/products/canvas/skills/querying-canvas-data/SKILL.md+++ b/products/canvas/skills/querying-canvas-data/SKILL.md@@ -100,6 +100,51 @@ product — rather than every tile resolving the insight's saved default.- Values are typed by the variable's definition in PostHog (String / Number / Boolean / Date / List);pass the same shape the insight expects, and an array for a multi-select List variable.+## Live Tasks data++For a task inbox, queue, or status board, query `system.tasks` and `system.task_runs` through+`ph.query`. Do not call `posthog:tasks-list` while authoring and embed its response: that produces a+snapshot, while the system tables keep the rendered canvas live.++The tables run as the signed-in viewer. They are project-scoped and require access to the Tasks+resource. `system.tasks` includes only non-internal tasks filed in live public spaces; it excludes+private, personal, unfiled, and internal tasks. Always exclude soft-deleted tasks explicitly.++Join a task to its latest run when the canvas needs current status:++```tsx+const data = await ph.query(`+ SELECT+ t.id,+ t.task_number,+ t.title,+ t.repository,+ t.created_by_id,+ t.created_at,+ t.updated_at,+ latest.status AS latest_run_status+ FROM system.tasks AS t+ LEFT JOIN (+ SELECT+ task_id,+ argMax(status, tuple(created_at, id)) AS status+ FROM system.task_runs+ GROUP BY task_id+ ) AS latest ON latest.task_id = t.id+ WHERE t.deleted = 0+ ORDER BY t.updated_at DESC+ LIMIT 100+`)+```++This is inline HogQL, so declare `capabilities.posthog.inlineQueries: true`. Render links with+`ph.navigate.toTask(id)` rather than constructing task URLs.++Do not promise filters the tables cannot express. `channel_id` is not queryable, so a canvas cannot+currently restrict this query to its own space. Filtering to the current viewer also requires a+known numeric user id; the canvas runtime does not inject one. State these limits when the request+depends on “this space” or “my tasks” instead of silently showing project-wide public tasks.+## Runtime memory — ph.stateDurable key-value storage per canvas. Declare every scope you use in `capabilities.posthog.state`