Add handler
Config limit handler
Webform show limit message

Webform Redis Limit Handler limits the total number of submissions a webform accepts. It keeps the count in Redis and reserves each slot with an atomic increment, so many people submitting at the same moment cannot exceed the limit.

Typical uses: event or class registration with limited seats, limited offers, and campaigns that must stop at a fixed number of entries.

Features

  • Set a total submission limit per webform. Leave it empty to disable the limit.
  • Only completed submissions take a slot. Wizard pages, previews, drafts and edits of existing submissions do not.
  • Deleting a completed submission frees its slot.
  • Custom warning message, shown on the form once the limit is reached and when a submission is refused.
  • View, adjust or reset the current counter from the handler settings.
  • If the Redis key is missing, the counter is rebuilt from the completed submissions stored in the database.
  • Submissions made through code or an API are limited too.
  • Redis keys use the same prefix as the Redis module, so sites sharing a Redis server do not overwrite each other.

Requirements

  • Drupal ^10.1, 11 or 12
  • Webform ^6.2
  • Redis module ^1.0, configured with a running Redis server

Configuration

  1. Open the webform's Settings > Emails / Handlers page.
  2. Add the Redis limit submission handler.
  3. Set the Total limit and, optionally, a Warning message.

Notes for developers

For programmatic submissions (for example WebformSubmissionForm::submitFormValues()), validation fails once the limit is reached. A save that cannot get a slot throws SubmissionLimitReachedException.

Limitations

  • The limit is a total per webform, not per user or per source entity.
  • The form stays visible after the limit is reached; submitting it is refused.
  • The counter is rebuilt from stored submissions. If saving results is disabled, losing the Redis data resets the count.

Project information

Releases