Overview
The Form operation enables you to:- Generate forms declaratively - Define fields in YAML, get production-ready HTML
- Server-side validation - Built-in validation rules with custom error messages
- Security features - CSRF tokens, CAPTCHA, honeypot, rate limiting
- Multi-step forms - Complex workflows with conditional steps
- Flexible styling - Tailwind, Bootstrap, or custom CSS
- Type-safe - Full TypeScript support
Quick Start
Simple Contact Form
Field Types
The Form operation supports all standard HTML5 input types:Text Inputs
Password
Number
Tel (Phone)
URL
Textarea
Select (Dropdown)
Checkbox
Radio Buttons
Date & Time
File Upload
Hidden Fields
Validation Rules
Built-in Validators
Multi-Step Forms
For complex workflows, use multi-step forms:Security Features
CSRF Protection
Prevent cross-site request forgery attacks:- Generated on form render
- Included as a hidden field
- Validated on form submission
CAPTCHA Integration
Protect against bots with CAPTCHA:turnstile- Cloudflare Turnstile (recommended for Cloudflare Workers)recaptcha- Google reCAPTCHA v2/v3hcaptcha- hCaptcha
Honeypot Field
Catch bots with invisible honeypot field:- Hidden with CSS
- Automatically validated (should be empty)
- Rejects submissions if filled out
Rate Limiting
Prevent spam and abuse:Styling and Theming
Tailwind CSS
Bootstrap
Custom CSS
Form Modes
The Form operation has three modes:1. Render Mode (Default)
Generate form HTML:2. Validate Mode
Validate form data without processing:3. Submit Mode
Validate and process submission:Complete Example: Contact Form with Security
Integration with Ensembles
Render and Process Flow
Best Practices
1. Always Enable CSRF Protection
2. Use Rate Limiting for Public Forms
3. Add CAPTCHA for High-Value Forms
4. Validate on Server-Side
Never trust client-side validation alone. Always validate on submission:5. Provide Clear Error Messages
6. Use Appropriate Field Types
Troubleshooting
Form Not Rendering
Issue: Form HTML is empty or undefined Solution: Check that form config has eitherfields or steps:

