You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a "Duplicate" button to Agents, MCP Servers, and Workflows that allows users to quickly create copies of their existing configurations. This feature would be positioned between the Edit and Delete icons in the action buttons area.
Issue: Duplicating "My Agent (Copy)" results in "My Agent (Copy) (Copy)" Solution:
Simple approach: Allow multiple "(Copy)" suffixes
Advanced: Check for existing names and use counter: "My Agent (Copy 2)"
Large Workflows
Issue: Workflows with 100+ nodes could cause timeouts Solution:
Set reasonable timeout limits
Consider background job processing for very large workflows
Add progress indicator for long operations
Permissions
Issue: Users might expect to duplicate public items from others Solution:
Currently scoped to owner-only duplication
Future enhancement: Add "Duplicate public item" with proper attribution
Visibility Propagation
Issue: Duplicating a public item might unintentionally create another public item Decision: Preserve visibility (as specified) Alternative: Could add user confirmation dialog for public duplicates
Database Constraints
Issue: Unique constraints on names could cause failures Solution: Database schema doesn't enforce unique names, so no issue
Concurrent Duplications
Issue: User rapidly clicking duplicate button Solution: Disable button during operation (loading state)
Testing Strategy
Unit Tests
Test duplicate API endpoints with valid/invalid inputs
Test permission checks (owner vs non-owner)
Test name generation logic
Test workflow ID mapping logic
Integration Tests
Test end-to-end duplication flow
Test database transaction rollback on errors
Test cache invalidation after duplication
Manual Testing Checklist
Duplicate agent with various visibility settings
Duplicate MCP server with complex config
Duplicate workflow with multiple nodes/edges
Test permission denial for non-owners
Verify toast notifications appear correctly
Test loading states and button disabling
Verify SWR cache updates correctly
Test keyboard accessibility
Test with slow network (loading states)
Open Questions for Maintainer
Naming strategy: Should we implement smart numbering ("Copy 1", "Copy 2") or keep simple suffix?
Visibility default: Should duplicates of public items remain public or default to private?
Future scope: Should we eventually allow duplicating public items from other users?
Workflow complexity: Is there a maximum workflow size where we should warn users before duplicating?
Internationalization: What i18n keys should be added? (e.g., "Agent.duplicated", "Agent.duplicateFailed", etc.)
Analytics: Should duplication events be tracked for usage metrics?
Technical Debt & Future Enhancements
Potential Improvements
Batch duplication (select multiple items and duplicate all)
"Duplicate as template" (strips personal data, resets to defaults)
Duplication history/lineage tracking
"Duplicate with modifications" dialog (change name/visibility before creating)
Code Quality
Extract common duplication logic into shared utility
Add comprehensive TypeScript types for duplication responses
Consider using server actions instead of API routes for consistency
Conclusion
This feature provides significant UX improvements with minimal architectural changes. The codebase is well-structured to support this addition, and the implementation can be phased to deliver value incrementally (Agents first, then MCP, then Workflows).
The duplicate button addresses a common user workflow and aligns with standard UI patterns found in similar applications (Notion, Figma, etc.).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Add a "Duplicate" button to Agents, MCP Servers, and Workflows that allows users to quickly create copies of their existing configurations. This feature would be positioned between the Edit and Delete icons in the action buttons area.
Visual Reference:
Motivation
User Pain Points
Current Workaround
Users must manually:
User Stories
As a power user, I want to duplicate my working agent configuration so I can experiment with different instruction sets without losing the original.
As a developer, I want to duplicate an MCP server configuration so I can create similar setups for different projects.
As a workflow designer, I want to duplicate complex workflows so I can create variations for different use cases.
As a team collaborator, I want to duplicate my own successful configurations to create new versions for different scenarios.
Proposed Solution
Design Specifications
UI/UX Design
Copyicon from lucide-react libraryNaming Convention
Visibility Settings
Permissions
Technical Implementation
Based on investigation of the codebase architecture:
Architecture Assessment
✅ Feasible - The codebase architecture fully supports this feature:
Required Changes
1. UI Components
File:
src/components/shareable-actions.tsx2. List Components
Files to modify:
src/components/agent/agents-list.tsxsrc/components/workflow/workflow-list-page.tsxsrc/components/mcp-dashboard.tsx/src/components/mcp-card.tsxAdd duplicate handler:
3. API Endpoints (New)
Files to create:
src/app/api/agent/[id]/duplicate/route.tssrc/app/api/mcp/[id]/duplicate/route.tssrc/app/api/workflow/[id]/duplicate/route.tsExample structure for agent duplication:
4. Database Operations
Files: Existing repository files (no changes needed)
src/lib/db/pg/repositories/agent-repository.pg.tssrc/lib/db/pg/repositories/mcp-repository.pg.tssrc/lib/db/pg/repositories/workflow-repository.pg.tsExisting methods can be reused:
selectAgentById()- Fetch originalinsertAgent()- Insert duplicate5. Special Consideration: Workflows
Workflows are more complex due to relational data:
Duplication logic must:
Implementation Roadmap
Phase 1: Agents (Simplest)
Estimated effort: 2-3 hours
Phase 2: MCP Servers
Estimated effort: 2-3 hours
Phase 3: Workflows (Most Complex)
Estimated effort: 4-6 hours
Phase 4: Polish & Testing
Estimated effort: 2-3 hours
Total estimated effort: 10-15 hours
Edge Cases & Considerations
Name Conflicts
Issue: Duplicating "My Agent (Copy)" results in "My Agent (Copy) (Copy)"
Solution:
Large Workflows
Issue: Workflows with 100+ nodes could cause timeouts
Solution:
Permissions
Issue: Users might expect to duplicate public items from others
Solution:
Visibility Propagation
Issue: Duplicating a public item might unintentionally create another public item
Decision: Preserve visibility (as specified)
Alternative: Could add user confirmation dialog for public duplicates
Database Constraints
Issue: Unique constraints on names could cause failures
Solution: Database schema doesn't enforce unique names, so no issue
Concurrent Duplications
Issue: User rapidly clicking duplicate button
Solution: Disable button during operation (loading state)
Testing Strategy
Unit Tests
Integration Tests
Manual Testing Checklist
Open Questions for Maintainer
Naming strategy: Should we implement smart numbering ("Copy 1", "Copy 2") or keep simple suffix?
Visibility default: Should duplicates of public items remain public or default to private?
Future scope: Should we eventually allow duplicating public items from other users?
Workflow complexity: Is there a maximum workflow size where we should warn users before duplicating?
Internationalization: What i18n keys should be added? (e.g., "Agent.duplicated", "Agent.duplicateFailed", etc.)
Analytics: Should duplication events be tracked for usage metrics?
Technical Debt & Future Enhancements
Potential Improvements
Code Quality
Conclusion
This feature provides significant UX improvements with minimal architectural changes. The codebase is well-structured to support this addition, and the implementation can be phased to deliver value incrementally (Agents first, then MCP, then Workflows).
The duplicate button addresses a common user workflow and aligns with standard UI patterns found in similar applications (Notion, Figma, etc.).
Beta Was this translation helpful? Give feedback.
All reactions