Integrate with AEM Processing Profiles

For Asset Compute workers to generate custom renditions in AEM as a Cloud Service, they must be registered in AEM as a Cloud Service Author service via Processing Profiles. All assets subject to that Processing Profile will have the worker invoked upon upload or re-processing, and have the custom rendition generated and made available via the asset’s renditions.

Define a Processing Profile

First create a new Processing Profile that will invoke the worker with the configurable parameters.

Processing profile

  1. Login to AEM as a Cloud Service Author service as an AEM Administrator. As this is a tutorial we recommend using a Dev environment or an environment in a Sandbox.

  2. Navigate to Tools > Assets > Processing Profiles

  3. Tap Create button

  4. Name the Processing Profile, WKND Asset Renditions

  5. Tap the Custom tab, and tap Add New

  6. Define the new service

    • Rendition name: Circle

      • The rendition’s file name that used to identify this rendition in AEM Assets
    • Extension: png

      • The extension of the rendition that is generated. Set to png as this is the supported output format the worker’s web service supports, and results in transparent background behind the circle cut out.
    • Endpoint:

      • This is th URL to the worker obtained via aio app get-url. Ensure the URL points at the correct workspace based on the AEM as a Cloud Service environment.
      • Make sure the worker URL points to the correct workspace. AEM as a Cloud Service Stage should use the Stage workspace URL, and AEM as a Cloud Service Production should use the Production workspace URL.
    • Service Parameters

      • Tap Add Parameter

        • Key: size
        • Value: 1000
      • Tap Add Parameter

        • Key: contrast
        • Value: 0.25
      • Tap Add Parameter

        • Key: brightness
        • Value: 0.10
      • These key/value pairs that are passed into the Asset Compute worker and available via rendition.instructions JavaScript object.

    • Mime Types

      • Includes: image/jpeg, image/png, image/gif, image/bmp, image/tiff
        • These MIME types are the only ones the worker’s npm modules. This list limits which are processed by the custom worker.
      • Excludes: Leave blank
        • Never process assets with these MIME Types using this service configuration. In this case, we only use an allow list.
  7. Tap Save in the top right

Apply and invoke a Processing Profile

  1. Select the newly created Processing Profile, WKND Asset Renditions

  2. Tap Apply Profile to Folder(s) in the top action bar

  3. Select a folder to apply the Processing Profile to, such as WKND and tap Apply

  4. Navigate to the folder the Processing Profile was not applied to via AEM > Assets > Files and tap into WKND.

  5. Upload some new images assets (sample-1.jpg, sample-2.jpg, and sample-3.jpg) in any folder under the folder with the Processing Profile applied, and wait for the uploaded asset to be processed.

  6. Tap the asset to open its details

    • Default renditions may generate and appear more quickly in AEM than custom renditions.
  7. Open the Renditions view from the left sidebar

  8. Tap on the asset named Circle.png and review the generated rendition

    Generated rendition


Congratulations! You have finished the tutorial on how to extend AEM as a Cloud Service Asset Compute microservices! You should now have the ability to set up, develop, test, debug and deploy custom Asset Compute workers for use by your AEM as a Cloud Service Author service.

Review the full project source code on Github

The final Asset Compute project is available on Github at:

Github contains is the final state of the project, fully populated with the worker and test cases, but does not contain any credentials, ie. .env, .config.json or .aio.