Credential list pagination shipped
The AI builder's list-credentials tool now supports pagination, letting admins with large credential vaults query their setup without hitting prompt length limits.
When admins with many credentials tried to list their credentials through Instance AI, they hit a wall: the prompt grew too long and the request failed. The root cause was straightforward — every credential carried timestamps and metadata into the AI prompt, stacking up unnecessary token cost with each entry.
The fix strips the list tool down to the essentials: id, name, and type per credential. A new pagination layer sits on top, with a default limit of 50 and a hard cap of 200, plus a total count so the AI knows how many pages remain. Admins can now ask the AI to list all credentials and it will page through them in chunks rather than choking on a single overloaded prompt.
Behind the scenes, the CredentialSummary type lost its createdAt and updatedAt fields entirely. The field stays on the internal interface for setup-workflow sorting, but it never reaches the AI prompt. For single credential lookups via get-credential, the full detail including timestamps remains available — the cleanup targeted the list endpoint specifically.
The change lives in the n8n instance-ai package, touching the AI builder tools that power the in-app AI assistant.
View Original GitHub Description
Summary
- Adds
limit/offsetpagination to thelist-credentialstool (default 50, max 200) with atotalcount, so the AI can page through large credential sets instead of loading everything into the prompt - Drops
createdAtfromCredentialSummary(no consumer uses it) and stripsupdatedAtfrom the tool output (kept on the interface for internal sorting insetup-workflow.service.ts) - Only exposes
id,name,typeto the AI prompt — reducing per-credential token cost
Fixes the "prompt too long" error for admins with many credentials.
Review / Merge checklist
- Tests pass (8 new tests for pagination + 61 related tests green)
-
CredentialDetailstill carriescreatedAt/updatedAtforget-credentialsingle lookups -
setup-workflow.service.tssorting byupdatedAtis unaffected (field stays onCredentialSummary)
Test plan
- As an admin with 50+ credentials, open Instance AI and ask it to list credentials — verify it returns a paginated result with
total - Verify the AI can paginate through all credentials using
offset - Verify filtering by
typestill works - Verify no timestamps appear in the AI's credential list output