n8n/packages/cli/test/integration
Arvin Ansari a960366b7c
feat(core): Let the agent discover node preferences without reading workflows (no-changelog)
Adds the cheap bottom rung of preference discovery. `workflows(action="list")`
filters on the workflow name only — its own description says so — so learning
what a project reaches for meant fetching every workflow and reading its nodes.
On ten workflows that is ~6,500 tokens; the same answer from the dependency
index is ~85.

The index was already there. `WorkflowIndexService` records a `nodeType` row per
node per workflow and keeps it current from the same workflow events the
activity relay listens to — one records that something changed, the other what
it now contains. Nothing exposed it to the agent.

Two reads, both project-scoped from the start rather than retrofitted:
countNodeTypesForProjects returns the histogram with the scope total, and
findWorkflowsByNodeType names the workflows using one, most recently updated
first so the freshest example is the one worth reading. Draft rows only —
what someone is building says more about preference than what happens to be
published — and archived workflows excluded, since those are what the project
used to do.

Surfaced as `workflows(action="node-usage")`. The description states what it
cannot do rather than leaving the agent to over-trust it: node types only, and
parameter-level house style still needs a get. The response carries a note that
a type absent from the list is used by no workflow in scope, so an absence reads
as evidence rather than as a gap in the answer.

The activity block gains one line pointing at it, because the feed answers what
happened and not what the user tends to build. A sentence, not an injected
digest — discovery stays on demand.

The repository returns finished rows rather than ids. The first cut had the
adapter resolving names with In(...), which trips
misplaced-n8n-typeorm-import; pushing the join down fixed the boundary and
removed two round-trips, since the query already joins workflow_entity.

Verified: two integration tests assert a query cannot reach a project it was not
given. The ordering test was checked by inverting the ORDER BY and confirming it
fails. Its first version backdated a row with raw `UPDATE ... $1`, which SQLite
rejects outright — TypeORM was rewriting it, so the assertion was riding on a
driver detail; replaced with a query builder update that is driver-agnostic and
bypasses the @BeforeUpdate hook.
2026-08-26 16:11:24 +02:00
..
access-control feat(core): Add role:manageProject scope for project-role-only management (#33628) 2026-07-06 12:03:59 +00:00
agents fix(core): Resolve agent credentials through the node decryption path so external secrets work (#36275) 2026-08-14 15:02:44 +00:00
ai feat: Add admin-managed instance credentials (#34364) 2026-07-25 14:22:22 +00:00
collaboration feat(editor): Keep review-required toggle synchronized with open reviews (#34606) 2026-07-22 09:28:10 +00:00
commands fix(core): Only init the expression engine for commands that evaluate expressions (#36538) 2026-08-19 15:36:45 +00:00
controllers feat(API): Add endpoint to delete a custom role (#36417) 2026-08-18 09:10:10 +00:00
credentials feat(core): Restrict end-user credential creation to team projects (#36025) 2026-08-14 12:30:15 +00:00
database feat(core): Let the agent discover node preferences without reading workflows (no-changelog) 2026-08-26 16:11:24 +02:00
deduplication test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
dynamic-credentials chore(core): Add dynamic credential user storage (#24579) 2026-01-20 14:58:50 +00:00
dynamic-credentials.ee fix(core): Resolve end-user credentials when loading node parameters (#36452) 2026-08-18 13:39:48 +00:00
environments fix(core): Close review requests when a source control pull archives or cascade-deletes a workflow (#35798) 2026-08-07 17:52:12 +00:00
evaluation test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
eventbus test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
executions feat(core): Refuse durable pollers when an active workflow has duplicate trigger node ids (#36340) 2026-08-17 12:13:18 +00:00
external-secrets fix(core): Keep external secrets available while provider connections reload (#35237) 2026-07-31 13:33:12 +00:00
folder chore: Add no-application-error lint rule and ban new usage (no-changelog) (#33248) 2026-06-30 10:08:47 +00:00
insights chore: Bundle/2.x (#36558) 2026-08-19 07:57:44 +03:00
ldap test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
log-streaming feat: Enable log streamin settings via env vars (#29005) 2026-04-27 11:39:42 +00:00
mcp feat(core): Manage MCP settings via environment variables (#29368) 2026-04-29 11:29:18 +00:00
mfa test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
middlewares fix(core): Strip leading BOM before parsing webhook request bodies (#35933) 2026-08-10 12:45:59 +00:00
modules test(core): Add integration tests for runtime-credentials module (no-changelog) (#30910) 2026-05-21 15:11:41 +00:00
oidc chore: Bundle/2.x (#35563) 2026-08-05 08:29:40 +03:00
public-api feat(API): Add Git connections public API (no-changelog) (#36272) 2026-08-20 07:28:36 +00:00
saml fix(core): Show a clear no-access message when SSO role mapping denies a login (#36407) 2026-08-18 12:00:57 +00:00
scheduling feat(core): Coalesce a Schedule Trigger node's catch-up runs after downtime (#35524) 2026-08-14 13:04:09 +00:00
security-audit feat(core): Enable the UI to call the public API (no-changelog) (#35692) 2026-08-13 13:36:06 +00:00
services feat(API): Add endpoint to delete a custom role (#36417) 2026-08-18 09:10:10 +00:00
shared feat(API): Add Git connections public API (no-changelog) (#36272) 2026-08-20 07:28:36 +00:00
task-runners chore: Bundle/2.x (#35563) 2026-08-05 08:29:40 +03:00
token-exchange chore: Bundle/2.x (#34680) 2026-07-22 08:09:00 +00:00
workflows feat(core): Add system-authored workflow version publishing (no-changelog) (#36511) 2026-08-19 11:16:16 +00:00
activation-errors.service.test.ts refactor(core): Move integration test utils for insights (#16693) 2025-06-25 17:32:54 +02:00
active-workflow-manager.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
api-keys.api.test.ts fix(core): Fix non existent workflow id pathway for AIA (#35984) 2026-08-11 08:38:20 +00:00
auth.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
auth.mw.test.ts chore(core): Use roles from database in global roles (#18768) 2025-08-26 17:53:46 +02:00
binary-data.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
cta.service.test.ts feat(core): Use active version instead of current version (no-changelog) (#21202) 2025-11-20 17:47:24 +02:00
debug.controller.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
encryption-keys.api.test.ts feat(core): Server-side pagination, sorting, and filtering for encryption keys (#29708) 2026-05-06 09:20:14 +00:00
eventbus.ee.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
eventbus.test.ts chore(core): Use roles from database in global roles (#18768) 2025-08-26 17:53:46 +02:00
execution-context-propagation.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
execution-redaction.test.ts chore: Bundle/2.x (#34680) 2026-07-22 08:09:00 +00:00
execution.repository.test.ts fix(core): Recover enqueued executions after a restart (#35059) 2026-07-29 09:55:40 +00:00
execution.service.integration.test.ts fix(core): Add project ID and project name to log stream events (#33854) 2026-07-16 11:55:16 +00:00
executions-pruning.service.test.ts refactor(core): Introduce ExecutionPersistence service (#24857) 2026-01-27 09:59:51 +00:00
executions.controller.test.ts fix(core): Coerce the deleteBefore param when deleting executions (#36477) 2026-08-18 14:22:16 +00:00
healthcheck.controller.test.ts refactor(core): Move integration test utils for insights (#16693) 2025-06-25 17:32:54 +02:00
import.service.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
instance-ai-settings.service.test.ts feat: Configure the AI Assistant through a redesigned instance settings page (#34493) 2026-07-27 10:07:28 +00:00
license-metrics.repository.test.ts perf(core): Aggregate workflow statistics to avoid hot-row contention (#33045) 2026-07-06 11:11:18 +00:00
license.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
log-streaming.controller.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
manual-execution-credential-context.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
me.api.test.ts fix(core): Prevent SSO enforcement bypass via self-service settings API (#25330) 2026-02-05 12:58:39 +00:00
owner.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
password-reset.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
project.api.test.ts fix(core): Add project:manageUsers scope to gate project membership changes (#36243) 2026-08-19 18:43:35 +00:00
project.service.integration.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
prometheus-metrics.test.ts refactor(core): Extract shared cached metric query for Prometheus collectors (#33435) 2026-07-02 12:05:55 +00:00
provisioning-config.api.test.ts feat(core): Make SSO role mapping default condition configurable (#35023) 2026-07-28 08:53:48 +00:00
role-mapping-rule.api.test.ts fix(core): Shift existing rules on create to avoid order conflict (#28722) 2026-04-23 08:50:55 +00:00
role.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
tags.api.test.ts chore(core): Use roles from database in global roles (#18768) 2025-08-26 17:53:46 +02:00
test-run.repository.ee.test.ts refactor(core): Lintfix cli package (#17125) 2025-07-08 19:32:02 +02:00
user.repository.test.ts chore: Bundle 2.x (#28844) 2026-04-22 08:51:32 +03:00
users.api.test.ts feat(editor): Adds modal to see all projects a user can access in a list (#34619) 2026-07-21 12:43:16 +00:00
users.data-table.api.test.ts fix(editor): Transfer ownership or delete data tables when user deleted (#33037) 2026-06-26 10:28:39 +00:00
variables.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
wait-error-propagation.test.ts chore: Migrate packages/cli to Typescript 7 (#34159) 2026-07-15 11:49:51 +00:00
webhooks.api.test.ts fix(core): Handle errors from triggered and polled workflow executions (#35689) 2026-08-06 13:07:01 +00:00
webhooks.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
workflow-helpers.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
workflow-history-compaction.service.test.ts refactor(core): Move sleep into @n8n/utils and unify sleep/sleepWithAbort (#35057) 2026-07-28 18:47:18 +00:00
workflow-history-manager.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
workflow-history.api.test.ts test: Migrate cli package from Jest to Vitest (#31804) 2026-06-29 21:19:56 +03:00
workflow-hook-context.service.test.ts feat(core): Support checking for workflow tags existing in preExecute hook (#30440) 2026-05-19 18:23:18 +00:00
workflow-publication-trigger-status.repository.test.ts fix(core): Self-heal orphaned trigger status rows on unpublish (no-changelog) (#34443) 2026-07-20 15:17:11 +00:00
workflow-tag-mapping.repository.integration.test.ts refactor(core): Lintfix cli package (#17125) 2025-07-08 19:32:02 +02:00