workflow-debugging
Debug AEM Workflow issues on AEM 6.5 LTS and AMS including stuck workflows, failed steps, missing Inbox tasks, launcher failures, stale instances, thread pool exhaustion, queue backlogs, purge failures, and permissions errors. Use when the user reports workflow problems on AEM 6.5 LTS or AMS, asks why a workflow is stuck or failed, needs step-by-step troubleshooting, or provides thread dumps, configuration status dumps, or Sling Job console output for analysis.
What this skill does
# AEM Workflow Debugging — 6.5 LTS / AMS Production-grade debugging for AEM Granite Workflow engine, launcher, Inbox, Sling Jobs, thread pools, and purge on **AEM 6.5 LTS** and **Adobe Managed Services (AMS)**. ## Variant Scope - This skill is **6.5-lts-only** (includes AMS). - Full JMX access via Felix Console or JMX client. - Config changes via Felix Console or OSGi config in repository. --- ## When to use this skill - Workflow stuck, not progressing, failed, not starting, task not in Inbox, purge/repository bloat, permissions, queue backlog, thread pool exhaustion, auto-advancement not working. - User provides thread dumps, configuration status ZIPs, Sling Job console output, or error.log excerpts. - Environment: AEM 6.5 LTS / AMS (JMX available). --- ## Step 1: Map symptom to first action | Symptom | symptom_id | First action | |---------|------------|--------------| | Workflow stuck (not advancing) | workflow_stuck_not_progressing | Open instance; note current step type. No work item → stale. | | Task not in Inbox | task_not_in_inbox | Confirm Participant step; assignee = logged-in user; Inbox filters. | | Workflow not starting (launcher) | workflow_not_starting_launcher | Launcher enabled; path/event match payload. | | Workflow fails or shows error | workflow_fails_or_shows_error | Instance history; error.log for instance ID; payload and process. | | Step failed, retries exhausted | step_failed_retries_exhausted | Logs → process.label → JMX `retryFailedWorkItems` or Inbox retry. | | Stale (no current work item) | stale_workflow_no_work_item | JMX `countStaleWorkflows` → `restartStaleWorkflows(dryRun=true)`. | | Repository bloat / too many instances | repository_bloat_too_many_instances | JMX `purgeCompleted(dryRun=true)` or Purge Scheduler. | | User cannot see or complete item | user_cannot_see_or_complete_item | Assignee/initiator/superuser; enforce flags. | | Cannot delete model | cannot_delete_model | JMX `countRunningWorkflows` → terminate → delete. | | Slow throughput / queue backlog | slow_throughput_queue_backlog | JMX `returnSystemJobInfo`; `queue.maxparallel` on Granite Workflow Queue; Sling thread pool. | | Auto-advancement not working | workflow_auto_advance_failure | Check `default` thread pool saturation; Sling Scheduler; timeout jobs. | | New workflow not working | workflow_setup_validation | Model sync, launcher, process registration, permissions. | --- ## Step 2: Decision tree (workflow stuck) 1. **No current work item?** → Stale. JMX: `countStaleWorkflows` → `restartStaleWorkflows(dryRun=true)`. 2. **Participant step** → Assignee exists? Inbox visible? Payload accessible? Dynamic participant resolver returning correct user? 3. **Process step** → Search error.log for instance ID. Check: `process.label` registered, payload path exists, bundle active, no exception in `execute()`. 4. **OR/AND Split** → Condition evaluates correctly? Routes exist? No dead-end branches? Model synced? --- ## Step 3: Thread dump & thread pool analysis Thread dumps on 6.5 / AMS are obtained via **jstack** or by requesting from AMS support. Configuration status ZIPs from **Felix Console → Status → Configuration Status**. ### 3a. Sling `default` thread pool (critical path) The Sling Scheduler `ApacheSlingdefault` uses `ThreadPool: default`. This pool runs: - Oak observation events - All Quartz-scheduled jobs — including the workflow timeout-detection scheduler that emits `com/adobe/granite/workflow/timeout/job` events to the Sling Job system (the job itself then runs on the Granite Workflow Queue, see Step 3c) **Check the Sling Thread Pools status page (`/system/console/status-slingthreadpools`):** | Field | Healthy | Problem | |-------|---------|---------| | active count | < max pool size | **= max pool size** (saturated) | | block policy | RUN | **ABORT** (rejects tasks when full) | | max pool size | sized for workload | OOTB on AEM 6.5 LTS is **5/5** (Apache Sling default). Bump to 20+ in OSGi config for environments with many custom periodic schedulers, otherwise schedulers can starve. | **If active count = max pool size AND block policy = ABORT:** - New scheduled tasks (including workflow timeout/auto-advance jobs) are **silently rejected** - This is the #1 cause of auto-advancement failure **Check the Threads status page (`/system/console/status-Threads`) or the jstack thread dump (`/system/console/status-jstack-threaddump`):** - Search for `sling-default-` threads - If all threads show same stack (e.g. stuck on HTTP call, database, or external service), that's the blocking culprit - Note `elapsed` time — threads stuck for hours indicate a hung external call without timeout ### 3b. Sling Job thread pool **Check `Apache Sling Job Thread Pool`** in the Sling Thread Pools status page: - active count vs max pool size - If saturated, Sling Jobs cannot execute (workflow jobs stall) ### 3c. Granite Workflow Queue **Check the Sling Jobs page (`/system/console/slingevent`):** | Field | Healthy | Problem | |-------|---------|---------| | Queued Jobs (overall) | 0 | > 0 (jobs waiting) | | Failed Jobs | 0 | > 0 (step failures) | | Active Jobs | 0-N | 0 when Queued > 0 (jobs not picked up) | **Check topic statistics for workflow model:** - Topic: `com/adobe/granite/workflow/job/var/workflow/models/<modelName>` - High `Failed Jobs` / low `Finished Jobs` ratio → process step throwing exceptions **Check Granite Workflow Queue configuration:** - Type: Topic Round Robin - Max Parallel: 0.5 OOTB on AEM 6.5 LTS (50% of available CPU cores). Increase for throughput on bursty workloads. Verify the running value at `/system/console/configMgr/org.apache.sling.event.jobs.QueueConfiguration~workflow` before assuming. - Max Retries: 10 ### 3d. Sling Scheduler **Check the Sling Scheduler status page (`/system/console/status-slingscheduler`):** - This page lists Quartz-style schedulers, not Sling Job topics. On OOTB AEM 6.5 LTS the workflow-related entry visible here is the periodic `WorkflowStatsMBean` collector (used by the Statistics MBean) — its `nextFireTime` should be in the near future; `nextFireTime: null` means the trigger was deregistered. - The `com/adobe/granite/workflow/timeout/job` topic itself is a **Sling Job**, not a Quartz job — check it on the Sling Jobs page (`/system/console/slingevent`), not here. - Confirm `ApacheSlingdefault` uses `ThreadPool: default` — that's how the periodic timeout-detection scheduler reaches the workflow engine. --- ## Step 4: Error log patterns | Pattern | Cause | Action | |---------|-------|--------| | `Error executing workflow step` | Process step exception | Check stack; fix process code or payload | | `getProcess for '<name>' failed` | No WorkflowProcess registered | Deploy bundle; match `process.label` | | `Cannot archive workitem` | Archive failure → stale risk | JMX `restartStaleWorkflows` | | `refreshing the session since we had to wait for a lock` | Lock contention | Tune `queue.maxparallel` on the Granite Workflow Queue (Apache Sling Job Queue Configuration); reduce concurrent writes to the same path | | `Terminate failed` / `Resume failed` / `Suspend failed` | Permissions (not initiator/superuser) | Check `enforceWorkflowInitiatorPermissions`; add to superusers | | `PathNotFoundException` (workflow/payload) | Payload/launcher path missing | Verify payload exists; check launcher config path | | `Error adding launcher config` | Launcher config path not created | Create `/conf/global/settings/workflow/launcher/config` | | `retrys exceeded - remove isTransient` | Transient workflow failed after retries | Fix process code; instance persisted for admin handling | | `RejectedExecutionException` | Thread pool full with ABORT policy | Increase pool size or change policy to RUN; fix stuck threads | | `Workflow is already finished` | Terminate on completed/aborted instance | Check logic calling terminate | | `Workflow purge '<name>' : repository exception` | Purge JCR error | Check permissions; r
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.