Research and try to add Field Widget Actions (FWA) support for moderation_state using the moderation_state_default widget (content_moderation)
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3566585. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !1107
>>>
<p>```html<br>
[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>Research and try to add Field Widget Actions (FWA) support for moderation_state using the moderation_state_default widget (content_moderation).<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Content moderation workflows can benefit from AI-assisted suggestions for state transitions (for example, recommending Draft vs Published based on content completeness, policy checks, or editorial signals). Currently, the <code>moderation_state_default</code> widget does not provide an in-widget way to trigger AI Automators to set or suggest the moderation state.<br>
This issue proposes adding Field Widget Actions (FWA) support for the <code>moderation_state</code> automator on the <code>moderation_state_default</code> widget, using <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code> as reference implementation. The implementation requires the core Content Moderation module (<code>content_moderation</code>) as it provides the moderation state field and widget.<br>
A simple way to test this is to configure a <code>moderation_state</code> AI Automator that inspects the entity content (for example title/body) and applies a recommended moderation state through the FWA in the moderation widget.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a new FWA plugin for the <code>moderation_state_default</code> widget that triggers the <code>moderation_state</code> automator, modeled after <code>modules/ai_automators/src/Plugin/FieldWidgetAction/Email.php</code>.</li>
<li>Declare a dependency on <code>content_moderation</code> and ensure the FWA is only available when the moderation state field and widget are in use.</li>
</ul>
<p>- <strong>This issue was created with the help of AI</strong></p>
issue