Module Schema Reference
A comprehensive reference for all available options when building module schemas for Stacksync Workflows.
Schema Structure
Root Schema Object
{
"metadata": {
"workflows_module_schema_version": "1.0.0"
},
"fields": [...],
"ui_options": {...}
}Required Properties:
metadata- Schema metadata configurationfields- Array of field definitions
Optional Properties:
ui_options- Global UI configuration options
Metadata Configuration
workflows_module_schema_version
Type: String
Required: Yes
Default: "1.0.0"
Description: Specifies the schema version for compatibility
Field Types
String Fields
Basic String Field:
Properties:
id(string, required) - Unique field identifiertype(string, required) - Must be "string"label(string, optional) - Display label for the fielddescription(string, optional) - Help text for usersdefault(string, optional) - Default value
Number Fields
Basic Number Field:
Properties:
id(string, required) - Unique field identifiertype(string, required) - Must be "number"label(string, optional) - Display labeldefault(number, optional) - Default numeric value
Integer Fields
Basic Integer Field:
Boolean Fields
Basic Boolean Field:
Connection Fields
Connection Field:
Properties:
allowed_app_types(array, required) - List of supported connection typesallowed_connection_management_types(array, required) - Connection management options
Supported App Types:
salesforce- Salesforce CRMhubspot- HubSpot CRMpostgres- PostgreSQL databasemysql- MySQL databasecustom_api- Custom API connections
Connection Management Types:
managed- Platform-managed connectionscustom- User-provided credentials
Object Fields
Simple Object Field:
Object with Choices:
Array Fields
String Array:
Object Array:
UI Widgets
Available Widgets
input (default for strings)
textarea (multi-line text)
password (hidden text input)
SelectWidget (dropdown selection)
checkbox (boolean checkbox)
CodeblockWidget (code editor)
hidden (hidden field)
CodeblockWidget Languages
Supported syntax highlighting languages:
json- JSON formatsql- SQL queriesjavascript- JavaScript codepython- Python codeyaml- YAML configurationxml- XML markuphtml- HTML markupcss- CSS styling
Validation Rules
Basic Validation
required - Field is mandatory
min_length - Minimum string length
max_length - Maximum string length
minimum - Minimum numeric value
maximum - Maximum numeric value
pattern - Regular expression validation
Format Validation
email - Email address format
uri - URI format
date - Date format (YYYY-MM-DD)
date-time - Date-time format (ISO 8601)
uuid - UUID format
Dynamic Content
Basic Content Configuration
Properties:
type(array, required) - Content management typescontent_objects(array, required) - List of content objects to fetch
Content Management Types:
managed- Platform manages the content loadingcustom- Custom content loading logic
Content Dependencies
Field-dependent content:
Array item dependencies:
Choices Configuration
Static Choices
Simple string choices:
Object choices:
Dynamic Choices
Empty choices for dynamic loading:
Schema Rules (Conditional Logic)
Basic Rules Structure
Condition Operators
equal - Exact match
not_equal - Not equal to
is_in - Value in array
is_not_in - Value not in array
is_empty - Field is empty
is_not_empty - Field has value
greater_than - Numeric comparison
less_than - Numeric comparison
Logic Combinators
and - All conditions must be true
or - Any condition must be true
Rule Effects
apply_as options:
merge- Merge with existing field configurationfully_replace- Replace entire field configuration
Show/Hide Fields:
Hide Fields:
UI Layout Options
Global UI Options
Field Ordering:
Field-Level UI Options
Horizontal Layout:
Advanced Features
Action Handlers
Action handlers define what should happen when users interact with fields. They trigger specific behaviors when field values change.
load_schema
Purpose: Triggers a schema reload when the field value changes, allowing for dynamic updates to other fields based on the new value.
Basic Usage:
What happens when load_schema is triggered:
You change the value of the field
countryA trigger sends an HTTP POST request to the module /schema endpoint with :
the full schema
the full form data
the full content objects
The module returns a new schema
The new schema is merged with the existing schema
The frontend updates the UI to reflect the new schema
Common Use Cases
Use Case 1: Cascading Dropdowns
Use Case 2: Conditional Field Display
Use Case 3: Dynamic Validation
Backend Implementation
When load_schema: true is triggered, your /content endpoint receives the updated form data:
Performance Considerations
Use Sparingly: Only add
load_schema: trueto fields that actually need to trigger updatesOptimize Backend: Ensure your
/contentendpoint responds quickly to avoid UI lagCache When Possible: Cache static data that doesn't change between requests
Batch Updates: If multiple fields need to trigger updates, consider grouping them
Best Practices
Clear User Feedback: Show loading indicators when schema is reloading
Preserve User Input: Ensure field values aren't lost during reload
Error Handling: Gracefully handle failures in content loading
Debouncing: Consider debouncing rapid field changes to avoid excessive requests
Debugging Tips
Check browser network tab to see
/contentrequests when fields changeVerify that
content_object_depends_on_fieldsreferences match your field IDs exactlyTest with browser console open to catch any JavaScript errors
Use simple test data first, then add complexity
Complete Field Example
Here's a comprehensive example showing most available options:
This specification covers all major aspects of module schema configuration. Refer to this document when building your schemas to understand all available options and their proper usage.
Last updated