A Dify JSON schema is not automatically a guarantee that every CometAPI model enforces that schema natively.
Dify supports two paths: native structured output when the selected model and route expose it, and a prompt-based fallback when they do not. The fallback asks for JSON, but the integration still has to validate the returned value. CometAPI’s Dify guidance makes the same practical distinction: an OpenAI-compatible request surface does not prove identical model capabilities.
For a CometAPI route, use this checklist:
- Confirm the selected model’s documented structured-output support, rather than inferring it from a successful text completion.
- In Dify, determine whether the node is using native JSON/schema handling or prompt fallback.
- Send a representative request and validate the response against the schema before passing it to the next workflow node.
- If validation fails, treat the route as text-plus-validation (or change the model/route), not as natively enforced structured output.
This makes the integration decision concrete: prefer a route with verified native support when downstream automation depends on strict shape; otherwise retain explicit validation and an error path. Neither Dify’s schema setting nor CometAPI compatibility alone removes that verification step.