Drupal is a registered trademark of Dries Buytaert
drupal 11.4.0 Update released for Drupal core (11.4.0)! drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)!

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

Total releases
1
First release
Jul 2026
Latest release
1 day ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Jul 2, 2026