Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/http-backend/tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/index.ts","./src/routes/google_callback.ts","./src/routes/nodes.routes.ts","./src/routes/userRoutes/userMiddleware.ts","./src/routes/userRoutes/userRoutes.ts"],"version":"5.7.3"}
{"root":["./src/index.ts","./src/routes/google_callback.ts","./src/routes/nodes.routes.ts","./src/routes/userroutes/usermiddleware.ts","./src/routes/userroutes/userroutes.ts","./src/scheduler/token-scheduler.ts","./src/services/token-refresh.service.ts"],"version":"5.7.3"}
3 changes: 2 additions & 1 deletion apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@workspace/ui"],
transpilePackages: ["@workspace/ui", "@repo/db"],
serverExternalPackages: ["@prisma/client", "prisma"],
}

export default nextConfig
32 changes: 18 additions & 14 deletions apps/worker/src/engine/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,36 @@ export async function executeWorkflow(
status: "InProgress",
},
});
if(!update.error) console.log('updated the workflow execution')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Suspicious error check on Prisma update result.

The condition if(!update.error) will always be true because Prisma's update operation throws exceptions on errors rather than returning an object with an error field. If error checking is intended here, wrap the update in a try-catch block instead.

🔎 Proposed fix if error handling is needed
-  const update = await prismaClient.workflowExecution.update({
-    where: {
-      id: workflowExecutionId,
-    },
-    data: {
-      status: "InProgress",
-    },
-  });
-  if(!update.error) console.log('updated the workflow execution')
+  try {
+    await prismaClient.workflowExecution.update({
+      where: {
+        id: workflowExecutionId,
+      },
+      data: {
+        status: "InProgress",
+      },
+    });
+    console.log('updated the workflow execution')
+  } catch (error) {
+    console.error('Failed to update workflow execution:', error);
+    throw error;
+  }
🤖 Prompt for AI Agents
In @apps/worker/src/engine/executor.ts at line 37, The condition
`if(!update.error)` is wrong because Prisma's `update` throws on failure rather
than returning an `error` field; locate the Prisma call that assigns `update`
(e.g., `prisma.workflowExecution.update` in executor.ts), remove the
`if(!update.error)` check, and wrap the update call in a try-catch: on success
log the updated message (e.g., "updated the workflow execution"), and in the
catch log the error and either rethrow or handle it according to the surrounding
error-handling policy.


const nodes = data?.workflow.nodes;

console.log(`Total nodes - ${nodes.length}`)
for (const node of nodes) {
console.log(`${node.name}, ${node.position}th - started Execution`)
const nodeType = node.AvailableNode.type;
const context = {
nodeId: node.id,
// nodeId: node.id,
userId: data.workflow.userId,
credentialId: node.credentials[0]?.id,
credId: node.credentials[0]?.id,
Comment on lines +46 to +48
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's find and view the executor.ts file
find . -name "executor.ts" -type f | grep -v node_modules | head -20

Repository: Dev-Pross/BuildFlow

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Let's look at the structure around lines 46-48 in the executor file
if [ -f "apps/worker/src/engine/executor.ts" ]; then
  echo "=== File content around lines 40-55 ==="
  cat -n "apps/worker/src/engine/executor.ts" | sed -n '40,55p'
fi

Repository: Dev-Pross/BuildFlow

Length of output: 828


🏁 Script executed:

#!/bin/bash
# Search for all references to credentialId in TypeScript files
echo "=== Searching for 'credentialId' usage ==="
rg -n 'credentialId' --type ts -C 2 | head -100

Repository: Dev-Pross/BuildFlow

Length of output: 8361


🏁 Script executed:

#!/bin/bash
# Search for references to nodeId in executor-related files
echo "=== Searching for 'nodeId' in executor files ==="
rg -n 'nodeId' --type ts -g '*executor*' -C 2 | head -100

Repository: Dev-Pross/BuildFlow

Length of output: 470


🏁 Script executed:

#!/bin/bash
# Find all executor class implementations
echo "=== Finding executor implementations ==="
fd 'executor' --type f -e ts | grep -v node_modules | grep -v '.next'

Repository: Dev-Pross/BuildFlow

Length of output: 240


🏁 Script executed:

#!/bin/bash
# Find the NodeExecutionContext type definition
echo "=== Finding NodeExecutionContext definition ==="
rg -n "NodeExecutionContext" --type ts | head -20

Repository: Dev-Pross/BuildFlow

Length of output: 1426


🏁 Script executed:

#!/bin/bash
# Look at the types.ts or interface files
find . -name "types.ts" -o -name "*types.ts" | grep -v node_modules | head -10

Repository: Dev-Pross/BuildFlow

Length of output: 154


🏁 Script executed:

#!/bin/bash
# Check gmail executor implementation
if [ -f "packages/nodes/src/gmail/gmail.executor.ts" ]; then
  echo "=== Gmail executor context usage ==="
  cat -n "packages/nodes/src/gmail/gmail.executor.ts" | grep -A 5 -B 5 "context.cred"
fi

Repository: Dev-Pross/BuildFlow

Length of output: 482


🏁 Script executed:

#!/bin/bash
# Search for any usage of context.credentialId (the old field name)
echo "=== Searching for 'context.credentialId' usage ==="
rg -n 'context\.credentialId' --type ts

Repository: Dev-Pross/BuildFlow

Length of output: 113


🏁 Script executed:

#!/bin/bash
# Check if NodeExecutionContext is defined with credId or credentialId
echo "=== Searching for NodeExecutionContext definition ==="
rg -n "interface NodeExecutionContext|type NodeExecutionContext" --type ts -A 10

Repository: Dev-Pross/BuildFlow

Length of output: 1740


🏁 Script executed:

#!/bin/bash
# Check worker types.ts for NodeExecutionContext
if [ -f "apps/worker/src/types.ts" ]; then
  echo "=== Worker types.ts content ==="
  cat -n "apps/worker/src/types.ts"
fi

Repository: Dev-Pross/BuildFlow

Length of output: 576


🏁 Script executed:

#!/bin/bash
# Check if nodeId is used anywhere in the codebase
echo "=== Searching for references to node.id or nodeId usage ==="
rg -n "node\.id" --type ts apps/worker/src/engine/ -A 2 -B 2

Repository: Dev-Pross/BuildFlow

Length of output: 481


🏁 Script executed:

#!/bin/bash
# Search for any executor that might expect nodeId
echo "=== Checking if any code expects nodeId in context ==="
rg -n "context\.nodeId|nodeId" --type ts packages/nodes/ | head -20

Repository: Dev-Pross/BuildFlow

Length of output: 277


🏁 Script executed:

#!/bin/bash
# Check if there's a type mismatch - does credId match credentialsId?
echo "=== Checking type definition mismatch ==="
echo "Type definition in types.ts line 4:"
sed -n '4p' apps/worker/src/types.ts
echo ""
echo "Actual context object line 48 in executor.ts:"
sed -n '48p' apps/worker/src/engine/executor.ts
echo ""
echo "Executor interface definition in google-sheets:"
grep -A 5 "interface NodeExecutionContext" packages/nodes/src/google-sheets/google-sheets.executor.ts | head -6

Repository: Dev-Pross/BuildFlow

Length of output: 460


🏁 Script executed:

#!/bin/bash
# Search for any usage of context.credentialsId (the type definition name)
echo "=== Checking if credentialsId is used anywhere ==="
rg -n 'context\.credentialsId|credentialsId' --type ts | head -20

Repository: Dev-Pross/BuildFlow

Length of output: 166


🏁 Script executed:

#!/bin/bash
# Check if there are TypeScript compilation errors or type incompatibilities
echo "=== Looking for tsconfig and checking overall type structure ==="
find . -name "tsconfig.json" | head -5

Repository: Dev-Pross/BuildFlow

Length of output: 272


Fix type definition mismatch in ExecutionContext interface.

The context object passed to executors uses credId (line 48), but the ExecutionContext type definition in apps/worker/src/types.ts still declares it as credentialsId (line 4). Update the type definition to match:

credId?: string;  // instead of credentialsId?: string;

The nodeId being commented out is appropriate since it's optional in the type definition and no executor implementations use it.

🤖 Prompt for AI Agents
In @apps/worker/src/engine/executor.ts around lines 46 - 48, The
ExecutionContext type in apps/worker/src/types.ts is mismatched with the object
passed to executors: callers use credId but the type currently declares
credentialsId. Update the ExecutionContext interface by replacing or renaming
the property credentialsId?: string to credId?: string (optional) so it matches
the context passed from executor code (e.g., where credId is read in
executor.ts); leave nodeId optional as-is.

config: node.config as Record<string, any>,
inputData: currentInputData,
};

console.log(`Executing with context: ${context}`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix object logging to output readable JSON.

The template literal ${context} will output [object Object] instead of the actual context data, making this log useless for debugging. Use JSON.stringify() to properly serialize the object, as done correctly on line 66.

🔎 Proposed fix
-    console.log(`Executing with context: ${context}`)
+    console.log(`Executing with context: ${JSON.stringify(context, null, 2)}`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log(`Executing with context: ${context}`)
console.log(`Executing with context: ${JSON.stringify(context, null, 2)}`)
🤖 Prompt for AI Agents
In @apps/worker/src/engine/executor.ts at line 52, The console.log in
executor.ts is serializing the context with a template literal which yields
“[object Object]”; update the log in the function where `console.log(\`Executing
with context: ${context}\`)` appears to serialize the object using
JSON.stringify (match the existing approach used on line 66) — e.g., replace the
template interpolation with JSON.stringify(context, null, 2) so the context
prints as readable JSON while preserving the surrounding message.

const execute = await register.execute(nodeType, context);
if (!execute.success) {
await prismaClient.workflowExecution.update({
where: { id: workflowExecutionId },
data: {
status: "Failed",
error: execute.error,
completedAt: new Date(),
},
});
return;
}
// if (!execute.success) {
// await prismaClient.workflowExecution.update({
// where: { id: workflowExecutionId },
// data: {
// status: "Failed",
// error: execute.error,
// completedAt: new Date(),
// },
// });
// return;
// }
Comment on lines +54 to +64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Restore error handling for failed node executions.

The error handling block that marks workflows as "Failed" has been completely commented out. This means:

  1. If a node execution fails, the error is silently ignored
  2. The workflow continues processing subsequent nodes
  3. The workflow is marked as "Completed" even though it failed
  4. No error information is recorded in the database

This breaks the core execution contract and will mislead users about workflow success/failure status.

🔎 Proposed fix to restore error handling
     console.log(`Executing with context: ${context}`)
     const execute = await register.execute(nodeType, context);
-    // if (!execute.success) {
-    //   await prismaClient.workflowExecution.update({
-    //     where: { id: workflowExecutionId },
-    //     data: {
-    //       status: "Failed",
-    //       error: execute.error,
-    //       completedAt: new Date(),
-    //     },
-    //   });
-    //   return;
-    // }
+    if (!execute.success) {
+      await prismaClient.workflowExecution.update({
+        where: { id: workflowExecutionId },
+        data: {
+          status: "Failed",
+          error: execute.error,
+          completedAt: new Date(),
+        },
+      });
+      console.log(`Workflow failed at node ${node.name}: ${execute.error}`);
+      return;
+    }
     currentInputData = execute.output;
     console.log("output: ", JSON.stringify(execute))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// if (!execute.success) {
// await prismaClient.workflowExecution.update({
// where: { id: workflowExecutionId },
// data: {
// status: "Failed",
// error: execute.error,
// completedAt: new Date(),
// },
// });
// return;
// }
console.log(`Executing with context: ${context}`)
const execute = await register.execute(nodeType, context);
if (!execute.success) {
await prismaClient.workflowExecution.update({
where: { id: workflowExecutionId },
data: {
status: "Failed",
error: execute.error,
completedAt: new Date(),
},
});
console.log(`Workflow failed at node ${node.name}: ${execute.error}`);
return;
}
currentInputData = execute.output;
console.log("output: ", JSON.stringify(execute))
🤖 Prompt for AI Agents
In @apps/worker/src/engine/executor.ts around lines 54 - 64, Restore the omitted
error-handling branch so failed node executions stop the workflow: in the
executor where the execute result is checked (use execute.success and
execute.error), re-enable the prismaClient.workflowExecution.update call to set
status to "Failed", set error to execute.error and completedAt to new Date(),
then return early (use workflowExecutionId to identify the record) so subsequent
nodes are not processed and the workflow is not marked completed.

currentInputData = execute.output;
console.log("output: ", JSON.stringify(execute))
}
const updatedStatus = await prismaClient.workflowExecution.update({
where: { id: workflowExecutionId },
Expand Down
4 changes: 3 additions & 1 deletion apps/worker/src/engine/registory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ExecutionContext, ExecutionResult, NodeExecutor } from "../types.js";
import { GmailExecutor } from "@repo/nodes/nodeClient";
import {GoogleSheetsNodeExecutor} from "@repo/nodes/nodeClient";
class ExecutionRegistry {
private executors = new Map<string, NodeExecutor>();

Expand All @@ -19,7 +20,7 @@ class ExecutionRegistry {
};
}
try {
const result = await executor.execute(context);
const result = await executor.execute(context)
console.log("Execute result:", result);

return result;
Expand All @@ -38,6 +39,7 @@ class ExecutionRegistry {

//wehen visits this next time make sure chang gmail executor implements NodeExecutor
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in comment.

"wehen" should be "when".

🔎 Proposed fix
-    //wehen visits this next time make sure chang gmail executor implements NodeExecutor
+    //when someone visits this next time make sure to change gmail executor to implement NodeExecutor
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//wehen visits this next time make sure chang gmail executor implements NodeExecutor
//when someone visits this next time make sure to change gmail executor to implement NodeExecutor
🤖 Prompt for AI Agents
In @apps/worker/src/engine/registory.ts at line 40, Fix the typo in the comment
that reads "wehen visits this next time make sure chang gmail executor
implements NodeExecutor" by replacing "wehen" with "when" (so it reads "when
visits this next time..."); update the same comment text in registory.ts where
that comment appears to correct the spelling.

this.register("gmail", new GmailExecutor() as unknown as NodeExecutor);
this.register("google_sheet", new GoogleSheetsNodeExecutor() as unknown as NodeExecutor)
console.log(`The current Executors are ${this.executors.size}`);
}
}
Expand Down
3 changes: 3 additions & 0 deletions apps/worker/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Kafka } from "kafkajs";
import { executeWorkflow } from "./engine/executor.js";
import { register } from "./engine/registory.js";
const kafka = new Kafka({
// clientId: "Processing App",
clientId: "BuildFlow-Worker",
brokers: ["localhost:9092"],
});
const TOPIC_NAME = "First-Client";

register.initialize()

Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add error handling for executor initialization.

The register.initialize() call has no error handling. If initialization fails (e.g., executor registration throws an error), the worker will crash without a clear error message, making debugging difficult.

🔎 Proposed fix
-register.initialize()
-
+try {
+  register.initialize();
+  console.log("✅ Executors initialized successfully");
+} catch (error) {
+  console.error("❌ Failed to initialize executors:", error);
+  process.exit(1);
+}
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
register.initialize()
try {
register.initialize();
console.log("✅ Executors initialized successfully");
} catch (error) {
console.error("❌ Failed to initialize executors:", error);
process.exit(1);
}
🤖 Prompt for AI Agents
In @apps/worker/src/index.ts around lines 11 - 12, register.initialize() is
called with no error handling; wrap the initialization call
(register.initialize()) in a try/catch (and await it if it returns a Promise) so
any thrown/rejected error is caught, log the error with a clear message using
the existing logger (e.g., processLogger.error or console.error) including the
error details, and exit with a non‑zero status (process.exit(1)) to avoid an
uninformative crash and make failures visible.

async function main() {
const consumer = kafka.consumer({ groupId: "test-group" });
await consumer.connect();
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface ExecutionContext {
nodeId: string;
nodeId?: string;
userId: string;
credentialsId?: string;
config: Record<string, any>;
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/index.ts","./src/test.ts","./src/types.ts","./src/engine/executor.ts","./src/engine/registory.ts"],"version":"5.7.3"}
{"root":["./src/index.ts","./src/types.ts","./src/engine/executor.ts","./src/engine/registory.ts","./src/tests/create-execution.ts","./src/tests/setup-test.ts","./src/tests/test.ts","./src/tests/update-node.ts"],"version":"5.7.3"}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"turbo": "^2.7.2",
"typescript": "5.7.3"
},
"packageManager": "pnpm@10.26.2",
"packageManager": "pnpm@10.27.0",
"engines": {
"node": ">=20"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"dotenv": "^17.2.3",
"prisma": "^6.19.0"
}
}
}
3 changes: 2 additions & 1 deletion packages/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
// output = "../node_modules/.prisma/client"
}

datasource db {
Expand Down Expand Up @@ -117,8 +118,8 @@ model NodeExecution {
model WorkflowExecutionTable {
id String @id @default(uuid())
workflowExecutionId String @unique
sent Boolean @default(false)
workflowExecution WorkflowExecution @relation(fields: [workflowExecutionId], references: [id])
sent Boolean @default(false)
}

enum WorkflowStatus {
Expand Down
2 changes: 1 addition & 1 deletion packages/db/tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"root":["./src/index.ts","./src/seed.ts"],"version":"5.9.2"}
{"root":["./src/index.ts","./src/seed.ts"],"version":"5.7.3"}
4 changes: 2 additions & 2 deletions packages/nodes/src/common/google-oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class GoogleOAuthService {
`Failed to get all credentials: ${err instanceof Error ? err.message : "unknown error"}`
);
}

}
async updateCredentials(credentialId: string, tokens: Partial<OAuthTokens>): Promise<void> {
try{
const existing = await this.prisma.credential.findUnique({
Expand Down Expand Up @@ -164,7 +164,7 @@ class GoogleOAuthService {
}
}
}
}


export { GoogleOAuthService };
export type { OAuthTokens };
2 changes: 1 addition & 1 deletion packages/nodes/src/gmail/gmail.executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ class GmailExecutor {
}
}

export default GmailExecutor;
export { GmailExecutor } ;
// export { default as GmailExecutor } from "./gmail.executor.js";
// export { GmailService } from "./gmail.service.js";
43 changes: 43 additions & 0 deletions packages/nodes/src/gmail/gmail.node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import NodeRegistry from "../registry/node-registry.js";
import { GmailExecutor } from "./gmail.executor.js";

export class GmailNode {
static definition = {
name: "Gmail",
type: "gmail",
description: 'Communicate with Gmail',
config: {
fields:[
{
name: "From",
type: "email",
require: true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix typo: require should be required.

The property name require is incorrect and should be required to properly validate that these fields are mandatory. This typo appears on lines 14, 19, and 24.

🔎 Proposed fix
                {
                    name: "From",
                    type: "email",
-                   require: true
+                   required: true
                },
                {
                    name: "To",
                    type: "email",
-                   require: true
+                   required: true
                },
                {
                    name:"Body",
                    type: "textArea",
-                   require: true
+                   required: true
                }

Also applies to: 19-19, 24-24

🤖 Prompt for AI Agents
In @packages/nodes/src/gmail/gmail.node.ts at line 14, There are three typos
using the property name "require" in the Gmail node parameter definitions;
replace each "require" key with the correct validator key "required" (i.e.,
update every parameter object that currently has "require: true" to "required:
true") so the fields are properly validated; locate the occurrences by searching
for the string "require: true" in the gmail.node.ts parameter definitions and
change them to "required: true".

},
Comment on lines +12 to +15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for gmail-related service and executor implementations
find packages/nodes/src/gmail -type f -name "*.ts" | head -20

Repository: Dev-Pross/BuildFlow

Length of output: 186


🏁 Script executed:

# Look at the gmail.node.ts file structure to understand the From field context
wc -l packages/nodes/src/gmail/gmail.node.ts

Repository: Dev-Pross/BuildFlow

Length of output: 104


🏁 Script executed:

# Search for GmailExecutor and GmailService implementations
rg -l "GmailExecutor|GmailService" packages/nodes/src/gmail/ --type=ts

Repository: Dev-Pross/BuildFlow

Length of output: 186


🏁 Script executed:

# Read the entire gmail.node.ts file to understand context
cat -n packages/nodes/src/gmail/gmail.node.ts

Repository: Dev-Pross/BuildFlow

Length of output: 1532


🏁 Script executed:

# Read gmail.executor.ts to see how From field is used
cat -n packages/nodes/src/gmail/gmail.executor.ts

Repository: Dev-Pross/BuildFlow

Length of output: 2555


🏁 Script executed:

# Read gmail.service.ts to see OAuth and sender logic
cat -n packages/nodes/src/gmail/gmail.service.ts

Repository: Dev-Pross/BuildFlow

Length of output: 3754


Remove the "From" field entirely—it is never used and users are forced to enter a required value that is ignored.

The code extracts only to, subject, and body from config (line 57 in gmail.executor.ts), and the sendEmail method never sets a From header. Gmail API automatically uses the authenticated user's email when no From header is provided, making this field not just redundant but completely unused. Keeping it as required is confusing and misleading.

🤖 Prompt for AI Agents
In @packages/nodes/src/gmail/gmail.node.ts around lines 12 - 15, Remove the
unused "From" config field from the Gmail node definition (the field with name
"From" and type "email") so users are no longer required to supply it; update
the node's config/schema in gmail.node.ts to delete that field, remove any
validation or required-flag references to "From", and ensure gmail.executor.ts
continues to extract only to/subject/body (no change needed there) and that no
code attempts to read a "From" value; also remove or update any tests, docs, or
UI references that mention the "From" field to avoid confusion.

{
name: "To",
type: "email",
require: true
},
{
name:"Body",
type: "textArea",
require: true
}
]
Comment on lines +10 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing required "Subject" field for email composition.

Email messages typically require a subject line. The current configuration only includes From, To, and Body fields, but is missing a Subject field.

🔎 Suggested addition
            fields:[
                {
                    name: "From",
                    type: "email",
                    required: true
                },
                {
                    name: "To",
                    type: "email",
                    required: true
                },
+               {
+                   name: "Subject",
+                   type: "text",
+                   required: true
+               },
                {
                    name:"Body",
                    type: "textArea",
                    required: true
                }
            ]

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In @packages/nodes/src/gmail/gmail.node.ts around lines 10 - 26, The fields
array in the Gmail node definition is missing a required "Subject" entry; update
the fields array (alongside the existing "From", "To", and "Body" entries in
gmail.node.ts) to include a "Subject" field with an appropriate type (e.g.,
"string" or "text") and require: true so subject lines are captured for composed
emails; ensure the new field follows the same object shape as the other entries
and is inserted where form order makes sense.

},
requireAuth: true,
authType: 'google_oauth'

};

static async register(){
await NodeRegistry.register(this.definition)
// console.log(`✅ Registered node: ${this.definition.name}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Remove commented-out debug logs.

These commented console.log statements are debug artifacts that should be removed to keep the codebase clean.

🔎 Proposed cleanup
    static async register(){
        await NodeRegistry.register(this.definition)
-       // console.log(`✅ Registered node: ${this.definition.name}`);
        await NodeRegistry.registerTrigger(this.definition)
-       // console.log(`✅ Registered Trigger: ${this.definition.name}`);
    }

Also applies to: 37-37

🤖 Prompt for AI Agents
In @packages/nodes/src/gmail/gmail.node.ts at line 35, Remove the commented-out
debug console.log statements left in the Gmail node (e.g., the lines containing
"// console.log(`✅ Registered node: ${this.definition.name}`);" and any other
commented "console.log" instances around the registration logic); simply delete
these commented lines from the gmail.node.ts so only active code remains and no
commented debug artifacts are left.

await NodeRegistry.registerTrigger(this.definition)
// console.log(`✅ Registered Trigger: ${this.definition.name}`);
}

static getExecutor(){
return new GmailExecutor();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class GoogleSheetsNodeExecutor{
}

const operation = context.config.operation;
console.log("operation from sheet executor: ",operation)
switch(operation){
case 'read_rows':
return await this.executeReadRows(sheetService,context);
Expand Down
Loading