diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx index a24d3ff9e4..a3ebc3dab5 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx @@ -363,11 +363,10 @@ const SubBlockRow = ({ return null } const baseUrl = getBaseUrl() - const triggerPath = allSubBlockValues?.triggerPath?.value as string | undefined - return triggerPath - ? `${baseUrl}/api/webhooks/trigger/${triggerPath}` - : `${baseUrl}/api/webhooks/trigger/${blockId}` - }, [subBlock?.id, blockId, allSubBlockValues]) + // Always use blockId for consistency - the webhook path should always match blockId + // This prevents the URL from changing after loading webhook data + return `${baseUrl}/api/webhooks/trigger/${blockId}` + }, [subBlock?.id, blockId]) const allVariables = useVariablesStore((state) => state.variables) diff --git a/apps/sim/hooks/use-webhook-management.ts b/apps/sim/hooks/use-webhook-management.ts index 1fb777fe8c..618502855f 100644 --- a/apps/sim/hooks/use-webhook-management.ts +++ b/apps/sim/hooks/use-webhook-management.ts @@ -108,13 +108,11 @@ export function useWebhookManagement({ const isChecked = useSubBlockStore((state) => state.checkedWebhooks.has(blockId)) const webhookUrl = useMemo(() => { - if (!webhookPath) { - const baseUrl = getBaseUrl() - return `${baseUrl}/api/webhooks/trigger/${blockId}` - } const baseUrl = getBaseUrl() - return `${baseUrl}/api/webhooks/trigger/${webhookPath}` - }, [webhookPath, blockId]) + // Always use blockId for consistency - the webhook path should always match blockId + // This prevents the URL from changing after loading webhook data from the API + return `${baseUrl}/api/webhooks/trigger/${blockId}` + }, [blockId]) const [isSaving, setIsSaving] = useState(false)