Skip to content

Commit

Permalink
fix(API): Fix manual chat trigger execution (#8300)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
  • Loading branch information
OlegIvaniv authored Jan 11, 2024
1 parent 93b969a commit 884396e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/cli/src/TestWebhooks.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type express from 'express';
import { Service } from 'typedi';
import {
type IWebhookData,
type IWorkflowExecuteAdditionalData,
type IHttpRequestMethods,
WebhookPathTakenError,
Workflow,
import { WebhookPathTakenError, Workflow } from 'n8n-workflow';
import type {
IWebhookData,
IWorkflowExecuteAdditionalData,
IHttpRequestMethods,
IRunData,
} from 'n8n-workflow';
import type {
IResponseCallbackData,
Expand Down Expand Up @@ -189,6 +189,7 @@ export class TestWebhooks implements IWebhookManager {
userId: string,
workflowEntity: IWorkflowDb,
additionalData: IWorkflowExecuteAdditionalData,
runData?: IRunData,
sessionId?: string,
destinationNode?: string,
) {
Expand All @@ -213,6 +214,10 @@ export class TestWebhooks implements IWebhookManager {
const key = this.registrations.toKey(webhook);
const registration = await this.registrations.get(key);

if (runData && webhook.node in runData) {
return false;
}

if (registration && !webhook.webhookId) {
throw new WebhookPathTakenError(webhook.node);
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/workflows/workflow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ export class WorkflowService {
user.id,
workflowData,
additionalData,
runData,
sessionId,
destinationNode,
);
Expand Down

0 comments on commit 884396e

Please sign in to comment.