Skip to content

feat: cover workflow versions, data tables, and admin endpoints - #23

Merged
Hinne1 merged 4 commits into
mainfrom
claude/api-coverage
Oct 13, 2026
Merged

Hinne1 merged 4 commits into
mainfrom
claude/api-coverage

Conversation

@Hinne1

@Hinne1 Hinne1 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Covers the public API endpoints n8nctl was missing. Rebased onto main after #22 (source-control) merged.

Area Commands
Workflow versions workflow publish [--version], unpublish, archive, unarchive, delete, history, version <id> <version-id>; workflow view now shows draft vs published version IDs
Executions execution stop <id>, execution stop --status ... [--workflow] [--started-after/--started-before]
Data tables (dt) list, view, rows, insert, update, upsert, delete-rows with --where <col><op><value> / --filter <json> / --or / --dry-run
Credentials (cred) list, test, schema, delete
Tags list, create, rename, delete
Folders list, view, create, update, delete [--transfer-to] (all --project)
Users / members user list [--project], user view <id-or-email>, project member list/add/set-role/remove
Audit audit [--categories] [--days-abandoned]

Design notes:

  • The version state (versionId, activeVersionId, isArchived) is decoded into a separate WorkflowState instead of being added to Workflow. workflow pull serializes Workflow to disk, and these fields change on every save.
  • update, upsert and delete-rows require a filter. The server rejects a filterless row delete anyway, and the CLI also has no command that clears a whole table.
  • --where sends values as strings. On stage, n8n converted requestduration>1000 (number column) and id=1 correctly. Date columns do not compare exactly against the stored UTC timestamps (inserted>=2026-01-27T22:21:00Z returned a 22:19 row), so the README says to check date filters with rows or --dry-run first.
  • New command packages share a small cmdutil package (client, --json, cursor hint) instead of copying getClient/printJSON again. The existing packages are left as they are.
  • Deliberately not added: user create/delete/role changes (users come from SAML), data table create/delete and column management, community packages, log streaming, SSO/LDAP settings, promotions.

Testing

  • go test -race ./... and golangci-lint run ./... pass. httptest coverage includes request paths, query encoding, request bodies (including the empty {} publish body and filter JSON in the row-delete query), --where parsing (all operators, = inside values, empty values, bad input), --data parsing, and the stop flag validation.
  • Stage, read-only: wf view/history/version, cred list, tag list, user list, project member list, dt list/view/rows with >, =, ~, --sort and --json cursor. folder list returns 403 because the stage key has no folder:* scope.
  • Stage writes on throwaway resources, deleted afterwards:
    • Temp data table: insert (array and stdin), update --dry-run (verified nothing changed), update, upsert on an existing and a new key, delete-rows --or --dry-run, delete-rows, filterless delete-rows rejected. The table was then deleted (HTTP 204).
    • Temp workflow: publish, publish --version <older> (view shows "draft has unpublished changes"), unpublish, archive, unarchive, delete while published (n8n returns 409 "Unpublish it before deleting", now in the help text), then archive and delete (view returns 404 afterwards).
  • Council (2 rounds): fixed --filter/--data number precision (UseNumber), trailing data after the JSON value ({"a":1}] was accepted), config errors hidden behind a generic message, execution stop wording, and RFC 3339 validation for --started-after/--started-before. Folder move to the project root stays unsupported because the API has no documented way to do it; the help text says so.
  • Found while testing: workflow push to an already-published workflow re-publishes the new version right away. This is documented in the README.
  • Not run live: credential test (it calls external services), audit, tag create/rename/delete, folder writes (no scope), project member add/set-role/remove (would change real permissions), and bulk execution stop.

Adds workflow publish/unpublish/archive/unarchive/delete/history/version,
execution stop (single and bulk), and the datatable, credential, tag,
folder, user, project member, and audit commands. workflow view now shows
the draft and published version IDs.
@Hinne1
Hinne1 force-pushed the claude/api-coverage branch from 3639798 to a0fe7a5 Compare October 13, 2026 11:58
@Hinne1

Hinne1 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

🔏 Readiness attested — the pr-readiness-check gate completed for PR #23 at 795490eb75d16bdf7eba1adb6dd9e57ac3615df8 (2026-10-13T13:11:50Z). If the branch head has moved, this evidence covers the earlier state only.

Readiness summary

PR Readiness Check (#23, 795490e)
Review mode INITIAL
Branch/base PASS (rebased on origin/main incl. #22, clean, head pushed)
Local verification PASS (go vet, golangci-lint 0 issues, go test -race ./... incl. new trailing-JSON and timestamp tests); full suite REMOTE REQUIRED -> CI
Remote CI PASS (CI run 38401833392: lint, test; CodeQL run 38401828031); release.yml excluded (tag-triggered publish)
Coverage NOT REPORTED
Automated reviewers LIMITATION (n8n-cli not enrolled in Gemini Developer Connect)
Review threads PASS (0 unresolved)
Review comments PASS (open-review-comments.sh exit 0)
Council findings DISPOSITIONED (2 rounds. FIXED 6: number precision, trailing JSON, config error, stop wording, timestamp validation, README placeholders. DEFERRED 1 Minor: folder move to project root (no documented API value). REFUTED: missing client methods (exist in client.go), persistent flags, duplicate JSON keys, column names with spaces, delete query params, file-path --data. ADVISORY: role/EscapeHTML/user.PrintUsers import. Round 1 used 9 of 22 reviewers with findings; round 2 had 3 deepseek reviewers replaced by gemini fallback.)
Standards review DISPOSITIONED (with Council)
Spec review DISPOSITIONED (with Council)
PR description PASS
SQL/UI evidence SKIP (CLI only)
Notes: stage smoke on throwaway data table and workflow (all write commands), read-only list/view commands; dispositions in council-dispositions.md.
Result: READY

@Hinne1
Hinne1 marked this pull request as ready for review October 13, 2026 13:12
@Hinne1
Hinne1 merged commit afd1896 into main Oct 13, 2026
5 checks passed
@Hinne1
Hinne1 deleted the claude/api-coverage branch October 13, 2026 14:20
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