
How to define inputs and outputs for an AI workflow
Before choosing a model, write the record your workflow receives and the record it must produce. A clear input and output contract exposes problems that a natural-language task description can hide.
Specify what absent information means
An invoice extractor might receive a document and return vendor, invoice number, currency, total, and due date. Decide whether an unreadable due date becomes null, an error, or a review request. Those outcomes have different consequences. Also distinguish a value copied from the document from one calculated by your software. If the total includes tax, specify that; otherwise two apparently correct outputs can disagree.
- 1Create a sample input with a stable…Create a sample input with a stable identifier.
- 2Define field types, required fields, and allowed…Define field types, required fields, and allowed nulls.
- 3Write one example each for success, missing…Write one example each for success, missing information, and invalid input.
Try it on a small example
- Create a sample input with a stable identifier.
- Define field types, required fields, and allowed nulls.
- Write one example each for success, missing information, and invalid input.
What to verify
Validate the returned object before writing it anywhere. A JSON-shaped answer can still contain a wrong currency or an impossible date. Baleybots callable document runs require a supported processor output with an object JSON Schema. Treat that schema as the start of validation, then add checks for relationships such as subtotal plus tax equaling total. Make those checks deterministic where possible.
Product details checked against the Public API reference on October 4, 2026. These guides describe documented behavior; availability depends on your account and the deployed service. Baleybots is in invite-only beta.