Workflow Initiative
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #2721129. -->
Reported by: [dixon_](https://www.drupal.org/user/239911)
>>>
<h2>Latest core conversations</h2>
<ul>
<li>Baltimore: <a href="https://www.youtube.com/watch?v=wwh-3jVqaWU">https://www.youtube.com/watch?v=wwh-3jVqaWU</a></li>
<li>New Orleans: <a href="https://www.youtube.com/watch?v=_rAB8DJnc8Y">https://www.youtube.com/watch?v=_rAB8DJnc8Y</a></li>
</ul>
<h2 id="background">Background</h2>
<p>Drupal 8 has so far seen many major improvements to our code (OOP, Symfony, etc) and our configuration (Config Management Initiative etc). But what about the third pillar — content? The Entity API team have done some amazing work on making our content APIs a lot more solid. But this work has not yet brought any new features for actually managing content, such as workflows, preview and staging. We propose an initiative with <a href="https://www.drupal.org#goal">goals to improve in this area</a> by including functionality in core based on what contrib modules have done for many years.</p>
<p>The scope of <a href="https://www.drupal.org#roadmap">the roadmap</a> is big. Very big. The work is likely to stretch over multiple years. There will be a <a href="https://www.drupal.org#team">dedicated team</a> that will drive and coordinate the work needed.</p>
<p>A big focus for this initiative will be to get the necessary sign-offs ahead of time in order to make it possible (and sustainable) to work toward the big end goals of this initiative. You can read about the specific sign-offs in each separate phase issue.</p>
<p>For some additional background, see Dries’ blog post: <a href="http://buytaert.net/improving-drupal-content-workflow">http://buytaert.net/improving-drupal-content-workflow</a></p>
<h2 id="goal">Goals</h2>
<p>Bring major improvements to Drupal’s content workflow, preview and staging capabilities. It will be done by primarily extending and improving aspects of the Entity API in core.</p>
<p>Much of the functionality that will be implemented will take heavy inspiration from modules that already are being battle tested in contrib, such as <a href="https://www.drupal.org/project/entity">Entity</a>, <a href="https://www.drupal.org/project/multiversion">Multiversion</a>, <a href="https://www.drupal.org/project/workspace">Workspace</a>, <a href="https://www.drupal.org/project/deploy">Deploy</a> and <a href="https://www.drupal.org/project/workbench_moderation">Workbench Moderation</a>.</p>
<h2 id="process">Process and where to find it<br>
<h2>
</h2></h2><p>Each phase in the <a href="https://www.drupal.org#roadmap">roadmap</a> is designed to be as simple and contained as possible to allow it to be committed/merged into core without dependency on the next phase. All issues should be tagged with <a href="https://www.drupal.org/project/issues/search/drupal?issue_tags=Workflow+Initiative">Workflow Initiative</a>.</p>
<p>Kanban board: <a href="https://contribkanban.com/sprint/WorkflowInitiative">https://contribkanban.com/sprint/WorkflowInitiative</a></p>
<h2 id="roadmap">Roadmap, should-have</h2>
<p>Each phase are broken out to its own planning issue. Phases aren't necessarily fully sequential. Some things can and will be done in parallell. </p>
<h3><a id="pa" href="https://www.drupal.org">Phase A</a>: Use the revision API in more places</h3>
<p>The idea of phase A is it to implement and use our great revision API for all content entities in core, except users. This will provide a necessary foundation for any moderation, workflow and staging capability. No new features or functionality is being added to the Entity API in this phase.</p>
<p>Plan issue: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2725433" title="Status: Closed (fixed)">#2725433: WI: Phase A: Use the revision API in more places</a></span></p>
<h3><a id="pb" href="https://www.drupal.org">Phase B</a>: Extend the revision API with support for parents</h3>
<p>Phase B is adding support for tracking parent revisions (for nonlinear revisions). Tracking where revisions come from is important in order to be able to solve conflicts between revisions made in different environments. This phase only required in order to make progress with <a href="https://www.drupal.org#ph">Phase H</a>.</p>
<p>Plan issue: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/drupal/issues/2786133" title="Status: Active">#2786133: WI: Phase B: Extend the revision API with support for parents</a></span></p>
<h3><a id="pc" href="https://www.drupal.org">Phase C</a>: Content Moderation module</h3>
<p>This phase will introduce an experimental module for moderating publishing state on individual content entities. Plan issues:</p>
<ol>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2755073" title="Status: Closed (fixed)">#2755073: WI: Content Moderation module roadmap</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2843494" title="Status: Closed (fixed)">#2843494: WI: Workflows module roadmap</a></span></li>
</ol>
<h3><del><a id="pd" href="https://www.drupal.org">Phase D</a>: Enable archive/purge storage</del></h3>
<p>This phase is no longer needed because of the implementation decision made for Phase E.</p>
<p>Plan issue: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-5"><a href="https://www.drupal.org/project/drupal/issues/2725447" title="Status: Closed (won't fix)">#2725447: WI: Phase D: Enable archive/purge storage</a></span></p>
<h3><a id="pe" href="https://www.drupal.org">Phase E</a>: Introduce Trash module</h3>
<p>Phase E will leverage the new workflow module and implement Trash as a new status. Some historic background: <a href="http://drupal4hu.com/node/233">http://drupal4hu.com/node/233</a></p>
<p>Plan issue: <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/drupal_cms/-/work_items/2786135" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/drupal_cms/-/work_items/2786135</a></span></p>
<h3><del><a id="pf" href="https://www.drupal.org">Phase F</a>: Workspace API and entity indexes</del></h3>
<p>Due to the way it's been decided to handle experimental modules in core, everything for Workspaces will be implemented as one experimental module in the next <a href="https://www.drupal.org#pg">phase G</a>.</p>
<h3><a id="pg" href="https://www.drupal.org">Phase G</a>: Introduce Workspace module</h3>
<p>This phase is split into two sub-phases. The primary purpuse here is to introduce the ability to preview and stage changes, within multiple "workspaces" on a single site.</p>
<ol>
<li>Experimental workspace module with MVP UI: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2732071" title="Status: Closed (fixed)">#2732071: WI: Workspace module roadmap</a></span></li>
<li>Full UI implementation: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-3"><a href="https://www.drupal.org/project/drupal/issues/2732081" title="Status: Closed (duplicate)">#2732081: WI: Phase G2: Full-site preview with Workspace UI</a></span></li>
</ol>
<h3><a id="ph" href="https://www.drupal.org">Phase H</a>: Workspace conflict management</h3>
<p>This phase will extend the Workspace module to provide conflict management for content changes in separate workspaces.</p>
<p>Plan issue: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/drupal/issues/2867707" title="Status: Active">#2867707: WI: Phase H: Conflict management and local workspace merging support</a></span></p>
<h2 id="roadmap-could">Roadmap, could-have</h2>
<h3 id="px">Phase X: Cross site content staging</h3>
<p>This phase would implement support for <strong>cross site content staging</strong>. See <a href="https://www.drupal.org#pg">phase G</a> where single site content staging is implemented.</p>
<p>Implement CouchDB compatible REST endpoints to support cross site content replication. See <a href="https://www.drupal.org/project/relaxed">Relaxed Web Services module</a> for the current contrib implementation.</p>
<h3 id="pxi">Phase XI: Autosave</h3>
<p>Big phase. This will be a separate module. Lots of details still to be figured out, below are some <strong>ideas</strong>:</p>
<ul>
<li>This would be the first feature that starts utilizing concepts of storing content offline in the browser’s <code>localStorage</code>. Some background: <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-17"><a href="https://www.drupal.org/project/drupal/issues/153313" title="Status: Closed (outdated)">#153313: ckeditor input is lost when using the browser's back button</a></span></li>
<li>Revisions could be auto-saved to <code>localStorage</code> and continuously replicated to backend. Changes would then be auto-saved even if the Internet connection is down. Rely on <a href="http://www.pouchdb.com">PouchDB</a> and HTTP APIs from <a href="https://www.drupal.org#px">phase X</a></li>
<li>Auto-saved revisions could be marked as such and later be purged. Rely on APIs from <a href="https://www.drupal.org#pc">phase C</a> (deleted flag, revision purging).</li>
<li>Auto-save might be implemented together with concurrent editing. Rely on APIs from <a href="https://www.drupal.org#pg>phase%20G</a>%20(conflict%20management).</li>%0A</ul>%0A<p>Related%20contrib%20projects:%0D</p>%0A<ul>%0A<li><a%20href=" https:>Autosave</a></li>
<li><a href="https://www.drupal.org/project/autosave_form">Autosave Form - provides autosave for D8</a></li>
</ul>
<h2>Not in scope</h2>
<h3>Content migration</h3>
<p>Although content migrations (between Drupal versions) will not be in scope, having the replication API available from <a href="https://www.drupal.org#pgs2">phase G, step 2</a> could still help this effort significantly.</p>
<h2>Related work</h2>
<ul>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2700261" title="Status: Closed (fixed)">#2700261: allRevisions() entity queries ignore non-revisionable fields</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2490136" title="Status: Closed (fixed)">#2490136: Enable revisions by default</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2707255" title="Status: Closed (fixed)">#2707255: All content entities should inherit baseFieldDefinitions</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2705433" title="Status: Closed (fixed)">#2705433: Node should implement RevisionLogInterface</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-3"><a href="https://www.drupal.org/project/drupal/issues/2705389" title="Status: Closed (duplicate)">#2705389: Selected content entities should extend EditorialContentEntityBase or RevisionableContentEntityBase</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-13"><a href="https://www.drupal.org/project/drupal/issues/1812202" title="Status: Needs work">#1812202: Add UUID support for entity revisions</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/drupal/issues/2690747" title="Status: Active">#2690747: [PLAN] Create an index of UUIDs</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-17"><a href="https://www.drupal.org/project/drupal/issues/1776796" title="Status: Closed (outdated)">#1776796: Provide a better UX for creating, editing & managing draft revisions.</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2465901" title="Status: Closed (fixed)">#2465901: [META] Make entity revision translation work</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2068063" title="Status: Closed (fixed)">#2068063: Change "Save and keep un-/published" buttons to a "Published" checkbox and an included "Save" button</a></span></li>
<li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/2350939" title="Status: Closed (fixed)">#2350939: Implement a generic revision UI</a></span></li>
</ul>
<h3>Contributed projects</h3>
<p>Much of the above functionality currently sits in a number of contributed modules outlined at: <a href="http://www.drupaldeploy.org">http://www.drupaldeploy.org</a></p>
<ul>
<li><a href="https://www.drupal.org/project/multiversion">Multiversion</a></li>
<li><a href="https://www.drupal.org/project/workspace">Workspace</a></li>
<li><a href="https://www.drupal.org/project/deploy">Deploy</a></li>
<li><a href="https://www.drupal.org/project/relaxed">RELAXed Web Services</a></li>
<li><a href="https://www.drupal.org/project/workbench_moderation">Workbench Moderation</a></li>
</ul>
<h2 id="team">Team and resources</h2>
<p>As with any major work in core, the work will be carried out by the community openly in the issue queue and anyone is welcome and encouraged to take part of the process. In addition, there will be a few people that are going to be working on this as part of their day-to-day job as well, funded by a few independent sources:</p>
<h3>Initiative coordinator</h3>
<ul>
<li><a href="https://www.drupal.org/u/dixon_">Dick Olsson (dixon_)</a></li>
</ul>
<h3>UX and frontend</h3>
<ul>
<li><a href="https://www.drupal.org/u/mogdesign">Jozef Toth (mogdesign)</a></li>
</ul>
<h3>Backend</h3>
<ul>
<li><a href="https://www.drupal.org/u/timmillwood">Tim Millwood (timmillwood)</a></li>
<li><a href="https://www.drupal.org/u/jeqq">Andrei Jechiu (jeqq)</a></li>
<li><a href="https://www.drupal.org/u/amateescu">Andrei Mateescu (amateescu)</a></li>
</ul>
<h3>Senior advisors</h3>
<ul>
<li><a href="https://www.drupal.org/u/skwashd">Dave Hall (skwashd)</a></li>
<li><a href="https://www.drupal.org/u/agentrickard">Ken Rickard (agentrickard)</a></li>
</ul>
<h2 id="signoff">Signoffs</h2>
<p>Each individual plan issue will list the required sign-offs.</p>
issue
GitLab AI Context
Project: project/ideas
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/ideas/-/raw/8.x-1.x/README.txt — project overview and setup
Repository: https://git.drupalcode.org/project/ideas
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD