Merged
Size
L
Change Breakdown
Performance70%
Refactor30%
#27188fix(core): Improve performance of the push/pull modal getStatus

Project queries cached in push/pull status flow

Expensive project authorization lookups that ran repeatedly during git push/pull operations are now fetched once and cached, reducing database load during status checks.

When users run git push or pull operations, the system checks which workflows, credentials, and projects they can access. Previously, project authorization queries ran multiple times throughout the status check flow — once per resource type being evaluated.

A new context factory now pre-fetches all authorized projects and accessible workflow IDs upfront. This cached data gets attached to the SourceControlContext object and is reused across all subsequent authorization checks. The context builds lookup maps on initialization: a Set of authorized project IDs for fast membership checks, and Maps keyed by team ID and owner email for O(1) lookups when matching remote resources to local projects.

Status checks that previously ran sequentially now execute in parallel. Remote folder data, which was fetched redundantly in both workflow and folder status methods, is now prefetched once and passed through. The trade-off is loading all projects into memory — acceptable for most deployments even with thousands of projects.

The change touches source control modules in the CLI package. Developers working on source control integrations should find status operations faster, particularly in environments with many team projects or when users have access to multiple projects.

View Original GitHub Description

Summary

Moves the expensive query of looking up project relations multiple times in the getStatus check into a "temporary cache" and attaching it as "context" through the getStatus flow

This comes with a slight trade-off that it loads all projects into memory - but this should be relatively small even with 10,000's of projects.

Related Linear tickets, Github issues, and Community forum posts

LIGO-262

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

Review / Merge checklist

  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse