Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Workflows Diagram

Security covered Under active development 43 sites

This module generates a flowchart diagram of your Drupal core Workflows, using Mermaid JS for rendering. It displays the workflow visually on the edit form and can be used elsewhere with custom styling options.

Display a flow chart representation of a core Workflows module workflow.

Uses Mermaid JS for rendering.

See also

  • Workflows Field Diagram to display workflow as a field via this module: https://www.drupal.org/project/workflows_field_diagram
  • Content model documentation - impressive module that produces diagrams for workflows alongside all other things; the main difference being this module is intended specifically for and only within the workflows context (and therefore used by other modules such as Webform Workflows Element when they need to render the diagram), while that module has a larger scope.

Usage

By default this shows the diagram in a details box on the workflow edit form.

The template can also be used wherever the render API works, e.g. in a controller:

    // We load the workflow:
    $workflow = Workflow::load('basic_approval');

    // We can add CSS classes to states and transitions:
    $classes = [
      'states' => [
        'approved' => 'workflow-state-green',
        'rejected' => 'workflow-state-red',
      ],
      'transitions' => [
        'approve' => 'workflow-transition-green',
        'reject' => 'workflow-transition-red',
      ],
    ];

    // We can disable states or transitions,
    // if they are not used for a specific usage of the workflow:
    $disabled = [
      'states' => [
        'queried'
      ],
      'transitions' => [
        'query',
        'refer_to_higher_level',
      ],
    ]

    $build['diagram'] = [
      '#theme'    => 'workflows_diagram',
      '#workflow' => $workflow,
      '#classes'  => $classes,
      '#disabled' => $disabled,
    ];

Drupal 9–10 · not 11

Ask your assistant about Workflows Diagram

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0 Stable 9–10 Nov 21, 2023