Skip to main content
Input variables define what data your workflow accepts when executed. They’re specified using JSON Schema, providing documentation, validation, and type safety for workflow inputs.

Why Define Input Schema?


Basic Input Schema

Simple Input

Valid execution:
Invalid execution:

Multiple Required Fields

Valid execution:

Optional Fields

All valid:

JSON Schema Types

Primitive Types

String:
"John Doe"123 Number:
99.99, 100"99.99" Integer:
5, -105.5 Boolean:
true, false"true" Null:
"value", null

Complex Types

Arrays

Valid:
With min/max items:

Nested Objects

Valid execution:
Access in workflow:

Array of Objects

Valid execution:

Validation Options

String Constraints

Number Constraints

Enums (Restricted Values)

Valid:
Invalid:

Complete Example

Market Research Workflow

Workflow definition:

Valid Execution 1 (Minimal)

Valid Execution 2 (Full)

Invalid Execution 1 (Missing Required Field)

Error: "markets" is required

Invalid Execution 2 (Wrong Type)

Error: "markets" must be array

Invalid Execution 3 (Enum Value)

Error: "CANADA" is not an allowed value

Default Values

Set default values for optional fields:
Note: PLai Framework currently doesn’t support JSON Schema default keyword. Use conditional logic in nodes:

Input Schema Best Practices

✅ DO:

  • Document your inputs: Include description field
  • Be specific: Use constraints (min/max length, patterns)
  • Use enums: For restricted value sets
  • Group related inputs: Use nested objects
  • Provide examples: In documentation
  • Version your schema: Track changes

❌ DON’T:

  • Use overly permissive schema: {"type": "object"} accepts anything
  • Skip descriptions: Make intent clear
  • Forget validation: Catch errors early
  • Use undefined types: Stick to JSON Schema standards
  • Create deep nesting: Keep structure simple

Input Schema Documentation Template


Runtime Input Access

Once workflow is executed, input is always available:
Example:

Next Steps