feat(api): added workflows api route for dynamic discovery#2892
feat(api): added workflows api route for dynamic discovery#2892waleedlatif1 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryAdded API key-authenticated endpoints for programmatic workflow discovery, addressing issue #1335. The implementation includes:
The implementation correctly uses API key authentication via Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ListAPI as GET /api/v1/workflows
participant DetailAPI as GET /api/v1/workflows/[id]
participant Middleware as checkRateLimit
participant DB as Database
participant InputExtractor as extractInputFieldsFromBlocks
Client->>ListAPI: Request workflows list
ListAPI->>Middleware: Verify authentication and rate limits
Middleware-->>ListAPI: Authentication successful
ListAPI->>ListAPI: Validate query parameters
ListAPI->>DB: Query workflows with permissions check
DB-->>ListAPI: Return filtered workflows
ListAPI->>ListAPI: Apply cursor pagination
ListAPI-->>Client: Return paginated workflows
Client->>DetailAPI: Request specific workflow
DetailAPI->>Middleware: Verify authentication and rate limits
Middleware-->>DetailAPI: Authentication successful
DetailAPI->>DB: Query workflow by ID with permissions
DB-->>DetailAPI: Return workflow metadata
DetailAPI->>DB: Query workflowBlocks
DB-->>DetailAPI: Return block definitions
DetailAPI->>InputExtractor: Extract input fields from blocks
InputExtractor-->>DetailAPI: Return input fields with descriptions
DetailAPI-->>Client: Return complete workflow details
|
...l/components/deploy/components/deploy-modal/components/general/components/api-info-modal.tsx
Outdated
Show resolved
Hide resolved
|
@greptile |
| setParamDescriptions(descriptions) | ||
| initialParamDescriptionsRef.current = { ...descriptions } | ||
| } | ||
| }, [open, workflowMetadata, inputFormat]) |
There was a problem hiding this comment.
Effect resets form state when store values change
Medium Severity
The useEffect that initializes the form includes workflowMetadata and inputFormat in its dependency array. Since these values are derived from Zustand stores that can update independently, any change to them while the modal is open will re-run the effect and reset all form state (description and paramDescriptions), discarding the user's unsaved edits. This also occurs during save: when setValue updates the subblock store, inputFormat changes, triggering the effect to reset the form before onOpenChange(false) closes the modal.
Summary
Fixes #1335
Type of Change
Testing
Tested manually
Checklist