Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat: user message support generate prompt (#25689)
Joel9bb7bcf52e99
diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsxindex e6b6c838460..5c87eea3ca7 100644--- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx+++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx@@ -50,6 +50,7 @@ export type IGetAutomaticResProps = {onFinished: (res: GenRes) => voidflowId?: stringnodeId?: string+ editorId?: stringcurrentPrompt?: stringisBasicMode?: boolean}@@ -76,6 +77,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({onClose,flowId,nodeId,+ editorId,currentPrompt,isBasicMode,onFinished,@@ -132,7 +134,8 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({},]- const [instructionFromSessionStorage, setInstruction] = useSessionStorageState<string>(`improve-instruction-${flowId}${isBasicMode ? '' : `-${nodeId}`}`)+ // eslint-disable-next-line sonarjs/no-nested-template-literals, sonarjs/no-nested-conditional+ const [instructionFromSessionStorage, setInstruction] = useSessionStorageState<string>(`improve-instruction-${flowId}${isBasicMode ? '' : `-${nodeId}${editorId ? `-${editorId}` : ''}`}`)const instruction = instructionFromSessionStorage || ''const [ideaOutput, setIdeaOutput] = useState<string>('')@@ -166,7 +169,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({return true}const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false)- const storageKey = `${flowId}${isBasicMode ? '' : `-${nodeId}`}`+ const storageKey = `${flowId}${isBasicMode ? '' : `-${nodeId}${editorId ? `-${editorId}` : ''}`}`const { addVersion, current, currentVersionIndex, setCurrentVersionIndex, versions } = useGenData({storageKey,})diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsxindex 3cbdbba3cda..7a99396beb2 100644--- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx+++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx@@ -42,6 +42,7 @@ type Props = {headerClassName?: stringinstanceId?: stringnodeId?: string+ editorId?: stringtitle: string | React.JSX.Elementvalue: stringonChange: (value: string) => void@@ -85,6 +86,7 @@ const Editor: FC<Props> = ({headerClassName,instanceId,nodeId,+ editorId,title,value,onChange,@@ -163,6 +165,7 @@ const Editor: FC<Props> = ({{isSupportPromptGenerator && (<PromptGeneratorBtnnodeId={nodeId!}+ editorId={editorId}className='ml-[5px]'onGenerated={onGenerated}modelConfig={modelConfig}diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsxindex e62b024d1a5..88ba95f76d1 100644--- a/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx+++ b/web/app/components/workflow/nodes/llm/components/config-prompt-item.tsx@@ -136,7 +136,8 @@ const ConfigPromptItem: FC<Props> = ({nodesOutputVars={availableVars}availableNodes={availableNodes}nodeId={nodeId}- isSupportPromptGenerator={payload.role === PromptRole.system}+ editorId={id}+ isSupportPromptGeneratoronGenerated={handleGenerated}modelConfig={modelConfig}isSupportJinjadiff --git a/web/app/components/workflow/nodes/llm/components/prompt-generator-btn.tsx b/web/app/components/workflow/nodes/llm/components/prompt-generator-btn.tsxindex d72067dd2c4..c3c0483bec6 100644--- a/web/app/components/workflow/nodes/llm/components/prompt-generator-btn.tsx+++ b/web/app/components/workflow/nodes/llm/components/prompt-generator-btn.tsx@@ -16,6 +16,7 @@ type Props = {onGenerated?: (prompt: string) => voidmodelConfig?: ModelConfignodeId: string+ editorId?: stringcurrentPrompt?: string}@@ -23,6 +24,7 @@ const PromptGeneratorBtn: FC<Props> = ({className,onGenerated,nodeId,+ editorId,currentPrompt,}) => {const [showAutomatic, { setTrue: showAutomaticTrue, setFalse: showAutomaticFalse }] = useBoolean(false)@@ -46,6 +48,7 @@ const PromptGeneratorBtn: FC<Props> = ({onFinished={handleAutomaticRes}flowId={configsMap?.flowId || ''}nodeId={nodeId}+ editorId={editorId}currentPrompt={currentPrompt}/>)}