Skip to content

feat(workflows): suggest account properties as output variables - #69489

Merged
arthurdedeus merged 4 commits into
masterfrom
posthog-code/workflow-account-output-suggestions
Jul 9, 2026
Merged

feat(workflows): suggest account properties as output variables#69489
arthurdedeus merged 4 commits into
masterfrom
posthog-code/workflow-account-output-suggestions

Conversation

@arthurdedeus

@arthurdedeus arthurdedeus commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

There is no easy way to add custom property or relationship variables to a Get account workflow node without running a live test or hand-typing result paths.

Closes #69417

Changes

  • Add custom_properties to the external account payload (contract, facade, view, nodejs mock) -- every team definition keyed by name, null when unset
  • Extend CreateActionType with getOutputMappingSuggestions for node-level suggestion hooks
  • Implement suggestions on the Get account node -- fetches custom property and relationship definitions and builds the correct dot or bracket result_path
  • Add suggestions loader and applySuggestion action to hogFlowOutputMappingLogic
  • Render suggestion chips in the output variables panel; clicking creates the mapping and workflow variable in one step

How did you test this code?

Python: hogli test products/customer_analytics/backend/test/test_external.py (36 pass; new test catches missing/null custom_properties in GET response)
Frontend: pnpm --filter=@posthog/frontend exec jest .../customer_analytics.test.ts --forceExit (24 pass; new cases cover dot vs bracket path and slug edge cases)

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

No

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored by a Claude sonnet sub-agent orchestrated in a PostHog Code session. Skills invoked: /writing-tests, /writing-kea-logics.

The bracket-path rule (custom_properties["name"] for names containing non-alphanumeric chars) exists because lodash get -- used at runtime in trackActionResult -- supports quoted bracket notation, so paths like custom_properties["MRR (net)"] resolve correctly. Names matching /^[A-Za-z0-9_]+$/ use the shorter dot form. Suggestions are best-effort (fetch failure returns []) to avoid blocking panel render when the definitions API is slow.

Orchestrator review pass added on top: datetime custom property values serialize as ISO strings (instead of being dropped to null), relationship suggestion keys are namespaced account_relationship_<slug> and deduped against slug collisions, and stale suggestions reset when switching nodes.


Created with PostHog Code

@arthurdedeus arthurdedeus added the feature/customer-analytics Feature Tag: Customer analytics label Jul 8, 2026
@arthurdedeus arthurdedeus self-assigned this Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Bundle size — 🔺 +4.3 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 69.87 MiB · 🔺 +4.3 KiB (+0.0%)

File Size Δ vs base
exporter/_parent/products/workflows/frontend/Workflows/WorkflowScene.js 157.4 KiB 🔺 +2.1 KiB (+1.4%)
posthog-app/_parent/products/workflows/frontend/Workflows/WorkflowScene.js 118.8 KiB 🔺 +2.1 KiB (+1.8%)

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.20 MiB · 22 files no change ███░░░░░░░ 28.0% of 4.29 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
8.07 MiB · 2,956 files no change █████████░ 87.2% of 9.25 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
789 B src/scenes/ChunkLoadErrorBoundary.tsx
668 B src/index.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
277.1 KiB ../node_modules/.pnpm/posthog-js@1.398.2/node_modules/posthog-js/dist/rrweb.js
266.9 KiB ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
224.6 KiB src/taxonomy/core-filter-definitions-by-group.json
213.6 KiB ../node_modules/.pnpm/posthog-js@1.398.2/node_modules/posthog-js/dist/module.js
164.0 KiB src/queries/validators.js
154.0 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
105.7 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
90.5 KiB ../node_modules/.pnpm/@tiptap+core@3.20.1_@tiptap+pm@3.20.1/node_modules/@tiptap/core/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

⚠️ Dist folder size — 🔺 +25.4 KiB (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1433.71 MiB · 🔺 +25.4 KiB (+0.0%)

@arthurdedeus
arthurdedeus force-pushed the posthog-code/workflow-account-output-suggestions branch from 178f7b1 to 6f3f7bb Compare July 8, 2026 20:58
@trunk-io

trunk-io Bot commented Jul 8, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@arthurdedeus
arthurdedeus marked this pull request as ready for review July 9, 2026 16:42
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested review from a team July 9, 2026 16:43
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(workflows): suggest account propert..." | Re-trigger Greptile

Generated-By: PostHog Code
Task-Id: b3e66e59-1d03-418b-8f37-8905450bf848
Generated-By: PostHog Code
Task-Id: 39cf55c0-834c-42f0-8778-14449131c449
Generated-By: PostHog Code
Task-Id: 39cf55c0-834c-42f0-8778-14449131c449
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🦔 Hogbox preview · ✅ ready

▶ Open the preview

🔑 Login test@posthog.com / 12345678 (demo data)
🧩 Running this PR's backend and frontend, on the PostHog :master base
🔗 Link stable across rebuilds — a re-push swaps the box underneath, the URL stays
🔒 Access tailnet only (PostHog VPN)
💤 Idle sleeps after ~30 min idle (snapshot to S3, zero node cost) and wakes on your next visit in ~30s, behind a brief "waking up" screen

commit e6daa3a · box box-d8f81849a67e · ready in 443s (push → usable) · build log · rebuilds on every push, torn down on close

The rebase onto master picked up the tightened HogFlowAction config
discriminated union, so reading `config.template_id` directly no longer
type-checks. Guard with `'template_id' in config` (matching the existing
pattern in WorkflowsTable) and pass an explicit payload to the
loadSuggestions loader action.

Generated-By: PostHog Code
Task-Id: 7ddf7961-ab27-4bb9-ac38-c46d4fa8ae3d

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additive external API field (customer_analytics is the author's own team) plus a contained, well-tested workflows frontend suggestion feature; the one greptile concern was resolved with a substantiated technical reply and a bot 👍, and the known scaling edge case is transparently documented in COMPROMISES.md rather than hidden.

  • Author wrote 25% of the modified lines and has 76 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 196L, 8F substantive, 287L/11F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (287L, 11F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ bf52e45 · reviewed head e6daa3a

@arthurdedeus
arthurdedeus merged commit cc6440b into master Jul 9, 2026
379 of 384 checks passed
@arthurdedeus
arthurdedeus deleted the posthog-code/workflow-account-output-suggestions branch July 9, 2026 20:41
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-09 21:02 UTC Run
prod-us ✅ Deployed 2026-07-09 21:12 UTC Run
prod-eu ✅ Deployed 2026-07-09 21:15 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/customer-analytics Feature Tag: Customer analytics stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflows: expose account custom properties and relationships as pickable variables

2 participants