mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
fix(API): Fix manual chat trigger execution (#8300)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
parent
93b969a327
commit
884396ea0d
|
@ -1,11 +1,11 @@
|
||||||
import type express from 'express';
|
import type express from 'express';
|
||||||
import { Service } from 'typedi';
|
import { Service } from 'typedi';
|
||||||
import {
|
import { WebhookPathTakenError, Workflow } from 'n8n-workflow';
|
||||||
type IWebhookData,
|
import type {
|
||||||
type IWorkflowExecuteAdditionalData,
|
IWebhookData,
|
||||||
type IHttpRequestMethods,
|
IWorkflowExecuteAdditionalData,
|
||||||
WebhookPathTakenError,
|
IHttpRequestMethods,
|
||||||
Workflow,
|
IRunData,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import type {
|
import type {
|
||||||
IResponseCallbackData,
|
IResponseCallbackData,
|
||||||
|
@ -189,6 +189,7 @@ export class TestWebhooks implements IWebhookManager {
|
||||||
userId: string,
|
userId: string,
|
||||||
workflowEntity: IWorkflowDb,
|
workflowEntity: IWorkflowDb,
|
||||||
additionalData: IWorkflowExecuteAdditionalData,
|
additionalData: IWorkflowExecuteAdditionalData,
|
||||||
|
runData?: IRunData,
|
||||||
sessionId?: string,
|
sessionId?: string,
|
||||||
destinationNode?: string,
|
destinationNode?: string,
|
||||||
) {
|
) {
|
||||||
|
@ -213,6 +214,10 @@ export class TestWebhooks implements IWebhookManager {
|
||||||
const key = this.registrations.toKey(webhook);
|
const key = this.registrations.toKey(webhook);
|
||||||
const registration = await this.registrations.get(key);
|
const registration = await this.registrations.get(key);
|
||||||
|
|
||||||
|
if (runData && webhook.node in runData) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (registration && !webhook.webhookId) {
|
if (registration && !webhook.webhookId) {
|
||||||
throw new WebhookPathTakenError(webhook.node);
|
throw new WebhookPathTakenError(webhook.node);
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,6 +320,7 @@ export class WorkflowService {
|
||||||
user.id,
|
user.id,
|
||||||
workflowData,
|
workflowData,
|
||||||
additionalData,
|
additionalData,
|
||||||
|
runData,
|
||||||
sessionId,
|
sessionId,
|
||||||
destinationNode,
|
destinationNode,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue