Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(API): Fix manual chat trigger execution #8300

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading