Skip to content

Conversation

@Vamsi-o
Copy link
Contributor

@Vamsi-o Vamsi-o commented Jan 15, 2026

Summary by CodeRabbit

  • New Features

    • Added configuration status indicators (Configured/Not Configured badges) on workflow nodes.
    • Enhanced webhook trigger with auto-generated URL and copy-to-clipboard functionality.
    • Improved credential management for Google integrations in configuration modal.
    • Added toast notifications for save success and error feedback.
  • Chores

    • Updated Google Sheets action label for consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

…ents

- Simplified error handling in userRoutes for better readability.
- Removed unnecessary whitespace and improved console log formatting in WorkflowCanvas and ConfigModal components.
- Updated Prisma schema to enhance relationships between Credential and Trigger models, ensuring better data integrity.
- Added isConfigured prop to BaseNode for better configuration state management.
- Updated rendering logic in BaseNode to display configuration status.
- Refactored webhook trigger configuration to remove unnecessary fields and clarify its purpose.
- Improved error handling in ConfigModal for fetching credentials.
Copilot AI review requested due to automatic review settings January 15, 2026 16:05
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

This PR introduces credential management for node configuration by adding an isConfigured state flag to nodes and refactoring the configuration modal to dynamically render form fields and fetch credentials when needed. The onSave callback signature is updated to include node ID and user ID for proper state tracking across the workflow.

Changes

Cohort / File(s) Summary
Node Configuration & Public API
apps/web/app/components/nodes/BaseNode.tsx, apps/web/app/lib/nodeConfigs/webhook.trigger.ts, apps/web/app/lib/nodeConfigs/googleSheet.action.ts
Added isConfigured?: boolean prop to BaseNode with badge rendering (green/red); re-enabled and simplified webhookTriggerConfig with empty fields array; updated Google Sheets label to "Google Sheet"
Credential & API Layer
apps/web/app/lib/api.ts
Added getCredentials import; refactored Credentials.getCredentials to await and return res.data.Data; changed api.update to return axios.put promise
Configuration UI & State Management
apps/web/app/workflows/[id]/components/ConfigModal.tsx, apps/web/app/workflows/[id]/page.tsx
Major ConfigModal refactor: added per-node credential fetching, updated onSave signature to include selectedNode and userId, implemented dynamic field rendering by type (dropdown, textarea, input), added credential selection UI; Updated page.tsx: added isConfigured: false initialization for new nodes, implemented trigger/action identification for credential saving, updated onSave callback to persist isConfigured state after successful save

Sequence Diagram

sequenceDiagram
    participant User
    participant ConfigModal
    participant API
    participant Credentials
    participant Workflow Page

    User->>ConfigModal: Open config for node
    ConfigModal->>ConfigModal: Check if node requires credentials
    alt Node needs Google credentials
        ConfigModal->>API: fetch credentials
        API->>Credentials: getCredentials()
        Credentials-->>API: credential list
        API-->>ConfigModal: credentials
        ConfigModal->>User: Display credential selection
    end
    User->>ConfigModal: Select credential & save config
    ConfigModal->>Workflow Page: onSave(nodeId, config, userId)
    Workflow Page->>API: api.triggers.update or api.nodes.update
    API-->>Workflow Page: response
    Workflow Page->>Workflow Page: Set isConfigured = true
    Workflow Page->>ConfigModal: Close modal
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • Copilot

🐰✨ A config modal's dance, with credentials in hand,
Nodes now know if they're ready, isConfigured so grand!
Fetch, render, and save—the workflow's aligned,
With userId and nodeId, no state's left behind! 🎯

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix/config' is vague and generic, failing to convey what specific configuration issue is being fixed or what the primary changes accomplish. Replace with a descriptive title that explains the main change, such as 'Add isConfigured badge and improve node configuration flow' or 'Implement configuration status tracking for workflow nodes'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements configuration state tracking and enhanced configuration UI for workflow nodes. It fixes an import path case sensitivity issue and adds proper handling for node configuration status.

Changes:

  • Added isConfigured property to track configuration state for trigger and action nodes
  • Enhanced ConfigModal with dynamic form rendering, credential management, and improved UX (toast notifications, copy webhook URL)
  • Fixed import path case sensitivity issue (NODES → nodes)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
apps/web/app/workflows/[id]/page.tsx Fixed import path, added isConfigured tracking, updated onSave callback signature with excessive debug logging
apps/web/app/workflows/[id]/components/ConfigModal.tsx Implemented dynamic form rendering with field types (dropdown, textarea, input), credential fetching, and improved UI/UX
apps/web/app/lib/nodeConfigs/webhook.trigger.ts Minor whitespace change in commented code
apps/web/app/lib/nodeConfigs/googleSheet.action.ts Fixed label from "Google Sheets" to "Google Sheet"
apps/web/app/lib/api.ts Added return statement to triggers.update, refactored getCredentials to return data directly, added unused import
apps/web/app/components/nodes/BaseNode.tsx Added isConfigured prop and updated UI to show configuration status
Comments suppressed due to low confidence (1)

apps/web/app/components/nodes/BaseNode.tsx:111

  • The configuration badge is now always displayed regardless of whether onConfigure exists. Previously, the badge only appeared when onConfigure was defined. Now nodes without configuration capability will show 'Not Configured' which is misleading. Add a check for data.onConfigure existence: {data.onConfigure && (data.isConfigured ? ... : ...)} to only show the badge when configuration is available.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const isTrigger =
nodes.find((n) => n.id === nodeId)?.data.nodeType === "trigger";
onSave={async (nodeId: string, config: any, userId: string) => {
console.log("Updating the trigger");
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Multiple debug console.log statements have been added throughout this function (lines 428, 432-437, 441, 444, 446-448). These should be removed before merging to production as they clutter the console and provide no value to end users.

Copilot uses AI. Check for mistakes.
"This is the triggerNode from the Trigger Node ",
triggerNode
);
console.log("This is the NodeId which must be Triiger", nodeId);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'Triiger' to 'Trigger'.

Suggested change
console.log("This is the NodeId which must be Triiger", nodeId);
console.log("This is the NodeId which must be Trigger", nodeId);

Copilot uses AI. Check for mistakes.
Comment on lines +442 to +443
// The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
// To debug, log after the call and also the actual variable:
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

This comment is now outdated since the return statement has been added to api.triggers.update in apps/web/app/lib/api.ts. Remove this obsolete comment.

Suggested change
// The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
// To debug, log after the call and also the actual variable:

Copilot uses AI. Check for mistakes.
import { TriggerUpdateSchema } from "@repo/common/zod";
import z from "zod"
import z from "zod";
import { getCredentials } from "../workflow/lib/config";
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

This import is unused in the file. The getCredentials function is defined locally in the Credentials object and doesn't use the imported function. Remove this unused import.

Suggested change
import { getCredentials } from "../workflow/lib/config";

Copilot uses AI. Check for mistakes.
getCredentials: async (type: string) =>
await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {
getCredentials: async (type: string) => {
const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Inconsistent spacing: there are two spaces after the equals sign. Should be a single space for consistency with the rest of the codebase.

Suggested change
const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {
const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/app/workflows/[id]/page.tsx (1)

3-3: Remove unused act import.

act is imported but never used in this file.

Proposed fix
-import { useState, useEffect, act } from "react";
+import { useState, useEffect } from "react";
🤖 Fix all issues with AI agents
In `@apps/web/app/lib/api.ts`:
- Line 6: Remove the unused import by deleting getCredentials from the import
statement (the unused symbol getCredentials imported from
"../workflow/lib/config") in this module so there are no unused imports left;
update the import line accordingly or remove the entire import if nothing else
is imported.

In `@apps/web/app/lib/nodeConfigs/googleSheet.action.ts`:
- Around line 6-8: The label "label" for the Google Sheets action is
inconsistent with the "description" (singular vs plural) and the official
product name; update either the label value in the object (symbol: label) to
"Google Sheets" to match the description and branding, or change the description
value (symbol: description) to use the singular "Google Sheet" so both fields
match—ensure both strings consistently reflect the chosen naming across the
object.

In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx:
- Line 24: The component currently casts userId from useAppSelector to string
which can hide a null/undefined when the user is unauthenticated; change
useAppSelector(user => state.user.userId) to allow undefined and add a guard: if
no userId show an error/unauthenticated state or disable actions that require it
(referencing userId and any submit/confirm handlers in the component), and
ensure hooks order by moving the early return for !isOpen || !selectedNode above
the useEffect or restructure so useEffect isn't called when the component
short-circuits; update logic in useEffect and handlers that assume userId to
handle the missing-user case.

In `@apps/web/app/workflows/`[id]/page.tsx:
- Line 431: The trigger lookup may return a placeholder node; update the search
for the configured trigger by filtering out placeholders — change the nodes.find
predicate that sets triggerNode to also require !n.data.isPlaceholder so it only
matches nodes where n.data.nodeType === "trigger" and n.data.isPlaceholder is
falsy (refer to the triggerNode variable and the nodes.find(...) call where
n.data.nodeType and n.data.isPlaceholder are accessed).
- Around line 428-448: Remove all temporary console.log debugging statements in
the trigger update flow (the logs referencing "Updating the trigger", "This is
the triggerNode...", "Is this a trigger or not", "api.triggers.update
response:", the JSON stringify of data/res, etc.) inside the block that finds
triggerNode, computes isTrigger, and calls api.triggers.update({ TriggerId:
nodeId, Config: config }). Leave the functional logic (finding triggerNode,
isTrigger check, and the api.triggers.update call and handling of its result)
intact; if a persistent log is required use the project’s logger (e.g.,
processLogger or existing app logger) at an appropriate level instead of
console.log.
🧹 Nitpick comments (4)
apps/web/app/lib/nodeConfigs/webhook.trigger.ts (1)

1-33: Remove commented-out dead code.

This large block of commented-out code should be removed rather than left in the codebase. If the previous implementation needs to be preserved for reference, it's already tracked in version control history.

♻️ Suggested cleanup
-// import { NodeConfig } from '../types/node.types';
-// // 
-// export const webhookTriggerConfig: NodeConfig = {
-//   id: "webhook",
-//   type: "trigger",
-//   label: "Webhook",
-//   icon: "📡",
-//   description: "Trigger workflow on HTTP request",
-//   fields: [
-//     {
-//       name: "path",
-//       label: "Webhook Path",
-//       type: "text",
-//       required: true,
-//       placeholder: "/api/webhook/12345",
-//       description: "The HTTP path where this webhook will listen. Must be unique per workflow."
-//     },
-//     {
-//       name: "method",
-//       label: "HTTP Method",
-//       type: "dropdown",
-//       required: true,
-//       options: [
-//         { label: "POST", value: "POST" },
-//         { label: "GET", value: "GET" }
-//       ],
-//       defaultValue: "POST",
-//       description: "The HTTP method to accept (typically POST)."
-//     }
-//   ],
-//   summary: "Listen for HTTP requests on a unique webhook URL.",
-//   helpUrl: "https://docs.example.com/webhook-trigger"
-// };
-
 import { NodeConfig } from "../types/node.types";
apps/web/app/lib/api.ts (1)

61-67: Potential undefined access and inconsistent API response handling.

If the backend response doesn't include data.Data, this will return undefined. Consider adding defensive handling. Also, this method returns extracted data while other methods return the full Axios response — this inconsistency may cause confusion for callers.

Proposed defensive fix
     getCredentials: async (type: string) => {
-     const res =  await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {
+      const res = await axios.get(`${BACKEND_URL}/user/getCredentials/${type}`, {
         withCredentials: true,
         headers: { "Content-Type": "application/json" },
       });
-      return res.data.Data;
+      return res.data?.Data ?? [];
     },
apps/web/app/workflows/[id]/components/ConfigModal.tsx (2)

27-42: Consider adding loading state for credential fetch.

The credentials fetch doesn't indicate loading to the user. If the API is slow, the dropdown will appear empty until data arrives. Consider setting a loading flag before the fetch.

Proposed improvement
   useEffect(() => {
     setConfig({});
     setCredentials([]);
     if (selectedNode) {
       const nodeConfig = getNodeConfig(selectedNode.name || selectedNode.actionType);
       if (nodeConfig && nodeConfig.credentials === "google") {
+        setLoading(true);
         api.Credentials.getCredentials("google").then((res) => {
           setCredentials(res || []);
         }).catch((error) => {
           console.error("Failed to fetch credentials:", error);
           setCredentials([]);
+        }).finally(() => {
+          setLoading(false);
         });
       }
     }
   }, [selectedNode]);

358-361: Redundant setConfig({}) after save.

handleSave already calls onClose() in its finally block, which will close the modal. The subsequent setConfig({}) is redundant and may not even execute if the component unmounts.

Proposed fix
           <button
-            onClick={async () => {
-              await handleSave();
-              setConfig({}); // Clear the form after saving
-            }}
+            onClick={handleSave}
             disabled={loading}
             className="px-6 py-2 bg-gradient-to-r from-white to-gray-400 text-black rounded hover:from-gray-300 hover:to-gray-600 disabled:opacity-50"
             style={{ fontWeight: 600 }}
             type="button"
           >
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6646d70 and 56b85d8.

📒 Files selected for processing (6)
  • apps/web/app/components/nodes/BaseNode.tsx
  • apps/web/app/lib/api.ts
  • apps/web/app/lib/nodeConfigs/googleSheet.action.ts
  • apps/web/app/lib/nodeConfigs/webhook.trigger.ts
  • apps/web/app/workflows/[id]/components/ConfigModal.tsx
  • apps/web/app/workflows/[id]/page.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
apps/web/app/workflows/[id]/components/ConfigModal.tsx (4)
apps/web/app/hooks/redux.ts (1)
  • useAppSelector (7-7)
apps/web/app/lib/nodeConfigs/index.ts (1)
  • getNodeConfig (25-27)
apps/web/app/lib/api.ts (1)
  • api (8-75)
packages/common/src/index.ts (1)
  • HOOKS_URL (5-5)
apps/web/app/workflows/[id]/page.tsx (1)
apps/web/app/lib/api.ts (1)
  • api (8-75)
apps/web/app/lib/api.ts (1)
packages/common/src/index.ts (1)
  • BACKEND_URL (4-4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Agent
🔇 Additional comments (3)
apps/web/app/lib/nodeConfigs/webhook.trigger.ts (1)

35-49: LGTM!

The new webhook trigger configuration is clean and well-documented. The empty fields array with the explanatory comment clarifies that the webhook URL is auto-generated, which aligns with the PR's intent to simplify node configuration.

apps/web/app/components/nodes/BaseNode.tsx (1)

103-111: LGTM! Badge logic correctly reflects configuration state.

The conditional badge rendering works as expected. Note that when isConfigured is undefined (for legacy nodes or initial state), it will display "Not Configured" due to the falsy check — verify this is the intended UX.

apps/web/app/workflows/[id]/page.tsx (1)

241-241: LGTM! Proper initialization of isConfigured flag.

New action and trigger nodes correctly initialize with isConfigured: false, which aligns with the BaseNode badge display logic.

Also applies to: 366-366

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

import { TriggerUpdateSchema } from "@repo/common/zod";
import z from "zod"
import z from "zod";
import { getCredentials } from "../workflow/lib/config";
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

Remove unused import.

getCredentials is imported but never used in this file.

Proposed fix
-import { getCredentials } from "../workflow/lib/config";
📝 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
import { getCredentials } from "../workflow/lib/config";
🤖 Prompt for AI Agents
In `@apps/web/app/lib/api.ts` at line 6, Remove the unused import by deleting
getCredentials from the import statement (the unused symbol getCredentials
imported from "../workflow/lib/config") in this module so there are no unused
imports left; update the import line accordingly or remove the entire import if
nothing else is imported.

Comment on lines +6 to 8
label: "Google Sheet",
icon: "📊",
description: "Read or write data to Google Sheets",
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

Inconsistent naming: label vs. description and official product name.

The label was changed to singular "Google Sheet", but:

  1. The description on line 8 still uses plural "Google Sheets"
  2. The official product name is "Google Sheets" (plural)

Consider either reverting to "Google Sheets" to match the official branding, or updating the description as well for internal consistency.

Option 1: Revert to official product name
-  label: "Google Sheet",
+  label: "Google Sheets",
Option 2: Make description consistent with new label
-  description: "Read or write data to Google Sheets",
+  description: "Read or write data to a Google Sheet",
📝 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
label: "Google Sheet",
icon: "📊",
description: "Read or write data to Google Sheets",
label: "Google Sheets",
icon: "📊",
description: "Read or write data to Google Sheets",
Suggested change
label: "Google Sheet",
icon: "📊",
description: "Read or write data to Google Sheets",
label: "Google Sheet",
icon: "📊",
description: "Read or write data to a Google Sheet",
🤖 Prompt for AI Agents
In `@apps/web/app/lib/nodeConfigs/googleSheet.action.ts` around lines 6 - 8, The
label "label" for the Google Sheets action is inconsistent with the
"description" (singular vs plural) and the official product name; update either
the label value in the object (symbol: label) to "Google Sheets" to match the
description and branding, or change the description value (symbol: description)
to use the singular "Google Sheet" so both fields match—ensure both strings
consistently reflect the chosen naming across the object.

(state) => state.user.userId
) as unknown as string;
console.log("we are getting this userId from ConfigModal", userId);
const userId = useAppSelector((state) => state.user.userId) as string;
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

Guard against null/undefined userId.

Casting userId as string masks potential runtime issues if the user isn't authenticated. Consider adding a guard or showing an error state.

Proposed fix
-  const userId = useAppSelector((state) => state.user.userId) as string;
+  const userId = useAppSelector((state) => state.user.userId);
+
+  if (!isOpen || !selectedNode) return null;
+  if (!userId) {
+    return (
+      <div className="fixed inset-0 flex items-center justify-center z-50 p-4">
+        <p className="text-red-400">User not authenticated</p>
+      </div>
+    );
+  }

Note: If you add this guard, move the early return for !isOpen || !selectedNode (line 45) above the useEffect to maintain hooks order, or restructure the component.

🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/components/ConfigModal.tsx at line 24, The
component currently casts userId from useAppSelector to string which can hide a
null/undefined when the user is unauthenticated; change useAppSelector(user =>
state.user.userId) to allow undefined and add a guard: if no userId show an
error/unauthenticated state or disable actions that require it (referencing
userId and any submit/confirm handlers in the component), and ensure hooks order
by moving the early return for !isOpen || !selectedNode above the useEffect or
restructure so useEffect isn't called when the component short-circuits; update
logic in useEffect and handlers that assume userId to handle the missing-user
case.

Comment on lines +428 to +448
console.log("Updating the trigger");

// Find the trigger node based on its type being 'trigger'
const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
console.log(
"This is the triggerNode from the Trigger Node ",
triggerNode
);
console.log("This is the NodeId which must be Triiger", nodeId);
const isTrigger = triggerNode?.id === nodeId;
console.log("Is this a trigger or not", isTrigger);
if (isTrigger) {
await api.triggers.update({ TriggerId: nodeId, Config: config });
const data = await api.triggers.update({ TriggerId: nodeId, Config: config });
console.log("The Data saved to DataBase is", data);
// The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
// To debug, log after the call and also the actual variable:
console.log("api.triggers.update response:", data);

const res = JSON.stringify(data);
console.log("THe response is res from saving the data is " , res)
console.log("Updating the trigger");
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 debug logging before merge.

These console.log statements appear to be debugging artifacts and should be removed for production code.

Proposed cleanup
         onSave={async (nodeId: string, config: any, userId: string) => {
-          console.log("Updating the trigger");
-
-          // Find the trigger node based on its type being 'trigger'
-          const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
-          console.log(
-            "This is  the triggerNode from the Trigger Node ",
-            triggerNode
-          );
-          console.log("This is  the NodeId which must be Triiger", nodeId);
+          const triggerNode = nodes.find(
+            (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
+          );
           const isTrigger = triggerNode?.id === nodeId;
-          console.log("Is this a trigger or not", isTrigger);
           if (isTrigger) {
-           const data = await api.triggers.update({ TriggerId: nodeId, Config: config });
-           console.log("The Data saved to DataBase is", data);
-           // The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
-           // To debug, log after the call and also the actual variable:
-           console.log("api.triggers.update response:", data);
-
-            const res =  JSON.stringify(data);
-            console.log("THe response is res from saving the data is " , res)
-           console.log("Updating the trigger");
+            await api.triggers.update({ TriggerId: nodeId, Config: config });
           } else {
             await api.nodes.update({ NodeId: nodeId, Config: config });
           }
📝 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("Updating the trigger");
// Find the trigger node based on its type being 'trigger'
const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
console.log(
"This is the triggerNode from the Trigger Node ",
triggerNode
);
console.log("This is the NodeId which must be Triiger", nodeId);
const isTrigger = triggerNode?.id === nodeId;
console.log("Is this a trigger or not", isTrigger);
if (isTrigger) {
await api.triggers.update({ TriggerId: nodeId, Config: config });
const data = await api.triggers.update({ TriggerId: nodeId, Config: config });
console.log("The Data saved to DataBase is", data);
// The 'data' is undefined because api.triggers.update does not return anything (it's missing a 'return' statement).
// To debug, log after the call and also the actual variable:
console.log("api.triggers.update response:", data);
const res = JSON.stringify(data);
console.log("THe response is res from saving the data is " , res)
console.log("Updating the trigger");
const triggerNode = nodes.find(
(n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
);
const isTrigger = triggerNode?.id === nodeId;
if (isTrigger) {
await api.triggers.update({ TriggerId: nodeId, Config: config });
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/page.tsx around lines 428 - 448, Remove all
temporary console.log debugging statements in the trigger update flow (the logs
referencing "Updating the trigger", "This is the triggerNode...", "Is this a
trigger or not", "api.triggers.update response:", the JSON stringify of
data/res, etc.) inside the block that finds triggerNode, computes isTrigger, and
calls api.triggers.update({ TriggerId: nodeId, Config: config }). Leave the
functional logic (finding triggerNode, isTrigger check, and the
api.triggers.update call and handling of its result) intact; if a persistent log
is required use the project’s logger (e.g., processLogger or existing app
logger) at an appropriate level instead of console.log.

console.log("Updating the trigger");

// Find the trigger node based on its type being 'trigger'
const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
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

Trigger detection may match placeholder nodes.

The current query nodes.find((n) => n.data.nodeType === "trigger") could match the trigger placeholder if one exists. Add !n.data.isPlaceholder to ensure only the configured trigger is matched.

Proposed fix
-          const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
+          const triggerNode = nodes.find(
+            (n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
+          );
📝 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
const triggerNode = nodes.find((n) => n.data.nodeType === "trigger");
const triggerNode = nodes.find(
(n) => n.data.nodeType === "trigger" && !n.data.isPlaceholder
);
🤖 Prompt for AI Agents
In `@apps/web/app/workflows/`[id]/page.tsx at line 431, The trigger lookup may
return a placeholder node; update the search for the configured trigger by
filtering out placeholders — change the nodes.find predicate that sets
triggerNode to also require !n.data.isPlaceholder so it only matches nodes where
n.data.nodeType === "trigger" and n.data.isPlaceholder is falsy (refer to the
triggerNode variable and the nodes.find(...) call where n.data.nodeType and
n.data.isPlaceholder are accessed).

@Vamsi-o Vamsi-o merged commit ef2943a into main Jan 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants