Skip to content

fix(workflow-executor): accept orchestrator wire form for composite columnType [PRD-464]#1632

Open
ShohanRahman wants to merge 1 commit into
feat/prd-214-server-step-mapperfrom
fix/prd-464-composite-column-type-validation
Open

fix(workflow-executor): accept orchestrator wire form for composite columnType [PRD-464]#1632
ShohanRahman wants to merge 1 commit into
feat/prd-214-server-step-mapperfrom
fix/prd-464-composite-column-type-validation

Conversation

@ShohanRahman
Copy link
Copy Markdown
Contributor

@ShohanRahman ShohanRahman commented Jun 5, 2026

Summary

  • ColumnTypeSchema rejected the orchestrator's wire-form representation of composite column types ({ fields: [{ field, type }] }), breaking any workflow targeting a collection that contains a composite/embedded field — e.g. an embedded field declared with columnType: { data: "String" }.
  • Add a fourth union branch that accepts the wire form and .transforms it back to the canonical Record<string, ColumnType> shape so downstream consumers see no difference.
  • Add Jest coverage for native record form, single-entry wire form, multi-entry wire form, and nested-composite wire form.

Bug

Step dispatch failed with:

Run <runId> mapper produced invalid AvailableStepExecution — fields.N.type: Invalid input
ZodError [...] path: ["fields", N, "type"]

Stack: ReadRecordStepExecutor.getCollectionSchemaForestServerWorkflowPort.callPortCollectionSchemaSchema.parse.

Test plan

  • yarn workspace @forestadmin/workflow-executor test — 914 tests pass, 4 new tests in forest-server-workflow-port.test.ts
  • Smoke-test a workflow on a collection with an embedded computed field

fixes PRD-464

🤖 Generated with Claude Code

Note

Accept orchestrator wire form for composite columnType in workflow executor

  • Extends ColumnTypeSchema in collection.ts to accept composite types in the orchestrator's wire form { fields: [{ field, type }] }, in addition to the native record form.
  • Adds a transform that normalizes the wire form into a record/object shape, including nested composite types.
  • Adds four test cases in forest-server-workflow-port.test.ts covering native record form, single- and multi-entry wire form, and nested wire form composites.

🖇️ Linked Issues

Relates to PRD-464.

Macroscope summarized de33f2a.

…olumnType [PRD-464]

The orchestrator serializes composite column types (e.g. an `embedded`
computed field declared with `columnType: { data: "String" }`) as
`{ fields: [{ field, type }] }` rather than the native datasource-toolkit
record shape. The Zod `ColumnTypeSchema` had no branch for that shape, so
every collection containing such a field rejected the step dispatch with
a `DomainValidationError` at `fields.N.type`.

Add a fourth union branch that accepts the wire form and `.transform`s
it back to the canonical `Record<string, ColumnType>` so downstream
consumers stay untouched.

fixes PRD-464

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

PRD-464

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Jun 5, 2026

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
New Coverage rating: A
packages/workflow-executor/src/types/validated/collection.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant