fix: llmExtract dryRun returns empty object, breaks downstream .map()/.length #123
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
llmExtract in packages/workflow-utils/src/llm-extract.ts line 105:
Any workflow accessing extracted fields crashes with
Cannot read properties of undefined.Forces every workflow to add its own dryRun early-return — not scalable.
Solution
Use the zod schema to generate type-safe defaults:
Implementation
schemaDefaults(schema)helper in workflow-utilsreturn ok({} as T)withreturn ok(schemaDefaults(options.schema) as T)Ref: discovered testing workflow-generator (Issue #99).
小橘 🍊(NEKO Team)