plugins/aem/cloud-service/skills/aem-workflow/workflow-development/SKILL.md
[BETA] Implement custom AEM Workflow Java components on AEM as a Cloud Service. This skill is in beta. Verify all outputs before applying them to production projects. Use when writing WorkflowProcess steps, ParticipantStepChooser implementations, registering services via OSGi DS R6 annotations, reading step arguments from MetaDataMap, accessing JCR payload via WorkflowSession adapter, reading and writing workflow metadata and variables, and handling errors with WorkflowException for retry behavior.
npx skillsauth add adobe/skills workflow-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Beta Skill: This skill is in beta and under active development. Results should be reviewed carefully before use in production. Report issues at https://github.com/adobe/skills/issues
Implement custom workflow components for AEM Cloud Service: WorkflowProcess, ParticipantStepChooser, OSGi registration, metadata handling, and error patterns.
org.osgi.service.component.annotations.*). Do not use Felix SCR.ui.apps content package and is deployed via Cloud Manager pipeline.Development Progress
- [ ] 1) Identify what the step does: process (auto) or participant (human) or dynamic participant
- [ ] 2) Create Java class implementing WorkflowProcess or ParticipantStepChooser
- [ ] 3) Register with correct @Component annotation and service property (process.label / chooser.label)
- [ ] 4) Read step arguments from MetaDataMap args (set in model editor)
- [ ] 5) Access payload via item.getWorkflowData().getPayload().toString()
- [ ] 6) Read/write workflow instance metadata via item.getWorkflowData().getMetaDataMap()
- [ ] 7) Return normally to advance; throw WorkflowException to trigger retry
- [ ] 8) Deploy bundle; verify process.label appears in Workflow Model Editor step picker
@Component(
service = WorkflowProcess.class,
property = {
"process.label=My Custom Process Step",
"service.description=Short description of what this step does"
}
)
public class MyCustomProcess implements WorkflowProcess {
private static final Logger LOG = LoggerFactory.getLogger(MyCustomProcess.class);
@Reference
private ResourceResolverFactory resolverFactory;
@Override
public void execute(WorkItem item, WorkflowSession session, MetaDataMap args)
throws WorkflowException {
// 1. Read payload
WorkflowData data = item.getWorkflowData();
String payloadPath = data.getPayload().toString();
// 2. Read step arguments
String recipient = args.get("recipient", "workflow-administrators");
boolean createVersion = args.get("createVersion", false);
// 3. Read/write shared workflow metadata
MetaDataMap metadata = data.getMetaDataMap();
String status = metadata.get("approvalStatus", "PENDING");
metadata.put("processedBy", "my-custom-step");
// 4. Access JCR if needed
try {
ResourceResolver resolver = session.adaptTo(ResourceResolver.class);
Resource resource = resolver.getResource(payloadPath);
// ... do work ...
} catch (Exception e) {
LOG.error("Error in MyCustomProcess for payload {}", payloadPath, e);
throw new WorkflowException("Failed: " + e.getMessage(), e);
}
// Return normally = step completes, workflow advances
}
}
@Component(
service = ParticipantStepChooser.class,
property = {"chooser.label=Content Owner Chooser"}
)
public class ContentOwnerChooser implements ParticipantStepChooser {
@Override
public String getParticipant(WorkItem workItem, WorkflowSession session,
MetaDataMap args) throws WorkflowException {
String payloadPath = workItem.getWorkflowData().getPayload().toString();
try {
Session jcrSession = session.adaptTo(Session.class);
Node content = jcrSession.getNode(payloadPath + "/jcr:content");
if (content.hasProperty("cq:lastModifiedBy")) {
return content.getProperty("cq:lastModifiedBy").getString();
}
} catch (RepositoryException e) {
throw new WorkflowException("Cannot resolve participant", e);
}
return args.get("fallbackParticipant", "content-authors");
}
}
ResourceResolverFactory.loginAdministrative(). Always use a service user sub-service.Session.save() on the workflow session's JCR session for payload changes — use a separate ResourceResolver obtained from resolverFactory.getServiceResourceResolver().PROCESS_AUTO_ADVANCE=false in the model metaData and use TaskWorkflowProcess or an external completion mechanism.tools
Use the run-workflow MCP to discover, compose, execute, publish, and save Adobe Firefly workflows. TRIGGER when: user asks what actions are available, what the MCP can do, how to process images/video/3D via workflow, wants to build/run/save/publish a workflow, OR pastes any workflow/batch/execution ID. BARE ID (UUID/workflowId/batchId) = INSPECT ONLY — call inspect_run, NEVER run_workflow_submit. ALWAYS call list_actions first for capability/discovery questions. DO NOT TRIGGER for direct Firefly API calls without MCP (use firefly-api-specs).
tools
Run predefined featured workflows via run-workflow MCP. TRIGGER when user names a featured workflow (retargeting, banners at scale, localization, packaging, banner advertising, etc.) or asks to run a known marketing/production workflow. Requires run-workflow MCP. ALWAYS call get_featured_workflow before compose_workflow. DO NOT TRIGGER for custom one-off workflows with no named template — use run-workflow skill.
tools
Migrate an Adobe Commerce App Builder project from the Integration Starter Kit or Checkout Starter Kit to the new App Management approach. Run from the root of the App Builder project to be migrated. Pass --auto to skip confirmation prompts (suitable for CI or batch use) — auto mode prints a summary of all Q&A questions answered with their defaults. Pass --doc-scan-only to scan README.md and env.dist for outdated content without modifying any files. Use when the user wants to migrate an App Builder project from the Integration Starter Kit or Checkout Starter Kit to the App Management approach, or mentions upgrading their Adobe Commerce extension architecture.
development
Add or modify webhook interceptors in an Adobe Commerce app. Use when the user wants to intercept Commerce operations to validate input, append data, or modify behavior — before or after execution. Requires a base app initialized with commerce-app-init.