Skip to content

FE-2006: Identify flow definitions by their EntityId not just EntityUuid - #10075

Merged
CiaranMn merged 26 commits into
mainfrom
cm/fe-2006-flow-definition-entity-ids
Oct 20, 2026
Merged

CiaranMn merged 26 commits into
mainfrom
cm/fe-2006-flow-definition-entity-ids

Conversation

@CiaranMn

Copy link
Copy Markdown
Member

🌟 Purpose

Does the same thing for Flow Definitions as #10072 did for Flow Runs, i.e. pass their whole EntityId around instead of just the EntityUuid (so that the WebId is available).

🔍 Changes

Basically mechanical. The one worth thing noting is that for hardcoded Flow Definitions we have to look up the system web id (i.e. the h web) in order to construct the entity id for those definitions, because only the UUID is known in the code, and the h web has a new id in each instance.

⚠️ Known issues

Existing flow runs, schedules etc would fail – there are no such existing things in production.

@CiaranMn
CiaranMn requested a review from a team as a code owner October 18, 2026 13:34
@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Oct 20, 2026 7:22am UTC
hashdotdesign-tokens Ready Ready Preview Oct 20, 2026 7:22am UTC
petrinaut Ready Ready Preview Oct 20, 2026 7:22am UTC
petrinaut-docs Ready Ready Preview Oct 20, 2026 7:22am UTC

Request Review

@github-actions github-actions Bot added area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) labels Oct 18, 2026
@cursor

cursor Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches core flow start, schedule, and run-resolution paths with a breaking GraphQL/API shape change; mis-resolved web ids could target the wrong definition entity.

Overview
Flow definitions are now referenced by their full EntityId (web + uuid) instead of EntityUuid alone, across Temporal workflows, GraphQL, workers, frontend, and the browser plugin—mirroring the earlier change for flow runs.

API & execution: startFlow, schedules, inference websockets, and PDF analysis resolve the correct definition entity via getFlowDefinitionEntityById using web + uuid; RunFlowWorkflowParams, run memos, and flow-run Uses links carry flowDefinitionEntityId. Listing runs filters by full entity ids (with uuid-based graph filters where needed). Built-in HASH flows use generateHashFlowDefinitionEntityId / getHashWebId because only the definition uuid is fixed in code and the h web id is per instance.

UI & plugin: GraphQL and client code rename flowDefinitionId → flowDefinitionEntityId; definition pages build the id from route namespace + path uuid; navigation and worker filters use the owning web’s shortname and encoded entity ids. The plugin loads hashWebId from instance settings for the same helpers.

Reviewed by Cursor Bugbot for commit 441fd8b. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/apps labels Oct 18, 2026
@CiaranMn
CiaranMn requested a balanced review from Copilot and removed request for a team October 18, 2026 13:35
@CiaranMn
CiaranMn added this pull request to stack #10074 October 18, 2026 13:35
@CiaranMn
CiaranMn deployed to pull-request October 18, 2026 13:36 — with GitHub Actions Active
@CiaranMn
CiaranMn deployed to pull-request October 18, 2026 13:36 — with GitHub Actions Active
@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.01%. Comparing base (0cdb349) to head (441fd8b).

Files with missing lines Patch % Lines
...ckend-utils/src/flows/shared/get-flow-run-links.ts 0.00% 7 Missing ⚠️
...flow-activities/generate-flow-run-name-activity.ts 0.00% 6 Missing ⚠️
libs/@local/hash-backend-utils/src/flows.ts 0.00% 6 Missing ⚠️
...ntities-websocket/handle-infer-entities-request.ts 0.00% 3 Missing ⚠️
...-backend-utils/src/flows/shared/get-hash-web-id.ts 0.00% 3 Missing ⚠️
...-isomorphic-utils/src/flows/flow-definition-ids.ts 50.00% 3 Missing ⚠️
.../hash-isomorphic-utils/src/flows/frontend-paths.ts 0.00% 2 Missing ⚠️
...ker-ts/scripts/flow-scenarios/run-flow-scenario.ts 0.00% 1 Missing ⚠️
...h-api/src/graphql/resolvers/flows/flow-schedule.ts 66.66% 1 Missing ⚠️
...h-api/src/graphql/resolvers/flows/get-flow-runs.ts 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10075      +/-   ##
==========================================
- Coverage   68.02%   68.01%   -0.01%     
==========================================
  Files        2002     2003       +1     
  Lines      205905   205921      +16     
  Branches     8785     8786       +1     
==========================================
+ Hits       140057   140059       +2     
- Misses      64183    64197      +14     
  Partials     1665     1665              
Flag Coverage Δ
apps.hash-ai-worker-ts 6.85% <0.00%> (-0.01%) ⬇️
apps.hash-api 15.59% <25.00%> (-0.01%) ⬇️
local.hash-backend-utils 6.21% <0.00%> (-0.02%) ⬇️
local.hash-isomorphic-utils 32.01% <37.50%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e0a223a. Configure here.

Copilot AI 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.

🟡 Changes recommended

Flow submission is not gated on instance-settings readiness and can fail before starting a workflow.

1 open issue
What changed in this PR

Extends #10072’s full-entity-ID approach to flow definitions, preserving their web identity across execution and display.

Changes:

  • Updates GraphQL, workflow, and schedule contracts to use EntityId.
  • Resolves the instance-specific HASH web for built-in definitions.
  • Updates frontend navigation, filtering, and browser-plugin callers.
File Description
libs/​@local/​hash-isomorphic-utils/​src/​graphql/​type-defs/​knowledge/​flow.typedef.ts Updates GraphQL identifier contracts.
libs/​@local/​hash-isomorphic-utils/​src/​graphql/​queries/​flow.queries.ts Requests full definition IDs.
libs/​@local/​hash-isomorphic-utils/​src/​flows/​types.ts Updates local run types.
libs/​@local/​hash-isomorphic-utils/​src/​flows/​temporal-types.ts Updates workflow parameters.
libs/​@local/​hash-isomorphic-utils/​src/​flows/​schedule-types.ts Updates schedule input IDs.
libs/​@local/​hash-isomorphic-utils/​src/​flows/​frontend-paths.ts Updates definition links and filters.
libs/​@local/​hash-isomorphic-utils/​src/​flows/​flow-definition-ids.ts Adds built-in definition helpers.
libs/​@local/​hash-backend-utils/​src/​flows/​shared/​get-hash-web-id.ts Resolves the HASH web ID.
libs/​@local/​hash-backend-utils/​src/​flows/​shared/​get-flow-run-links.ts Preserves full definition link targets.
libs/​@local/​hash-backend-utils/​src/​flows/​shared/​get-flow-definition-entity-by-id.ts Scopes lookups by web and UUID.
libs/​@local/​hash-backend-utils/​src/​flows/​process-flow-workflow/​initialize-flow.ts Initializes runs with full IDs.
libs/​@local/​hash-backend-utils/​src/​flows/​process-flow-workflow/​common-activities/​get-flow-definition-activity.ts Loads definitions using full IDs.
libs/​@local/​hash-backend-utils/​src/​flows/​process-flow-workflow.ts Threads IDs through workflow processing.
libs/​@local/​hash-backend-utils/​src/​flows/​get-flow-run-details.ts Returns full definition IDs.
libs/​@local/​hash-backend-utils/​src/​flows.ts Updates run filtering and metadata.
apps/​plugin-browser/​src/​shared/​storage.ts Updates stored user and run types.
apps/​plugin-browser/​src/​shared/​get-user.ts Extracts the HASH web ID.
apps/​plugin-browser/​src/​scripts/​background/​infer-entities.ts Updates optimistic run IDs.
apps/​plugin-browser/​src/​pages/​popup/​popup-contents/​action-center/​shared/​use-flow-runs.ts Updates inference-run recognition.
apps/​plugin-browser/​src/​pages/​popup/​popup-contents/​action-center/​history/​shared/​table-label.tsx Builds full-ID history links.
apps/​plugin-browser/​src/​pages/​popup/​popup-contents/​action-center/​history/​manually-triggered.tsx Updates manual-run filtering.
apps/​plugin-browser/​src/​pages/​popup/​popup-contents/​action-center/​history/​automatically-triggered.tsx Updates automatic-run filtering.
apps/​plugin-browser/​src/​graphql/​queries/​user.queries.ts Requests instance settings.
apps/​plugin-browser/​src/​graphql/​queries/​flow.queries.ts Requests full definition IDs.
apps/​hash-frontend/​src/​pages/​workers.page/​flow-run-table.tsx Updates run filtering and classification.
apps/​hash-frontend/​src/​pages/​workers.page.tsx Passes renamed filter props.
apps/​hash-frontend/​src/​pages/​shared/​use-hash-flows.ts Adds built-in ID generation hook.
apps/​hash-frontend/​src/​pages/​shared/​use-flow-definitions.ts Loads web-scoped definitions.
apps/​hash-frontend/​src/​pages/​shared/​flow-definitions-context.ts Updates context identifier types.
apps/​hash-frontend/​src/​pages/​shared/​flow-definitions-context-provider.tsx Provides full selected IDs.
apps/​hash-frontend/​src/​pages/​goals/​new.page.tsx Starts goals with full IDs.
apps/​hash-frontend/​src/​pages/​goals.page/​goals-list.tsx Updates goal recognition.
apps/​hash-frontend/​src/​pages/​flows.page.tsx Updates definition rows and links.
apps/​hash-frontend/​src/​pages/​dashboard/​hooks/​use-dashboard-item-config.ts Updates dashboard workflow IDs.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​workers/​[run-id].page.tsx Selects definitions by full ID.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer/​topbar.tsx Builds web-aware definition navigation.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer/​run-flow-modal.tsx Schedules using full definition IDs.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer/​outputs.tsx Updates goal-output recognition.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer/​flow-run-sidebar.tsx Updates definition props and classification.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer/​dag-slide.tsx Updates diagram definition IDs.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​shared/​flow-visualizer.tsx Threads full IDs through visualization.
apps/​hash-frontend/​src/​pages/​@/​[shortname]/​flows/​[flow-def-id].page.tsx Reconstructs IDs from route namespaces.
apps/​hash-frontend/​src/​graphql/​queries/​knowledge/​flow.queries.ts Updates start-flow mutation arguments.
apps/​hash-api/​src/​graphql/​resolvers/​knowledge/​file/​shared.ts Resolves PDF-analysis definition IDs.
apps/​hash-api/​src/​graphql/​resolvers/​knowledge/​file/​request-file-upload.ts Supplies the graph client.
apps/​hash-api/​src/​graphql/​resolvers/​knowledge/​file/​create-file-from-url.ts Supplies the graph client.
apps/​hash-api/​src/​graphql/​resolvers/​flows/​start-flow.ts Starts workflows with full IDs.
apps/​hash-api/​src/​graphql/​resolvers/​flows/​shared/​get-runnable-flow-definition.ts Validates full-ID definition lookups.
apps/​hash-api/​src/​graphql/​resolvers/​flows/​get-flow-runs.ts Forwards full-ID filters.
apps/​hash-api/​src/​graphql/​resolvers/​flows/​flow-schedule.ts Updates schedule workflow arguments.
apps/​hash-api/​src/​graph/​knowledge/​system-types/​flow-schedule.ts Simplifies schedule input typing.
apps/​hash-api/​src/​ai/​infer-entities-websocket/​handle-infer-entities-request.ts Resolves built-in inference IDs.
apps/​hash-ai-worker-ts/​src/​workflows/​run-flow-workflow.ts Updates naming callback parameters.
apps/​hash-ai-worker-ts/​src/​shared/​testing-utilities/​mock-get-flow-context.ts Constructs full IDs in mocks.
apps/​hash-ai-worker-ts/​src/​activities/​flow-activities/​generate-flow-run-name-activity.ts Updates built-in flow recognition.

Review effort: Balanced

Comment thread apps/hash-frontend/src/pages/shared/use-hash-flows.ts
@CiaranMn
CiaranMn requested a review from kostandinang October 19, 2026 08:40
Comment thread libs/@local/hash-isomorphic-utils/src/flows/flow-definition-ids.ts
kostandinang
kostandinang previously approved these changes Oct 19, 2026
kostandinang
kostandinang previously approved these changes Oct 19, 2026
@CiaranMn
CiaranMn added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
Base automatically changed from cm/fe-1895-load-flow-definitions-from-graph to main October 19, 2026 18:31
@CiaranMn
CiaranMn added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 1065891 Oct 20, 2026
73 checks passed
@CiaranMn
CiaranMn deleted the cm/fe-2006-flow-definition-entity-ids branch October 20, 2026 07:48

This branch was successfully deployed

5 active (1 outdated) deployments
Preview – petrinaut-docs — 441fd8b2 Deployed Oct 20, 2026 by vercel[bot]
Preview – hash — 441fd8b2 Deployed Oct 20, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — 441fd8b2 Deployed Oct 20, 2026 by vercel[bot]
Preview – petrinaut — 441fd8b2 Deployed Oct 20, 2026 by vercel[bot]
pull-request — 024dd594 Deployed Oct 19, 2026 by CiaranMn via Sourcemaps (@apps/hash-ai-worker-ts) #40420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants