diff --git a/console/packages/console-frontend/src/api/flows/flows.ts b/console/packages/console-frontend/src/api/flows/flows.ts index 89b797797..770111a50 100644 --- a/console/packages/console-frontend/src/api/flows/flows.ts +++ b/console/packages/console-frontend/src/api/flows/flows.ts @@ -302,15 +302,33 @@ export async function fetchFlows(): Promise { const functions = functionsData.functions || [] - // Build a map of function_id -> triggers + // Build a map of function_id -> triggers, normalizing engine config field names + // to the metadata format that createStep expects (e.g. api_path -> path) const triggersByFunction = new Map>>() for (const trigger of triggersData.triggers || []) { const funcId = trigger.function_id const existing = triggersByFunction.get(funcId) ?? [] - existing.push({ + const config = trigger.config as Record + const normalized: Record = { + ...config, type: trigger.trigger_type, - ...trigger.config, - }) + } + + if (trigger.trigger_type === 'http') { + const rawPath = config.api_path as string | undefined + normalized.path = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : config.path + normalized.method = config.http_method ?? config.method + } else if (trigger.trigger_type === 'cron') { + normalized.expression = config.expression + } else if ( + trigger.trigger_type === 'event' || + trigger.trigger_type === 'queue' || + trigger.trigger_type === 'durable:subscriber' + ) { + normalized.topic = config.topic + } + + existing.push(normalized) triggersByFunction.set(funcId, existing) } diff --git a/console/packages/console-frontend/src/components/flow/nodes/base-node.tsx b/console/packages/console-frontend/src/components/flow/nodes/base-node.tsx index fa31df3a3..66d752b77 100644 --- a/console/packages/console-frontend/src/components/flow/nodes/base-node.tsx +++ b/console/packages/console-frontend/src/components/flow/nodes/base-node.tsx @@ -1,5 +1,6 @@ import { Position } from '@xyflow/react' import { clsx } from 'clsx' +import { Children } from 'react' import type { NodeData } from '../../../api/flows/types' import { BaseHandle } from './base-handle' import { NodeHeader } from './node-header' @@ -26,6 +27,7 @@ export function BaseNode({ const sourcePos = data.nodeConfig?.sourceHandlePosition === 'right' ? Position.Right : Position.Bottom const targetPos = data.nodeConfig?.targetHandlePosition === 'left' ? Position.Left : Position.Top + const hasChildren = Children.toArray(children).length > 0 return (
@@ -34,7 +36,7 @@ export function BaseNode({ {subtitle &&
{subtitle}
} - {children && ( + {hasChildren && (