AEM Workflows

Learn how AEM Workflows automate content processes — from approval workflows to asset processing and custom business logic.

Last reviewed: December 2024

·AEM 6.xAEM as a Cloud Service
✅
Quick Understanding: An AEM Workflow is an automated process that moves content through a series of steps. The most common example: when an author submits a page for review, a workflow sends it to an approver, who approves or rejects it, and the page is then published or returned for revision.

🔍 What Is It?

AEM Workflows are built on the OSGi-based CQ Workflow engine. A workflow consists of:

  • →Workflow Model — The definition of the process (steps and transitions)
  • →Workflow Instance — A running execution of a workflow model
  • →Workflow Steps — Individual actions (participant step, process step, etc.)
  • →Payload — The content being processed (usually a page or asset path)
  • →Workflow Inbox — Where users see tasks assigned to them

Built-in Workflow Models:

  • →Request for Activation (page approval)
  • →DAM Asset Update (asset processing)
  • →Request for Deactivation
  • →Scheduled Activation

🎯 Why Do We Need It?

Workflows automate content governance processes:

  • →Approval workflows — Content must be approved before publishing
  • →Asset processing — Automatically generate thumbnails, extract metadata, transcode video
  • →Notification workflows — Notify teams when content changes
  • →Custom business processes — Any multi-step content operation

Without workflows, these processes would be manual, error-prone, and hard to audit.

🏗️ What Happens in Real Projects?

Common Real-World Workflows:

  1. Content Approval — Author writes → Editor reviews → Legal approves → Publish
  2. Asset Ingestion — Upload image → Generate thumbnails → Extract EXIF → Index for search
  3. Campaign Launch — Build pages → QA review → Stakeholder approval → Schedule publish
  4. Content Archival — Identify old pages → Notify owner → Archive or delete

In enterprise projects, workflow design is a significant part of the requirements phase — mapping business processes to AEM workflow models.

⚙️ How It Works

Workflow Step Types:

  • →Participant Step — Assigns a task to a user/group. Workflow pauses until they complete it.
  • →Dynamic Participant Step — Determines the participant at runtime (e.g., based on content path)
  • →Process Step — Executes Java code (OSGi service). Used for automated processing.
  • →OR Split / AND Split — Branching and parallel execution
  • →Container Step — A sub-workflow
  • →Goto Step — Loop back to a previous step

Workflow Launcher:

Automatically triggers a workflow when content changes. Configure in Tools → Workflow → Launchers. Example: trigger "DAM Asset Update" whenever an asset is created or modified.

💻 Example

Custom Workflow Process Step — A Java OSGi service that implements a custom workflow step.

java
@Component(
    service = WorkflowProcess.class,
    property = {
        "process.label=Send Approval Email"
    }
)
public class SendApprovalEmailProcess implements WorkflowProcess {

    @Reference
    private EmailService emailService;

    @Override
    public void execute(WorkItem workItem, WorkflowSession session,
                        MetaDataMap args) throws WorkflowException {
        // Get the payload (the page being processed)
        String payloadPath = workItem.getWorkflowData()
            .getPayload().toString();

        // Get process arguments from workflow model config
        String recipientEmail = args.get("recipientEmail",
            "approver@mysite.com");

        // Send notification email
        boolean sent = emailService.sendEmail(
            recipientEmail,
            "Content Awaiting Approval",
            "Please review: " + payloadPath
        );

        if (!sent) {
            throw new WorkflowException(
                "Failed to send approval email for: " + payloadPath
            );
        }
    }
}

🤔 Common Confusions

❓ What is the difference between a Workflow and a Launcher?

A Workflow Model defines the process. A Launcher automatically starts a workflow when specific events occur (node created, modified, deleted). Without a launcher, workflows must be started manually. DAM Asset Update workflow is triggered by a launcher on asset creation/modification.

❓ Where do workflow tasks appear for users?

In the AEM Inbox (/aem/inbox). Users see their assigned tasks there and can complete, delegate, or reject them. The Inbox is the main interface for workflow participants.

🚨 Common Production Issues

Workflow queue growing

too many workflow instances running simultaneously. Check workflow purge configuration and consider async workflows.

Workflow not triggering

launcher configuration is wrong or disabled. Check Tools → Workflow → Launchers.

Participant step not assigning to the right user

user/group doesn't exist or dynamic participant step logic has a bug.

Workflow fails silently

process step throws an exception that's caught and ignored. Always log errors in process steps.

Asset processing slows the whole environment

DAM Update Asset workflows are persisting too much state or custom steps are doing heavy synchronous work.

Custom process step hangs

external API call has no connection/read timeout, retry limit, or circuit-breaker behavior.

Workflow works on Author but not in Cloud Service

required OSGi config, service user mapping, or secret variable is missing in the target environment.

✅ Best Practices

Purge completed workflow instances regularly

they accumulate and slow down the repository.

Use Transient Workflows for DAM asset processing

they don't persist to the JCR and are much faster.

Design workflows to be idempotent

if a step runs twice, the result should be the same.

Use async workflow processing for heavy operations to avoid blocking the request thread.

Add timeouts, retries, and clear error logging around every external service call inside a workflow step.

Run workflow code with service users and least-privilege permissions, not administrative sessions.

Keep approval workflows short and auditable; complex branching should be justified by a real compliance requirement.

🏛️ Architect's Note

Senior Architect's Perspective

Workflows are powerful but often over-engineered. Keep workflow models simple — a 3-step approval workflow is better than a 10-step one with complex branching.

For AEM as a Cloud Service: Workflows work the same way, but Adobe recommends using Transient Workflows for DAM processing to improve performance. The Workflow Inbox is replaced by the AEM Inbox in the unified shell.

💬 Frequently Asked Questions

Can workflows run on a schedule?

Not directly, but you can combine workflows with Sling Schedulers. Create a scheduled OSGi job that queries for content meeting certain criteria and programmatically starts a workflow on each result.

What should I check first when workflows pile up in production?

Check the workflow instances console, launcher rules, error.log entries from custom process steps, queue size, purge configuration, and whether one external integration is timing out for every payload.

🎯 Key Takeaways

1Workflows automate multi-step content processes
2Workflow Model = definition; Workflow Instance = running execution
3Participant Steps assign tasks to users; Process Steps run Java code
4Launchers auto-trigger workflows on content events
5Purge completed instances regularly to maintain performance

🎯 Practice this topic in interviews

↗ Where this topic fits

Sources

Sources / References

Use these AEM references to verify the concept in official docs and continue into the most relevant SplashRide pages.

Related SplashRide pages

SplashRide AEM learning path

Browse the full AEM topic collection and learning order on SplashRide.

AEM Interview Prep

Practice AEM interview questions and scenario-based answers.

AEM Developer Career Path

This AEM developer career path explains how to become an AEM developer through JCR, Sling, HTL, client libraries, Dispatcher, Cloud Service delivery, project depth, and interview-ready enterprise implementation skills.

Drupal Developer Career Path

A practical route through Drupal content modeling, site building, theming, modules, configuration management, APIs, performance, deployment discipline, and interview preparation.

OSGi

Understand OSGi — the module system that powers AEM. Learn what bundles, services, and components are, and how they work together in a real project.

AEM Architecture

Understand the full AEM architecture - Author, Publish, Dispatcher, and how they work together in enterprise deployments.