Skip to content

Commit 9043683

Browse files
Shawclaude
andcommitted
fix(n8n-routes): omit second arg to generateWorkflowDraft when no triggerContext
Passing `undefined` as the second argument changed the call signature visible to test spies, causing toHaveBeenCalledWith to fail. When there is no bridgeConversationId the function is now called with one argument only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8c7a38f commit 9043683

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/app-core/src/api/n8n-routes.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,10 +1372,9 @@ async function handleGenerateWorkflow(ctx: N8nRouteContext): Promise<boolean> {
13721372
)
13731373
: undefined;
13741374

1375-
const draft = await service.generateWorkflowDraft?.(
1376-
prompt,
1377-
triggerContext ? { triggerContext } : undefined,
1378-
);
1375+
const draft = triggerContext
1376+
? await service.generateWorkflowDraft?.(prompt, { triggerContext })
1377+
: await service.generateWorkflowDraft?.(prompt);
13791378
if (name?.trim()) {
13801379
(draft as Record<string, unknown>).name = name.trim();
13811380
}

0 commit comments

Comments
 (0)