Compare commits

..

5 Commits

Author SHA1 Message Date
czlonkowski
df816556e5 refactor: use modern executionOrder v1 as default instead of legacy v0
Changed minimal default settings from executionOrder: 'v0' (legacy) to
executionOrder: 'v1' (modern default) when providing fallback settings.

This ensures workflows use the modern execution order by default, which
provides better performance and more predictable execution behavior.

Updated all affected tests to expect 'v1' instead of 'v0'.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 18:55:48 +01:00
czlonkowski
dbd1406c43 fix: provide minimal default settings instead of omitting them
Issue: After fixing the description field removal, integration tests
started failing with "must have required property 'settings'" error.

Root cause: n8n API requires the settings property to be present in
workflow updates, but we were deleting it when no settings were
provided or when all settings were filtered out.

Solution: Instead of deleting settings, provide minimal valid default
settings (executionOrder: 'v0') to satisfy n8n API requirements while
avoiding "additional properties" errors.

This fixes both issues:
- Original #431: Empty settings {} causes "additional properties" error
- New issue: Missing settings causes "required property" error

Updated tests to expect minimal default settings instead of no settings.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 18:49:36 +01:00
czlonkowski
a78d7404c0 fix: filter out description field in workflow updates (issue #431)
Root Cause:
- n8n recently added a `description` field to workflows
- The field is returned by GET /workflows/:id endpoint
- But PUT /workflows/:id rejects it with "additional properties" error
- Our cleanWorkflowForUpdate() wasn't filtering it out

The Fix:
1. Added `description` to the list of removed fields in cleanWorkflowForUpdate()
2. Added `description` field to Workflow type definition
3. Added test case to verify description field is excluded

Code Review Improvements:
- Removed diagnostic logging code (was only needed for debugging)
- Improved comment accuracy in type definition
- Added comprehensive test coverage for description field

Testing:
- Build succeeds
- New test passes: "should exclude description field for n8n API compatibility"
- All unit tests pass
- Integration tests confirmed fix works with real n8n API

Related: #431

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
2025-11-20 18:30:36 +01:00
czlonkowski
f54d8b6caa fix: handle empty settings in workflow creation and update comments
Fixed two additional issues discovered in CI testing:

1. cleanWorkflowForCreate() now treats empty settings {} the same as
   missing settings - adds default settings in both cases

2. Updated outdated comments referencing old approach of using empty
   objects for safety

Root Cause:
- Tests were creating workflows with settings: {}
- Empty object {} is truthy in JavaScript, so the check !settings
  passed and no defaults were added
- This caused workflows to be created without proper settings
- Later autofix updates would then fail

Changes:
- Modified cleanWorkflowForCreate() line 107 to check both !settings
  and Object.keys(settings).length === 0
- Updated comment lines 157-172 to reflect current approach
- Now empty settings objects are handled consistently

Testing:
- All 75 unit tests in n8n-validation.test.ts passing
- Fixes CI integration test failures in autofix-workflow.test.ts

Related: #431

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
2025-11-20 16:47:54 +01:00
czlonkowski
d8a08947fa fix: resolve empty settings validation error in workflow updates (#431)
Fixed critical bug where n8n_update_partial_workflow failed with "request/body
must NOT have additional properties" error when workflows had no settings or
only non-whitelisted settings.

Root Cause:
- cleanWorkflowForUpdate() was sending empty settings: {} objects
- n8n API rejects empty settings as additional properties violation
- Occurred when workflow had no settings or only filtered properties

Changes:
- Modified cleanWorkflowForUpdate() to delete settings property when empty
- Enhanced applyUpdateSettings() to prevent creating empty settings
- Fixed 3 incorrect tests expecting empty settings objects
- Added 2 comprehensive tests for edge cases

Testing:
- All 75 unit tests in n8n-validation.test.ts passing
- Build and type checking successful
- New tests cover all empty settings scenarios

Related: #431, #248
Related n8n issue: n8n-io/n8n#19587

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
2025-11-20 16:33:42 +01:00

Diff Content Not Available