-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(api): added workflows api route for dynamic discovery #2892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 4 comments
...l/components/deploy/components/deploy-modal/components/general/components/api-info-modal.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
| setParamDescriptions(descriptions) | ||
| initialParamDescriptionsRef.current = { ...descriptions } | ||
| } | ||
| }, [open, workflowMetadata, inputFormat]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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