fix(workflows): accept json input type and return 400 for unsupported input types

Merged
WA
6d ago
+217-18

Summary

  • A Start/API trigger input field typed json (the type name blocks and outputs use for objects) made manual/v2/copilot runs fail with a 500 and broke MCP schema generation on deploy: the shared run schema threw a plain Error on any type outside its list
  • json is now an alias of object and files of file[], resolved through one helper (canonicalInputFormatFieldType) in input-format-schema.ts that the run schema, the executor's coerceValue, and isFileFieldType all use. The editor's enum is built from the same list
  • Reserved input names and still-unsupported types now throw OrchestrationError('validation'), so every caller of the shared schema returns a 400 naming the field and the allowed types instead of a 500
  • The editing validator (operations and v2 state replace) now rewrites json/files rows in input-format sub-blocks to their canonical type and rejects unknown types with the allowed list. The table case is unchanged

Type of Change

  • Bug fix

Testing

  • Regression tests in input-schema.test.ts, editing/validation.test.ts, start-block.test.ts: all 5 new or changed cases fail on the pre-fix source and pass with the fix
  • Ran 6 test files (input-schema, editing/validation, start-block, mcp/workflow-tool-schema, input-format, triggers/run-options): 165 tests pass
  • bun run lint, check:comment-hygiene, check:unused-exports, check:boundaries, check:client-boundary, check:utils, check:test-patterns, check:source-conventions, and the block-registry check all pass
  • I did not run type-check, check:audits, or the full test suite locally. CI runs all three

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)