Skip to content

fix: coerce stringified values in start_workflow data to match workflow input schema#348

Open
AutomateIP wants to merge 2 commits into
itential:develfrom
AutomateIP:fix/start-workflow-data-coercion
Open

fix: coerce stringified values in start_workflow data to match workflow input schema#348
AutomateIP wants to merge 2 commits into
itential:develfrom
AutomateIP:fix/start-workflow-data-coercion

Conversation

@AutomateIP
Copy link
Copy Markdown
Contributor

Summary

  • LLMs sometimes serialize nested structures (arrays, objects) to strings when calling tools, causing 400 Bad Request errors from the platform when the workflow input schema expects a different type
  • Added _coerce_value and _coerce_data_to_schema helpers that fetch the workflow's declared input schema by route_name and convert stringified values back to their correct types before the platform POST
  • Values that cannot be parsed or have no schema declaration are passed through unchanged so the platform still produces the real error

Test plan

  • uv run pytest tests/test_tools_operations_manager.py::TestCoerceValue — 7 unit tests for _coerce_value
  • uv run pytest tests/test_tools_operations_manager.py::TestCoerceDataToSchema — 3 unit tests for _coerce_data_to_schema
  • uv run pytest tests/test_tools_operations_manager.py::TestStartWorkflowCoercion — 2 integration tests for the full start_workflow coercion path
  • uv run pytest — full suite (2398 tests, no regressions)

🤖 Generated with Claude Code

…ow input schema

LLMs sometimes serialize nested structures (arrays, objects) to strings
when calling tools. This causes 400 Bad Request errors from the platform
when the workflow input schema expects an array or object type.

Added _coerce_value and _coerce_data_to_schema helpers that fetch the
workflow declared input schema by route_name and convert any string
values back to their correct types before the platform POST. Values that
cannot be parsed or have no schema declaration are passed through
unchanged so the platform still produces the real error.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@AutomateIP AutomateIP requested a review from a team as a code owner May 8, 2026 19:27
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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