PHPackages                             cntlscrut/drupal-eca-news-workflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cntlscrut/drupal-eca-news-workflow

ActiveDrupal-recipe[Utility &amp; Helpers](/categories/utility)

cntlscrut/drupal-eca-news-workflow
==================================

Complete automated editorial workflow system for news organizations using ECA (Event Condition Action)

v1.0.2(11mo ago)00GPL-2.0-or-laterCI failing

Since Jun 11Pushed 10mo agoCompare

[ Source](https://github.com/cntlscrut/drupal-eca-news-workflow)[ Packagist](https://packagist.org/packages/cntlscrut/drupal-eca-news-workflow)[ Docs](https://github.com/cntlscrut/drupal-eca-news-workflow)[ RSS](/packages/cntlscrut-drupal-eca-news-workflow/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

News Editorial Workflow Automation Recipe
=========================================

[](#news-editorial-workflow-automation-recipe)

[![Editorial Workflow](https://camo.githubusercontent.com/a39c7fd0755800234c50f9c7b5e6e5fe2555352801fd2d97b4c8faba65d2cd07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d5265636970652d626c75652e737667)](https://camo.githubusercontent.com/a39c7fd0755800234c50f9c7b5e6e5fe2555352801fd2d97b4c8faba65d2cd07/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d5265636970652d626c75652e737667) [![ECA](https://camo.githubusercontent.com/57769ceb4dd163b61c40179b8b4d636e4a51d4120a3de2c49245d7db085b58cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4543412d4175746f6d6174696f6e2d677265656e2e737667)](https://camo.githubusercontent.com/57769ceb4dd163b61c40179b8b4d636e4a51d4120a3de2c49245d7db085b58cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4543412d4175746f6d6174696f6e2d677265656e2e737667) [![Version](https://camo.githubusercontent.com/9b8a63eb5a126d3f3cbb0562344d18b70c87ad94abe2d66bbf324e05c489cfb2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e2e737667)](https://camo.githubusercontent.com/9b8a63eb5a126d3f3cbb0562344d18b70c87ad94abe2d66bbf324e05c489cfb2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e2e737667)

A comprehensive automated editorial workflow system built with ECA (Event Condition Action) for news organizations, magazines, and content-driven websites using Drupal.

🚀 Features
----------

[](#-features)

### 📝 Editorial Workflow

[](#-editorial-workflow)

- **Three-State Process**: Draft → In Review → Published
- **Bidirectional Editing**: Content can move back and forth between Draft and In Review
- **Smart Transitions**: Automatic validation and checks during state changes
- **Bulk Operations**: Manage multiple articles efficiently
- **Content Scheduling**: Plan publication dates and times

### 📧 Intelligent Notifications

[](#-intelligent-notifications)

- **Role-Based Alerts**: Targeted notifications based on user roles
- **Author Updates**: Real-time feedback on content status
- **Editor Assignments**: Automatic notification of pending reviews
- **Publication Alerts**: Stakeholder updates on published content
- **Customizable Templates**: Personalize notification messages

### 📊 Monitoring &amp; Analytics

[](#-monitoring--analytics)

- **Activity Logging**: Complete audit trail of all editorial actions
- **Performance Metrics**: Track editorial efficiency
- **User Analytics**: Monitor team productivity
- **Content Analytics**: Publication success metrics
- **Workflow Optimization**: Data-driven process improvements

### ⚡ Automation Engine

[](#-automation-engine)

- **Content Validation**: Automatic quality checks
- **SEO Compliance**: Built-in optimization checks
- **Category Assignment**: Smart content categorization
- **Publication Automation**: Scheduled publishing
- **Workflow Rules**: Customizable business logic

🛠️ Installation
---------------

[](#️-installation)

### Prerequisites

[](#prerequisites)

- Drupal 11.0+
- ECA module 2.1+
- Content Moderation module
- PHP 8.1+

### Quick Install

[](#quick-install)

```
# Using Drupal's recipe system
drush recipe recipes/news_editorial_workflow

# Or install manually
drush en eca_base eca_content eca_log eca_workflow content_moderation workflows
drush cim --partial --source=recipes/news_editorial_workflow/config
```

### Composer Installation

[](#composer-installation)

```
# If installing from a repository
composer require drupal/news_editorial_workflow_recipe
drush recipe news_editorial_workflow
```

📖 Usage
-------

[](#-usage)

### 1. Basic Workflow

[](#1-basic-workflow)

```
// Content starts in Draft state
$node = Node::create([
  'type' => 'news',
  'title' => 'Breaking News Article',
  'moderation_state' => 'draft',
]);
$node->save();

// Submit for review
$node->set('moderation_state', 'in_review');
$node->save(); // Triggers notification to editors

// Publish content
$node->set('moderation_state', 'published');
$node->save(); // Triggers publication notifications
```

### 2. Customizing Notifications

[](#2-customizing-notifications)

Edit the ECA model to customize notification behavior:

```
# In eca.eca.news_editorial_workflow.yml
events:
  content_moderation_state_change:
    conditions:
      - workflow_id: basic_editorial
      - from_state: draft
      - to_state: in_review
    actions:
      - send_email:
          to: '[node:author:mail]'
          subject: 'Article submitted for review'
```

### 3. Adding Custom States

[](#3-adding-custom-states)

Extend the workflow by adding new states:

```
# In workflows.workflow.basic_editorial.yml
type_settings:
  states:
    fact_check:
      label: 'Fact Check'
      weight: 3
  transitions:
    fact_check_to_review:
      from: [fact_check]
      to: in_review
```

🏗️ Architecture
---------------

[](#️-architecture)

### ECA Model Structure

[](#eca-model-structure)

```
News Editorial Workflow
├── Content Events
│   ├── State Change Triggers
│   ├── User Action Events
│   └── Scheduled Events
├── Conditions
│   ├── Role Checks
│   ├── Content Validation
│   └── Business Rules
└── Actions
    ├── Email Notifications
    ├── User Messages
    ├── Logging
    └── Content Operations

```

### State Machine

[](#state-machine)

 ```
graph LR
    A[Draft] -->|Submit| B[In Review]
    B -->|Approve| C[Published]
    B -->|Reject| A
    C -->|Unpublish| D[Unpublished]
    D -->|Republish| C
```

      Loading 🎨 Customization
---------------

[](#-customization)

### Adding New Roles

[](#adding-new-roles)

1. Create new role: `drush role:create fact_checker "Fact Checker"`
2. Update ECA conditions to include new role
3. Modify notification templates

### Custom Email Templates

[](#custom-email-templates)

```
email_templates:
  submission_notification:
    subject: '[site:name] - Article Submitted: [node:title]'
    body: |
      Dear Editor,

      A new article has been submitted for review:
      Title: [node:title]
      Author: [node:author:display-name]

      Review at: [node:url]
```

### Integration Examples

[](#integration-examples)

#### With Views Bulk Operations

[](#with-views-bulk-operations)

```
# Custom VBO action for bulk state changes
views_bulk_operations:
  actions:
    bulk_moderate_content:
      plugin_id: node_moderation_action
      configuration:
        state: published
```

#### With Scheduler Integration

[](#with-scheduler-integration)

```
# Automatic publication scheduling
scheduler_integration:
  publish_on: '[node:field_publish_date:value]'
  unpublish_on: '[node:field_unpublish_date:value]'
```

🧪 Testing
---------

[](#-testing)

### Running Tests

[](#running-tests)

```
# Unit tests
phpunit --group news_editorial_workflow

# Functional tests
drush test-run --group EditorialWorkflow

# Behat scenarios
behat features/editorial-workflow.feature
```

### Test Scenarios Included

[](#test-scenarios-included)

- ✅ Basic state transitions
- ✅ Role-based permissions
- ✅ Email notification delivery
- ✅ Bulk operations
- ✅ Content validation
- ✅ Performance under load

🔧 Configuration
---------------

[](#-configuration)

### Environment Variables

[](#environment-variables)

```
# Email configuration
EDITORIAL_SMTP_HOST=smtp.example.com
EDITORIAL_FROM_EMAIL=editorial@example.com

# Notification settings
EDITORIAL_ENABLE_SLACK=true
EDITORIAL_SLACK_WEBHOOK=https://hooks.slack.com/...
```

### Configuration Files

[](#configuration-files)

- `workflows.workflow.basic_editorial.yml` - Workflow definition
- `eca.eca.news_editorial_workflow.yml` - ECA configuration
- `eca.model.news_editorial_workflow.yml` - ECA model definition

📚 Examples
----------

[](#-examples)

### 1. News Website Setup

[](#1-news-website-setup)

Perfect for online newspapers with multiple reporters and editors:

```
drush recipe news_editorial_workflow
drush role:create reporter "Reporter"
drush role:create editor "Editor"
drush role:create publisher "Publisher"
```

### 2. Magazine Integration

[](#2-magazine-integration)

Ideal for monthly/weekly magazines with longer review cycles:

```
# Extended review process
workflow_modifications:
  additional_states:
    - copy_edit
    - fact_check
    - legal_review
```

### 3. Corporate Blog

[](#3-corporate-blog)

Streamlined workflow for corporate content:

```
# Simplified two-state workflow
simple_workflow:
  states: [draft, published]
  auto_publish: true
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Here's how to get involved:

### Development Setup

[](#development-setup)

```
git clone https://github.com/your-org/news-editorial-workflow-recipe.git
cd news-editorial-workflow-recipe
composer install
ddev start
```

### Contribution Guidelines

[](#contribution-guidelines)

1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
4. **Push** to the branch (`git push origin feature/amazing-feature`)
5. **Open** a Pull Request

### Code Standards

[](#code-standards)

- Follow Drupal coding standards
- Write comprehensive tests
- Document all changes
- Update README as needed

📄 License
---------

[](#-license)

This project is licensed under the GPL-2.0+ License - see the [LICENSE](LICENSE) file for details.

🆘 Support
---------

[](#-support)

- **Documentation**: [docs.example.com](https://docs.example.com)
- **Issues**: [GitHub Issues](https://github.com/your-org/news-editorial-workflow-recipe/issues)
- **Discussions**: [GitHub Discussions](https://github.com/your-org/news-editorial-workflow-recipe/discussions)
- **Slack**: [\#editorial-workflow](https://drupal.slack.com/channels/editorial-workflow)

🎖️ Credits
----------

[](#️-credits)

- Built with ❤️ by the [ECA Team](https://www.drupal.org/project/eca)
- Inspired by real-world newsroom workflows
- Community contributions from editorial professionals

🗺️ Roadmap
----------

[](#️-roadmap)

### Version 1.1 (Planned)

[](#version-11-planned)

- AI-powered content suggestions
- Advanced analytics dashboard
- Multi-site workflow synchronization
- Mobile editorial app integration

### Version 1.2 (Future)

[](#version-12-future)

- Video/multimedia workflow support
- Social media integration
- Real-time collaborative editing
- Advanced permission granularity

---

**Made with ❤️ for the Drupal Community**

[![Drupal](https://camo.githubusercontent.com/b52009e8ff22f38e5fd8aea8e8f13eb6e91be4ba427ab9c912f188f2417f7f0c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f44727570616c2d626c75652e737667)](https://drupal.org) [![ECA](https://camo.githubusercontent.com/3f90c8fce20f16abe97c8548e08ccac02056b46b6f7d3f3e79b1534aa58d7dbe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4543412d677265656e2e737667)](https://www.drupal.org/project/eca) [![Community](https://camo.githubusercontent.com/fac4abc9c1f479a0c29848b1f1ef7f2a74adab8e5844fad41df355d67924ca30/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d6d756e6974792d44726976656e2d6f72616e67652e737667)](https://github.com/your-org/news-editorial-workflow-recipe)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ecccbc84d722a05668d2b3af09cdb34fdbeaa3c15f483bfda6e81446b439ec3?d=identicon)[cntlscrut](/maintainers/cntlscrut)

---

Top Contributors

[![cntlscrut](https://avatars.githubusercontent.com/u/553645?v=4)](https://github.com/cntlscrut "cntlscrut (6 commits)")

---

Tags

automationdrupalworkflow newsrecipecontent moderationeditorialeca

### Embed Badge

![Health badge](/badges/cntlscrut-drupal-eca-news-workflow/health.svg)

```
[![Health](https://phpackages.com/badges/cntlscrut-drupal-eca-news-workflow/health.svg)](https://phpackages.com/packages/cntlscrut-drupal-eca-news-workflow)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
