fix(editor): Partial execution of a workflow with manual chat trigger (#12662)

Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
Eugene
2025-01-20 13:50:52 +01:00
committed by GitHub
parent 174cd44815
commit 2f81b29d34
6 changed files with 143 additions and 3 deletions

View File

@@ -164,6 +164,9 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
);
newRunData = { [options.triggerNode]: [options.nodeData] };
executedNode = options.triggerNode;
}
if (options.triggerNode && options.nodeData) {
triggerToStartFrom = {
name: options.triggerNode,
data: options.nodeData,
@@ -174,7 +177,8 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
if (
options.destinationNode &&
(workflowsStore.checkIfNodeHasChatParent(options.destinationNode) ||
destinationNodeType === CHAT_TRIGGER_NODE_TYPE)
destinationNodeType === CHAT_TRIGGER_NODE_TYPE) &&
options.source !== 'RunData.ManualChatMessage'
) {
const startNode = workflow.getStartNode(options.destinationNode);
if (startNode && startNode.type === CHAT_TRIGGER_NODE_TYPE) {
@@ -186,6 +190,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
// If the chat node has no input data or pin data, open the chat modal
// and halt the execution
if (!chatHasInputData && !chatHasPinData) {
workflowsStore.chatPartialExecutionDestinationNode = options.destinationNode;
workflowsStore.setPanelOpen('chat', true);
return;
}