Commit Graph

13 Commits

Author SHA1 Message Date
9c75b28cd7 Add WorkflowBuilder component and related modules
- Introduce `WorkflowBuilder` for visual workflow configuration
- Add child components: `WorkflowToolbar`, `StepConfigurationForm`, and `StepNode`
- Implement `WorkflowBuilderField` for integration with PayloadCMS
- Provide dynamic step type handling and JSON-based configuration editing
- Enhance UI with drag-and-drop functionality and step dependencies management
2025-09-11 21:32:55 +02:00
705ed331fa Remove migration guide, test helpers, and test setup files
- Delete `MIGRATION-v0.0.37.md` as it is no longer necessary
- Remove outdated files: `test-helpers.ts`, `test-setup.ts`, `test-trigger.ts`, and `vitest.config.ts`
- Streamline project by eliminating obsolete and unused test-related files and configurations
2025-09-11 13:03:07 +02:00
e0b13d3515 Remove obsolete test files and their associated cases
- Delete unused test files: `basic.test.ts`, `condition-fix.spec.ts`, `create-document-step.test.ts`, and `error-scenarios.spec.ts`
- Streamline codebase by eliminating redundant and outdated test cases
- Improve maintainability by keeping only relevant and up-to-date tests
2025-09-10 21:12:05 +02:00
acdfa411e4 Remove unused plugin modules and their associated tests
- Delete `init-global-hooks.ts`, `init-step-tasks.ts`, `init-webhook.ts`, and `init-workflow-hooks.ts`
- Remove obsolete components: `TriggerWorkflowButton` and `WorkflowExecutionStatus`
- Clean up unused trigger files: `webhook-trigger.ts`
- Delete webhook-related integration tests: `webhook-triggers.spec.ts`
- Streamline related documentation and improve maintainability by eliminating deprecated code
2025-09-10 18:08:25 +02:00
0f741acf73 Remove initCollectionHooks and associated migration guides
- Delete `initCollectionHooks` implementation and its usage references
- Remove `MIGRATION-v0.0.24.md` and `NOT-IMPLEMENTING.md` as they are now obsolete
- Update related workflow executor logic and TypeScript definitions, ensuring compatibility
- Simplify error handling, input parsing, and logging within workflow execution
- Clean up and refactor redundant code to improve maintainability
2025-09-10 17:36:56 +02:00
71ecca8253 Fix component import paths to use package imports
- Change component paths from relative to @xtr-dev/payload-automation/client#Component
- Use proper PayloadCMS plugin import syntax for components
- Regenerate import map with correct package-based imports
- Resolves 'Module not found' errors in dev project
2025-09-09 10:30:29 +02:00
2bc01f30f8 Fix TypeScript and ESLint errors, resolve component imports
- Fix TypeScript types in trigger-helpers with proper interfaces
- Remove all ESLint no-explicit-any warnings with better typing
- Fix component import paths from @/components/* to relative paths
- Regenerate import map with correct component references
- All compilation and linting errors resolved
2025-09-09 10:13:00 +02:00
74217d532d Implement independent error storage system and comprehensive improvements
Major Features:
• Add persistent error tracking for timeout/network failures that bypasses PayloadCMS output limitations
• Implement smart error classification (timeout, DNS, connection, network) with duration-based detection
• Add comprehensive test infrastructure with MongoDB in-memory testing and enhanced mocking
• Fix HTTP request handler error preservation with detailed context storage
• Add independent execution tracking with success/failure status and duration metrics

Technical Improvements:
• Update JSONPath documentation to use correct $.trigger.doc syntax across all step types
• Fix PayloadCMS job execution to use runByID instead of run() for reliable task processing
• Add enhanced HTTP error handling that preserves outputs for 4xx/5xx status codes
• Implement proper nock configuration with undici for Node.js 22 fetch interception
• Add comprehensive unit tests for WorkflowExecutor with mocked PayloadCMS instances

Developer Experience:
• Add detailed error information in workflow context with URL, method, timeout, attempts
• Update README with HTTP error handling patterns and enhanced error tracking examples
• Add test helpers and setup infrastructure for reliable integration testing
• Fix workflow step validation and JSONPath field descriptions

Breaking Changes: None - fully backward compatible

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 18:03:30 +02:00
04100787d7 Fix critical issues and enhance PayloadCMS automation plugin
## Critical Fixes Implemented:

### 1. Hook Execution Reliability (src/plugin/index.ts)
- Replaced fragile global variable pattern with proper dependency injection
- Added structured executor registry with initialization tracking
- Implemented proper logging using PayloadCMS logger instead of console
- Added graceful handling for executor unavailability scenarios

### 2. Error Handling & Workflow Run Tracking
- Fixed error swallowing in hook execution
- Added createFailedWorkflowRun() to track hook execution failures
- Improved error categorization and user-friendly error messages
- Enhanced workflow run status tracking with detailed context

### 3. Enhanced HTTP Step (src/steps/)
- Complete rewrite of HTTP request handler with enterprise features:
  - Multiple authentication methods (Bearer, Basic Auth, API Key)
  - Configurable timeouts and retry logic with exponential backoff
  - Comprehensive error handling for different failure scenarios
  - Support for all HTTP methods with proper request/response parsing
  - Request duration tracking and detailed logging

### 4. User Experience Improvements
- Added StatusCell component with visual status indicators
- Created ErrorDisplay component with user-friendly error explanations
- Added WorkflowExecutionStatus component for real-time execution monitoring
- Enhanced collections with better error display and conditional fields

### 5. Comprehensive Testing Suite
- Added hook-reliability.spec.ts: Tests executor availability and concurrent execution
- Added error-scenarios.spec.ts: Tests timeout, network, validation, and HTTP errors
- Added webhook-triggers.spec.ts: Tests webhook endpoints, conditions, and concurrent requests
- Fixed existing test to work with enhanced HTTP step schema

## Technical Improvements:
- Proper TypeScript interfaces for all new components
- Safe serialization handling for circular references
- Comprehensive logging with structured data
- Modular component architecture with proper exports
- Enhanced collection schemas with conditional field visibility

## Impact:
- Eliminates silent workflow execution failures
- Provides clear error visibility for users
- Makes HTTP requests production-ready with auth and retry capabilities
- Significantly improves debugging and monitoring experience
- Adds comprehensive test coverage for reliability

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-04 11:42:45 +02:00
c352da91fa Update generated payload types
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 19:15:55 +02:00
4adc5cbdaa Fix workflow condition evaluation to support comparison operators
- Implemented proper parsing for conditions like '$.trigger.doc.content == "value"'
- Added support for comparison operators: ==, !=, >, <, >=, <=
- Fixed JSONPath condition evaluation that was treating entire expressions as JSONPath queries
- Added support for string literals, numbers, booleans in condition values
- Conditions now correctly resolve JSONPath expressions and perform comparisons

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 19:42:21 +02:00
6397250045 Fix JSON circular reference serialization and use PayloadCMS generated types
- Replace duplicate type definitions with PayloadCMS generated types
- Fix workflow context serialization with safeSerialize() method
- Resolve type mismatches (id: string vs number)
- Update all imports to use PayloadWorkflow type
- Ensure workflow runs are created successfully without serialization errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-01 18:02:21 +02:00
2d84f535f4 Initial commit 2025-08-29 18:11:36 +02:00