Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module allows you to create and update Drupal Webforms using natural language instructions. Simply describe the form you need, and it will automatically generate the structure using the OpenAI API, or modify existing forms with your text-based requests.

AI Webform Generator

CONTENTS

  • Introduction
  • Features
  • Requirements
  • Installation
  • Configuration
  • Usage
  • Security notes
  • Recommended modules/libraries
  • Similar projects
  • Supporting this module
  • Community documentation
  • Maintainers

INTRODUCTION

AI Webform Generator allows site builders and administrators to create and modify Drupal Webforms using plain English instructions.

Instead of manually building forms field-by-field, users can describe what they need (for example, “a customer feedback form with name, email, rating, and comments”), and the module uses the OpenAI API to generate a complete Webform structure automatically.

The module can also update existing Webforms using natural language instructions such as adding fields, removing fields, or modifying validation rules without recreating the form.

FEATURES

  • Generate complete Drupal Webforms from natural language prompts
  • Update existing Webforms using AI instructions
  • Automatic mapping of AI JSON to Drupal Webform elements
  • Validation of AI-generated responses before applying them
  • Support for common form elements (text, email, number, select, radios, checkboxes, etc.)
  • Optional CAPTCHA integration for spam protection
  • Configurable OpenAI model, temperature, and token limits
  • Structured prompt engineering for consistent output
  • Secure API key configuration via admin UI or Key module

Use cases:

  • Customer feedback forms
  • Event registration forms
  • Surveys and questionnaires
  • Job application forms
  • Support request forms

REQUIREMENTS

Optional:

INSTALLATION

  1. Install via Composer:
    composer require drupal/ai_webform_generator
  2. Enable the module:
    drush en ai_webform_generator -y
  3. Clear cache:
    drush cr

CONFIGURATION

  1. Enable the module
  2. Go to:
    /admin/config/services/ai-webform-generator
  3. Configure OpenAI API key and model settings
  4. Adjust temperature, max tokens, and timeout
  5. Assign permissions:
    • Generate AI Webforms
    • Administer AI Webform Generator

USAGE

Navigate to:

/admin/structure/webform/ai-generator

Creating a new Webform

  1. Select “Create new Webform”
  2. Enter a natural language description
  3. Submit
  4. The module generates and saves a Webform automatically

Updating an existing Webform

  1. Select an existing Webform
  2. Enter modification instructions (e.g. add/remove fields)
  3. Submit
  4. The Webform is updated in place without changing its ID

Supported field types:

  • textfield
  • textarea
  • email
  • tel
  • url
  • number
  • date
  • datetime
  • checkbox
  • checkboxes
  • radios
  • select
  • hidden
  • password
  • range
  • managed_file
  • CAPTCHA (if enabled)

SECURITY NOTES

  • API key is stored in Drupal configuration
  • Use Key module for secure storage in production
  • Only trusted roles should generate Webforms (cost control)
  • Flood protection limits excessive API usage
  • Webform edit permissions are still enforced
  • Secrets are never logged

RECOMMENDED MODULES / LIBRARIES

SIMILAR PROJECTS

  • Webform module (manual form builder)

This module is unique because it introduces AI-driven form generation and modification directly into Drupal Webform workflows.

SUPPORTING THIS MODULE

Contributions, issues, and feature requests are welcome via the project page.

COMMUNITY DOCUMENTATION

MAINTAINERS

Chaitanya R Dessai

Activity

Tracked releases
3
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.2 Stable Jul 3, 2026
1.0.1 Stable Jul 3, 2026
1.0.0 Stable Jul 2, 2026