Schema basics
Every action requires a JSON Schema file with the same base name:Minimal schema
Build-time schema generation
TheFlowAppSchemaGenerator source generator automatically creates the GetInputSchemaJson() method:
1
Naming convention
The generator looks for a JSON file matching the action class name:
IqraGenerators/FlowAppSchemaGenerator.cs:68-72
2
Same directory requirement
The JSON file must be in the same directory as the C# file:
IqraGenerators/FlowAppSchemaGenerator.cs:83-84
3
Code generation
The generator creates a partial class method:
IqraGenerators/FlowAppSchemaGenerator.cs:102-117
Field types
String fields
Number fields
Boolean fields
Enum fields
Array fields
Nested objects
Dynamic dropdowns with fetchers
Use the customx-fetcher property to populate fields from a data fetcher:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeeting.json:38-44
IFlowDataFetcher:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Fetchers/GetEventTypesByIdFetcher.cs:15
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Fetchers/GetEventTypesByIdFetcher.cs:38-43
Context-dependent fetchers
Fetchers receive the current form state via thecontext parameter:
Conditional schemas with oneOf
UseoneOf to define mutually exclusive field groups:
IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeeting.json:34-74
Handling oneOf in actions
Check which variant was provided:IqraInfrastructure/Managers/FlowApp/Apps/CalCom/Actions/BookMeetingAction.cs:64-77
Validation
All inputs are validated at runtime before action execution:IqraInfrastructure/Managers/FlowApp/FlowAppManager.cs:289-299
Common validation rules
- Required fields
- String patterns
- Number ranges
- Array constraints
Scriban template support
All string fields support Scriban templates at runtime:IqraInfrastructure/Managers/FlowApp/FlowAppManager.cs:274-280
Templates are resolved before schema validation, so the final rendered value must still satisfy the schema.
Schema file location requirements
The schema generator enforces strict file placement:IqraGenerators/FlowAppSchemaGenerator.cs:87-90
Best practices
Provide clear titles and descriptions
Provide clear titles and descriptions
Set sensible defaults
Set sensible defaults
Use format validators
Use format validators
Leverage built-in JSON Schema formats:
Keep schemas flat when possible
Keep schemas flat when possible
Flat schemas are easier for AI to populate:Use nesting only when logically required.
Document oneOf variants clearly
Document oneOf variants clearly
Troubleshooting
Compilation error: JSON file not found
Compilation error: JSON file not found
Ensure:
- JSON file is in the same directory as the action class
- File name matches the action name (minus “Action” suffix)
- JSON file is included in the project with
AdditionalFilesbuild action
Runtime error: VALIDATION_ERROR
Runtime error: VALIDATION_ERROR
Check:
- Schema matches the data structure your code expects
- Required fields are marked correctly
- Data types match (string vs integer, etc.)
- Scriban templates resolve to valid values
Fetcher not populating dropdown
Fetcher not populating dropdown
Verify:
FetcherKeyin the fetcher class matchesx-fetcherin schema- Fetcher is registered in the app’s
DataFetcherslist - Integration credentials are valid
- Fetcher is not throwing an exception (check logs)
Next steps
Examples
Explore complete FlowApp implementations with advanced schemas