Skip to content

fix(workflows): bound the n8n inventory traversal and follow its cursor - #5829

Open
tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:fix/workflows-list-pagination-bounds-20260919
Open

tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:fix/workflows-list-pagination-bounds-20260919

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • get_n8n_workflows read only the first /api/v1/workflows page and returned it as the complete inventory — installs with >1 page silently showed the rest as not installed.
  • Follow nextCursor across pages inside one asyncio.timeout(5); a non-string or repeated cursor raises 502 instead of looping.
  • A failed page still yields an empty list (partial inventory is never presented as authoritative) and the 401/403 API-key guidance is preserved.
  • Covered by tests/test_workflow_pagination.py; full test_workflows.py suite still passes.

Why this matters

The workflow catalog misrepresented installed state for any n8n instance with enough workflows to paginate — the dashboard's single source of truth for "is it installed" was silently wrong past page one.

Overlap check

Test plan

  • python -m pytest tests/test_workflow_pagination.py tests/test_workflows.py — 49 passed locally.
  • CI dashboard-api suite.

get_n8n_workflows read a single page and returned it as the complete
inventory, so installs with more than one page of workflows silently
reported the rest as not installed. The session timeout also only bounded
the whole request loosely — a repeated or malformed nextCursor could keep
the handler looping.

Follow nextCursor across pages inside one 5-second asyncio.timeout, treat
a non-string or repeated cursor as a 502, and keep the existing 401/403
API-key guidance. A failed page still returns an empty list so a partial
inventory is never presented as authoritative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant