-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add create workflow execution functionality with parameters and… #3
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
#1) * feat: add create workflow execution functionality with parameters and API integration * feat: update Feather node options and enhance create workflow execution to conditionally include forwardingPhoneNumber * fix: update TypeScript version specification and format JSON files for consistency * fix: change default value of forwardingPhoneNumber parameter to null for better handling of optional input
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.
Greptile Overview
Summary
This PR introduces a new "Create Workflow Execution" operation to the Feather n8n node, enabling users to programmatically trigger workflow executions through the Feather API. The implementation adds a comprehensive form interface with required fields (workflowId, customerLeadId, primaryPhone) and optional fields (zipcode, state, forwardingPhoneNumber) along with flexible JSON-based metadata and variables support.The changes follow n8n's established patterns by creating separate description and execution files for the new operation. The main node file is updated to include the new operation in alphabetical order alongside existing operations like "Cancel Workflow Execution", "Create Agent Workflow", "Dispatch Phone Call", and "Get Workflows". The implementation includes proper error handling for JSON parsing, conditional parameter inclusion, and comprehensive logging for debugging purposes.
Additionally, the PR includes minor maintenance improvements such as formatting package.json for better readability and updating the TypeScript version from exact (5.9.2) to flexible versioning (^5.9.2) to allow for patch and minor updates within the 5.9.x range.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| nodes/Feather/operations/createWorkflowExecution.description.ts | 5/5 | New file defining comprehensive UI form configuration for workflow execution parameters |
| nodes/Feather/operations/createWorkflowExecution.ts | 4/5 | New operation implementation with parameter validation, JSON parsing, and API integration |
| nodes/Feather/Feather.node.ts | 4/5 | Main node file updated to include new operation with proper imports and alphabetical ordering |
| package.json | 5/5 | Minor formatting improvements and TypeScript version update for better maintainability |
Confidence score: 4/5
- This PR is generally safe to merge with the new functionality well-implemented following established patterns
- Score reflects solid implementation with proper error handling, though some debugging code should be cleaned up
- Pay close attention to nodes/Feather/operations/createWorkflowExecution.ts for console.log statements that should be removed before production
Sequence Diagram
sequenceDiagram
participant User
participant "n8n Workflow"
participant "Feather Node"
participant "Feather API"
User->>+"n8n Workflow": "Trigger workflow with Feather node"
"n8n Workflow"->>+"Feather Node": "Execute createWorkflowExecution operation"
"Feather Node"->>+"Feather Node": "Get node parameters (workflowId, customerLeadId, etc.)"
"Feather Node"->>+"Feather Node": "Build request body with parameters and metadata"
"Feather Node"->>+"Feather Node": "Parse JSON variables and additional metadata"
"Feather Node"->>+"Feather API": "POST /api/v1/workflow/{workflowId}/execution"
"Feather API"-->>-"Feather Node": "Return execution response"
"Feather Node"-->>-"n8n Workflow": "Return execution data"
"n8n Workflow"-->>-User: "Workflow execution completed"
4 files reviewed, 5 comments
| } else if (operation === 'createWorkflowExecution') { | ||
| returnData.push(await executeCreateWorkflowExecution.call(this, i, baseURL)); |
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.
logic: Missing credentials parameter in executeCreateWorkflowExecution call - other operations like getWorkflows and dispatchPhoneCall pass credentials as the third parameter
| baseURL: string, | ||
| ): Promise<INodeExecutionData> { | ||
| try { | ||
| console.log('Starting workflow execution creation...'); |
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.
style: Remove console.log statements in production code
| const body: Record<string, unknown> = { | ||
| customerLeadId, | ||
| primaryPhone, | ||
| zipcode, | ||
| state, | ||
| }; |
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.
style: Including null values in API payload might cause issues - consider excluding null fields entirely
| const body: Record<string, unknown> = { | |
| customerLeadId, | |
| primaryPhone, | |
| zipcode, | |
| state, | |
| }; | |
| const body: Record<string, unknown> = { | |
| customerLeadId, | |
| primaryPhone, | |
| }; | |
| // Only include optional fields if they have values | |
| if (zipcode) { | |
| body.zipcode = zipcode; | |
| } | |
| if (state) { | |
| body.state = state; | |
| } |
| }; | ||
|
|
||
| // Only include forwardingPhoneNumber if it's provided | ||
| if (forwardingPhoneNumber) { |
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.
style: Inconsistent handling - empty strings are falsy and won't be included, but null values in zipcode/state are included in payload
|
|
||
| body.metadata = metadata; | ||
|
|
||
| console.log('Preparing API request with execution data:', JSON.stringify(body, null, 2)); |
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.
style: Remove console.log statements in production code
* feat: add create workflow execution functionality with parameters and… (#1) (#3) * feat: add create workflow execution functionality with parameters and API integration * feat: update Feather node options and enhance create workflow execution to conditionally include forwardingPhoneNumber * fix: update TypeScript version specification and format JSON files for consistency * fix: change default value of forwardingPhoneNumber parameter to null for better handling of optional input Co-authored-by: Arijit Roy <[email protected]> * pointing CI to main branch --------- Co-authored-by: Saurabh Jain <[email protected]>
…… (#1)
feat: add create workflow execution functionality with parameters and API integration
feat: update Feather node options and enhance create workflow execution to conditionally include forwardingPhoneNumber
fix: update TypeScript version specification and format JSON files for consistency
fix: change default value of forwardingPhoneNumber parameter to null for better handling of optional input