From 3d90b3882bccd5576785e4a50250d44f4fd623b4 Mon Sep 17 00:00:00 2001 From: Etienne <45695613+etiennejouan@users.noreply.github.com> Date: Wed, 13 May 2026 15:20:27 +0200 Subject: [PATCH] fix(ai-agent-node) - agent node execution error (#20534) **Root cause:** getWorkflowRunContext(stepInfos) builds a Record from the previous steps' results. There is no workspaceId key in it, so context.workspaceId as string silently evaluated to undefined. That undefined was then passed all the way down to WorkspaceCacheService.getOrRecompute, **which correctly throws** when workspaceId is not a valid UUID. Before : Screenshot 2026-05-13 at 14 58 54 Introduced with billing v2 yesterday, since then, workspaceId is needed to bill credit usage --- .../workflow-actions/ai-agent/ai-agent.workflow-action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts index 11cec77b20..5676037004 100644 --- a/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts +++ b/packages/twenty-server/src/modules/workflow/workflow-executor/workflow-actions/ai-agent/ai-agent.workflow-action.ts @@ -48,7 +48,7 @@ export class AiAgentWorkflowAction implements WorkflowAction { } const { agentId, prompt } = step.settings.input; - const workspaceId = context.workspaceId as string; + const workspaceId = runInfo.workspaceId; let agent: AgentEntity | null = null;