<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Neharika Mohan</title>
    <description>The latest articles on DEV Community by Neharika Mohan (@neharika_mohan).</description>
    <link>https://dev.to/neharika_mohan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3902732%2Ff8ed34f4-f755-4a43-88d6-65584144c423.png</url>
      <title>DEV Community: Neharika Mohan</title>
      <link>https://dev.to/neharika_mohan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neharika_mohan"/>
    <language>en</language>
    <item>
      <title>ECA vs Rules vs Custom Code: The 2-Minute Decision Guide</title>
      <dc:creator>Neharika Mohan</dc:creator>
      <pubDate>Wed, 13 May 2026 10:16:39 +0000</pubDate>
      <link>https://dev.to/neharika_mohan/eca-vs-rules-vs-custom-code-the-2-minute-decision-guide-26jg</link>
      <guid>https://dev.to/neharika_mohan/eca-vs-rules-vs-custom-code-the-2-minute-decision-guide-26jg</guid>
      <description>&lt;p&gt;One of the most common Drupal architecture questions is: &lt;strong&gt;should this workflow live in ECA or custom code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer depends on your project version, workflow complexity, and team capabilities. This guide provides a practical decision framework.&lt;/p&gt;




&lt;h2&gt;
  
  
  Current State of Each Option
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Rules&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Widely used in Drupal 7 with mature ecosystem&lt;/li&gt;
&lt;li&gt;Available for Drupal 8+ but still in development&lt;/li&gt;
&lt;li&gt;For greenfield Drupal 10/11 projects, ECA generally has stronger ecosystem momentum&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;ECA (Event-Condition-Action)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Built specifically for Drupal 8+ architecture&lt;/li&gt;
&lt;li&gt;Uses modern Drupal APIs (Typed Data, Plugin system)&lt;/li&gt;
&lt;li&gt;Provides visual workflow modeling with BPMN&lt;/li&gt;
&lt;li&gt;Actively developed with regular releases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note on ECA limitations:&lt;/strong&gt; Visual workflows become harder to maintain once business logic becomes deeply nested or computation-heavy.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Custom Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Traditional PHP module development&lt;/li&gt;
&lt;li&gt;Full control over implementation&lt;/li&gt;
&lt;li&gt;Direct access to Drupal APIs&lt;/li&gt;
&lt;li&gt;Better suited for complex algorithms&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Decision Matrix
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Your Scenario&lt;/th&gt;
&lt;th&gt;Recommended Approach&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Drupal 7 project&lt;/td&gt;
&lt;td&gt;Rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Drupal 8+ automation&lt;/td&gt;
&lt;td&gt;ECA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complex calculations&lt;/td&gt;
&lt;td&gt;Custom Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom entity types&lt;/td&gt;
&lt;td&gt;Custom Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reusable libraries&lt;/td&gt;
&lt;td&gt;Custom Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long-running tasks&lt;/td&gt;
&lt;td&gt;Custom Code + Queue API&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  When to Use ECA
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ECA works well for:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event-driven workflows:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User registration actions&lt;/li&gt;
&lt;li&gt;Content publishing workflows&lt;/li&gt;
&lt;li&gt;Form submissions&lt;/li&gt;
&lt;li&gt;Scheduled tasks via cron&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conditional logic:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Role-based field visibility&lt;/li&gt;
&lt;li&gt;Content type specific actions&lt;/li&gt;
&lt;li&gt;Value-based triggers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Form alterations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic field visibility&lt;/li&gt;
&lt;li&gt;Conditional validation&lt;/li&gt;
&lt;li&gt;Field option modifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Content automation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Publishing workflows&lt;/li&gt;
&lt;li&gt;Content moderation&lt;/li&gt;
&lt;li&gt;Automated notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Team considerations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site builders need to maintain workflows&lt;/li&gt;
&lt;li&gt;Visual documentation is valuable&lt;/li&gt;
&lt;li&gt;Configuration management preferred&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  When to Use Custom Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Custom code is better for:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complex business logic:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-step calculations&lt;/li&gt;
&lt;li&gt;Integration with external APIs&lt;/li&gt;
&lt;li&gt;Data processing pipelines&lt;/li&gt;
&lt;li&gt;Algorithm implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Performance requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-volume operations&lt;/li&gt;
&lt;li&gt;Time-sensitive processing&lt;/li&gt;
&lt;li&gt;Resource-intensive tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Async processing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For long-running or API-heavy tasks, consider combining ECA triggers with Queue API workers&lt;/li&gt;
&lt;li&gt;Background jobs via cron&lt;/li&gt;
&lt;li&gt;Batch operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reusability:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shared across multiple projects&lt;/li&gt;
&lt;li&gt;Custom field types or widgets&lt;/li&gt;
&lt;li&gt;API clients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom functionality:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New entity types&lt;/li&gt;
&lt;li&gt;Custom database schemas&lt;/li&gt;
&lt;li&gt;Core behavior modifications&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  When to Use Rules
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rules makes sense for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Drupal 7 projects where it's already working&lt;/li&gt;
&lt;li&gt;Teams familiar with Rules D7 patterns&lt;/li&gt;
&lt;li&gt;Projects not planning to upgrade soon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For Drupal 8+ projects:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ECA provides better integration with modern Drupal APIs&lt;/li&gt;
&lt;li&gt;Consider ECA for new implementations&lt;/li&gt;
&lt;li&gt;For greenfield Drupal 10/11 projects, ECA generally has stronger ecosystem momentum&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Practical Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Example 1: Welcome Email&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; Send email when user registers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECA approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure in UI&lt;/li&gt;
&lt;li&gt;Site builders can modify text&lt;/li&gt;
&lt;li&gt;No code deployment needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write hook implementation&lt;/li&gt;
&lt;li&gt;Requires developer for changes&lt;/li&gt;
&lt;li&gt;Standard code deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best choice:&lt;/strong&gt; ECA for this scenario&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Example 2: Shipping Calculator&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; Calculate shipping costs based on weight, destination, carrier rates, promotions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECA approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Possible but complex to maintain&lt;/li&gt;
&lt;li&gt;Many connected actions needed&lt;/li&gt;
&lt;li&gt;Visual workflows become harder to maintain with deeply nested logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clean service class&lt;/li&gt;
&lt;li&gt;Unit testable&lt;/li&gt;
&lt;li&gt;Better for complex calculations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best choice:&lt;/strong&gt; Custom code for this scenario&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Example 3: Content Publishing Workflow&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; Auto-publish when review status changes to approved&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECA approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual workflow diagram&lt;/li&gt;
&lt;li&gt;Easy to understand and modify&lt;/li&gt;
&lt;li&gt;Self-documenting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event subscriber pattern&lt;/li&gt;
&lt;li&gt;Less visible to non-developers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best choice:&lt;/strong&gt; ECA for this scenario&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Example 4: API Integration with Long Processing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; Sync data with external system, processing takes 30+ seconds&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hybrid approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ECA triggers the workflow on content save&lt;/li&gt;
&lt;li&gt;Custom Queue API worker handles the actual processing&lt;/li&gt;
&lt;li&gt;Prevents timeouts and blocking requests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best choice:&lt;/strong&gt; ECA trigger + Custom Queue worker&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hybrid Approach
&lt;/h2&gt;

&lt;p&gt;Most projects benefit from using both:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example project structure:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;your_project/
├── config/
│   └── eca/
│       ├── user_registration.yml
│       ├── content_moderation.yml
│       └── form_validation.yml
├── custom_modules/
│   ├── your_shipping/
│   ├── your_payments/
│   ├── your_api_client/
│   └── your_queue_workers/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use ECA for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User workflows&lt;/li&gt;
&lt;li&gt;Content automation&lt;/li&gt;
&lt;li&gt;Form behaviors&lt;/li&gt;
&lt;li&gt;Email notifications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use custom code for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business logic&lt;/li&gt;
&lt;li&gt;External integrations&lt;/li&gt;
&lt;li&gt;Performance-critical paths&lt;/li&gt;
&lt;li&gt;Queue workers for async processing&lt;/li&gt;
&lt;li&gt;Reusable components&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Making the Decision
&lt;/h2&gt;

&lt;p&gt;Ask yourself these questions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. What's your Drupal version?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;D7: Rules is fine&lt;/li&gt;
&lt;li&gt;D8+: Consider ECA for new automation&lt;/li&gt;
&lt;li&gt;D10/11: ECA has stronger ecosystem momentum&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Can you describe it as "When X happens, if Y is true, do Z"?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Yes: ECA is likely a good fit&lt;/li&gt;
&lt;li&gt;No: Might need custom code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. How complex is the logic?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple conditions: ECA&lt;/li&gt;
&lt;li&gt;Deeply nested logic: Custom code&lt;/li&gt;
&lt;li&gt;Complex calculations: Custom code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Who needs to maintain it?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site builders: ECA&lt;/li&gt;
&lt;li&gt;Developers only: Either works&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. What are the performance requirements?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard: ECA works fine&lt;/li&gt;
&lt;li&gt;High-volume or async: Custom code + Queue API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. How long does it take to run?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under 5 seconds: ECA is fine&lt;/li&gt;
&lt;li&gt;Long-running: Custom code with Queue API&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Migration Path
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Moving from Rules to ECA:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Document existing Rules functionality&lt;/li&gt;
&lt;li&gt;Prioritize which to migrate first&lt;/li&gt;
&lt;li&gt;Build equivalent ECA models&lt;/li&gt;
&lt;li&gt;Test thoroughly in development&lt;/li&gt;
&lt;li&gt;Run both in parallel briefly&lt;/li&gt;
&lt;li&gt;Switch to ECA when confident&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Token syntax may differ&lt;/li&gt;
&lt;li&gt;Event names might not match exactly&lt;/li&gt;
&lt;li&gt;Test with actual data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Common Use Cases
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ECA is commonly used for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Welcome emails and user onboarding&lt;/li&gt;
&lt;li&gt;Content approval workflows&lt;/li&gt;
&lt;li&gt;Notification systems&lt;/li&gt;
&lt;li&gt;Form field show/hide logic&lt;/li&gt;
&lt;li&gt;Auto-tagging content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code is commonly used for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payment gateway integrations&lt;/li&gt;
&lt;li&gt;Complex pricing logic&lt;/li&gt;
&lt;li&gt;Third-party API clients&lt;/li&gt;
&lt;li&gt;Queue workers for background processing&lt;/li&gt;
&lt;li&gt;Custom reporting&lt;/li&gt;
&lt;li&gt;Data transformation pipelines&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Technical Considerations
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ECA strengths:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual documentation&lt;/li&gt;
&lt;li&gt;Configuration management&lt;/li&gt;
&lt;li&gt;Site builder friendly&lt;/li&gt;
&lt;li&gt;No deployment for changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ECA limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual workflows become difficult with deeply nested logic&lt;/li&gt;
&lt;li&gt;Not ideal for computation-heavy tasks&lt;/li&gt;
&lt;li&gt;Limited debugging compared to code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code strengths:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full control and flexibility&lt;/li&gt;
&lt;li&gt;Better for complex algorithms&lt;/li&gt;
&lt;li&gt;Unit testable&lt;/li&gt;
&lt;li&gt;Better debugging tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom code limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requires developer for changes&lt;/li&gt;
&lt;li&gt;Code deployment needed&lt;/li&gt;
&lt;li&gt;Less visible to non-developers&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Choosing Your Path
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;For most Drupal 8+ automation needs:&lt;/strong&gt; Start with ECA. It handles the majority of event-driven workflows well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When logic gets complex:&lt;/strong&gt; Move to custom code. Visual workflows become harder to maintain once business logic becomes deeply nested or computation-heavy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For long-running operations:&lt;/strong&gt; Combine ECA triggers with Queue API workers to handle async processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Drupal 7:&lt;/strong&gt; Rules continues to work well for its original use case.&lt;/p&gt;




&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ECA:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/project/eca" rel="noopener noreferrer"&gt;ECA Module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ecaguide.org/" rel="noopener noreferrer"&gt;ECA Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/project/bpmn_io" rel="noopener noreferrer"&gt;BPMN.io Modeler&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Rules:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/project/rules" rel="noopener noreferrer"&gt;Rules Module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/docs/contributed-modules/rules" rel="noopener noreferrer"&gt;Rules Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Custom Development:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/docs/drupal-apis/plugin-api" rel="noopener noreferrer"&gt;Plugin API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/docs/creating-custom-modules/subscribe-to-and-dispatch-events" rel="noopener noreferrer"&gt;Event Subscribers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.drupal.org/docs/drupal-apis/queue-api" rel="noopener noreferrer"&gt;Queue API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;The best Drupal projects don't choose between ECA and custom code—they use each where it fits best.&lt;/p&gt;

&lt;p&gt;Start with the simplest solution that meets your needs. ECA for straightforward workflows, custom code for complex logic, and hybrid approaches when combining both provides the best result.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What approach do you use for automation in your Drupal projects?&lt;/strong&gt; Share your experience in the comments.&lt;/p&gt;

</description>
      <category>drupal</category>
      <category>eca</category>
      <category>rules</category>
      <category>webdev</category>
    </item>
    <item>
      <title>ECA vs Custom Modules in Drupal - When to Use Which</title>
      <dc:creator>Neharika Mohan</dc:creator>
      <pubDate>Mon, 04 May 2026 13:03:40 +0000</pubDate>
      <link>https://dev.to/neharika_mohan/eca-vs-custom-modules-in-drupal-when-to-use-which-2ooh</link>
      <guid>https://dev.to/neharika_mohan/eca-vs-custom-modules-in-drupal-when-to-use-which-2ooh</guid>
      <description>&lt;p&gt;If you've worked with Drupal long enough, you've faced this decision:&lt;br&gt;
&lt;em&gt;Do I build a custom module for this or can ECA handle it?&lt;/em&gt;&lt;br&gt;
Here's a straight answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use ECA When&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The logic is workflow-based&lt;/strong&gt;&lt;br&gt;
Approvals, notifications, reminders, role assignments anything that follows an "if this then that" pattern is exactly what ECA is built for.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-developers need to maintain it&lt;/strong&gt; ECA workflows live in the admin UI. Your client or site admin can read, modify, and debug them without touching code. A custom module cannot offer that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed matters&lt;/strong&gt; A workflow that would take a day to build as a custom module can be done in ECA in an hour. For agencies and freelancers, that margin is money.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You want reusability&lt;/strong&gt; ECA configs export as YAML. Drop them into any Drupal project and they work. No copy pasting PHP across projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use a Custom Module When&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You need complex business logic&lt;/strong&gt; Heavy data transformations, third-party API calls with custom authentication, or multi-step calculations are better handled in PHP where you have full control.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance is critical&lt;/strong&gt; ECA adds overhead. For high-frequency operations like processing thousands of records a lean custom service will always outperform an ECA workflow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You need testability&lt;/strong&gt; Custom modules can be unit tested. ECA workflows currently cannot. If your team writes tests, custom code wins here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ECA doesn't have the event or action you need&lt;/strong&gt; ECA is extensible but not infinite. Sometimes the specific trigger or action you need simply doesn't exist yet and writing a custom module is the only option.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Sweet Spot Use Both&lt;/strong&gt;&lt;br&gt;
This is what experienced Drupal developers actually do.&lt;br&gt;
Write a custom ECA action or event in PHP, then wire it into an ECA workflow visually. You get the power of custom code with the flexibility of a visual workflow.&lt;br&gt;
Example: Write a custom action that calculates a student's eligibility score in PHP then trigger it from an ECA workflow on form submission, send an email based on the result, and assign a role. Clean separation of concerns.&lt;/p&gt;

&lt;p&gt;Quick Reference&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Email/notification workflows&lt;/td&gt;
&lt;td&gt;ECA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approval &amp;amp; review flows&lt;/td&gt;
&lt;td&gt;ECA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Heavy data processing&lt;/td&gt;
&lt;td&gt;Custom module&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bottom Line&lt;/strong&gt;&lt;br&gt;
ECA is not a replacement for custom modules it's a replacement for simple custom modules. Know the difference and you'll ship faster, write less throwaway code, and build systems that clients can actually maintain.&lt;br&gt;
In the next post I'll show you how to write a custom ECA action in PHP and plug it into a workflow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Follow so you don't miss it.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>drupal</category>
      <category>php</category>
      <category>tutorial</category>
      <category>eca</category>
    </item>
    <item>
      <title>What is ECA in Drupal And Why You Should Know It</title>
      <dc:creator>Neharika Mohan</dc:creator>
      <pubDate>Tue, 28 Apr 2026 16:13:28 +0000</pubDate>
      <link>https://dev.to/neharika_mohan/what-is-eca-in-drupal-and-why-you-should-know-it-1mj</link>
      <guid>https://dev.to/neharika_mohan/what-is-eca-in-drupal-and-why-you-should-know-it-1mj</guid>
      <description>&lt;p&gt;If you've been building Drupal sites, you've probably written custom modules just to send an automated email or build a simple approval flow.&lt;br&gt;
What if you didn't have to?&lt;br&gt;
That's what ECA is for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ECA = Events, Conditions, Actions&lt;/strong&gt;&lt;br&gt;
It's a Drupal module that lets you build automated workflows from the admin panel no custom PHP needed.&lt;br&gt;
The mental model is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;When this happens → check this → do this&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Real example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event: User submits a form&lt;/li&gt;
&lt;li&gt;Condition: User role is "Student"&lt;/li&gt;
&lt;li&gt;Action: Send a welcome email + assign them to a group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zero code. Built visually in minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Developers Love It&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual interface — flowchart style, easy to debug and explain to clients&lt;/li&gt;
&lt;li&gt;Covers most use cases — form submissions, entity changes, user login, scheduled triggers&lt;/li&gt;
&lt;li&gt;Works with popular modules — Webform, Views, Token, Rules&lt;/li&gt;
&lt;li&gt;Exportable — save workflows as config, reuse across projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick Install&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require drupal/eca drupal/bpmn_io
drush en eca eca_base eca_content eca_user eca_form eca_ui bpmn_io
drush cr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then go to Configuration → ECA and you'll see the visual workflow builder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bottom Line&lt;/strong&gt;&lt;br&gt;
ECA replaces hours of custom module development with a visual, maintainable workflow anyone on your team can understand.&lt;/p&gt;

&lt;p&gt;Have a workflow you're currently solving with custom code? Drop it in the comments might be the next tutorial.&lt;/p&gt;

</description>
      <category>eca</category>
      <category>drupal</category>
      <category>webdev</category>
      <category>php</category>
    </item>
  </channel>
</rss>
