From 0ec9d2d9658261dab741945ebfb55630c6003c77 Mon Sep 17 00:00:00 2001 From: alban bertolini Date: Thu, 30 Jul 2026 10:42:37 +0200 Subject: [PATCH] fix(workflow-executor): carry the collection name on step error logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The step error logs are what a client's own tech reads to diagnose a failing step — they are the only place the server's technical message surfaces, since the operator deliberately sees a generic message. They carried runId, stepId, stepIndex and stepType but not the collection, while the Debug and Info logs did. On a schema-shaped failure ("collection X has no usable primary key") the collection is the one field you want to filter on. Move it into logCtx rather than adding it to each catch branch, so it reaches every log site including the three in the error path, and future ones by default. baseRecordRef is non-optional on ExecutionContext, so the getter cannot throw while logging an error. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/executors/base-step-executor.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/workflow-executor/src/executors/base-step-executor.ts b/packages/workflow-executor/src/executors/base-step-executor.ts index 5c795959f5..60021c0c90 100644 --- a/packages/workflow-executor/src/executors/base-step-executor.ts +++ b/packages/workflow-executor/src/executors/base-step-executor.ts @@ -39,18 +39,12 @@ export default abstract class BaseStepExecutor { - const { baseRecordRef } = this.context; - this.context.logger('Debug', 'Step context', { ...this.logCtx, - collection: baseRecordRef.collectionName, stepInput: this.context.stepDefinition, }); - this.context.logger('Info', 'Step execution started', { - ...this.logCtx, - collection: baseRecordRef.collectionName, - }); + this.context.logger('Info', 'Step execution started', this.logCtx); try { // Idempotency guard — mutating executors override this. Runs before doExecute so a cache @@ -391,13 +385,14 @@ export default abstract class BaseStepExecutor