Form element (in custom theme)
Key settings for element
Access can be set for each transition
Results can be filtered by the workflow states
Transitions can be disabled by conditional

This module provides a new element type for Webforms (D8+) that uses the core Workflows functionality to move submissions through a webform.

This means you define the workflow (with workflow type "Webform workflow"), then users with access can use the workflow transitions to modify the workflow status for each submission when editing. You can then track these submissions, trigger handler events, etc based on the workflow progress.

This is the Drupal 8/9 alternative to "webform_workflow" in D7.

Functionality

  • Results view is filterable by workflow status
  • Access controls for the workflow element determine who can use the workflow
  • Access controls for the element per transition controls who can do what
  • Conditional logic can be used to disable workflow transitions
  • Emails can be sent per transition using a handler, including using tokens relating to the workflow change
  • User facing and private log messages can be entered when transitioning, and set to be optional/required/hidden per element
  • Each transition is logged for the submission, if logs enabled for the webform
  • Maestro task plugin for assigning workflow transitions

Included submodules

Enable via drush or via the Extend user interface:

  • webform_workflows_element_views: provides a filter for views to filter submissions by workflow state, including showing colors if set in the workflow element
  • webform_workflows_element_query: provides a service for querying submissions based on webform workflow state
  • webform_workflows_element_maestro: [experimental] provides a maestro task for submission workflow transitions

Example

As an example, if you have the following states and transitions:

States:
1. Submitted
2. In process
3. Approved

Transitions:
a) "Start processing" (Submitted -> In process)
b) "Approve" (In process -> Approved)

A user will only be able to move a Submitted form to In process - however they will not be able to skip to Approved as there is no transition set up in the workflow for that. This allows controlling the logic of the workflow (and represents a change from the D7 webform_workflows module which allowed any state to be changed to any state).

How to use

See https://www.drupal.org/docs/contributed-modules/webform-workflows-element/how-to-use-the-webform-workflows-element

Create an e-mail handler on a workflow change

See https://www.drupal.org/docs/contributed-modules/webform-workflows-element/create-an-e-mail-handler-on-a-workflow-change

Control access to individual transitions

See https://www.drupal.org/docs/contributed-modules/webform-workflows-element/control-access-to-individual-transitions

Disable states based on conditional logic

See https://www.drupal.org/docs/contributed-modules/webform-workflows-element/disable-transitions-based-on-conditional-logic

Development status

This module is under active development as of August 2021, and welcomes testing and contribution. A key area that would be valuable are writing tests, as the module was developed for immediate business needs and there has not been time to write these yet.

Contributors

This module originally contributed by Students' Union UCL (UCLU), continuing our tradition of using webforms and workflows for everything - we also originally developed the original D7 webform workflow modulemany years ago.

Supporting organizations: 
original developer

Project information

Releases