Auto-start Workflows

Auto-start workflows extend asset processing in AEM as a Cloud Service by automatically invoking custom workflow upon upload or re-processing once the asset processing is complete.

AEM asset is supposed to asset processing duties, between processing profiles and the auto-start workflow. Processing profiles are used for binary manipulation and the generation of renditions. And when it completes, the auto-start workflow is invoked, for any further processing. The auto-start workflow is intended to perform operations on non-binary aspects of assets or invoke business and governing processes. For example, adding or manipulating asset metadata, pinging external systems to notify them of the assets existence, or collect information that should be written back to the asset’s metadata. Auto-publishing assets, we’re kicking off a review and approval workflow. As long as the work to be done doesn’t involve the asset’s binaries, but needs to be invoked when the asset is processed, auto-start workflow provides an excellent hook. Let’s look at how we can wire up a custom AEM workflow, to be auto-started after asset processing. We’ll head over to tools, Workflow models. Typically, you’ll want to define a custom workflow model, as this provides the most flexibility over time. Before we create our custom workflow model, let’s take a look at the asset cloud post-processing workflow model. Which is the default, that is auto-started if no custom workflow is set.
This is a simple model, comprised of two steps. The first apply smart tags to the assets, and the second emits an event notifying AEM, the asset has finished processing. So, unless we have a good reason, not to process the assets as AEM does natively, we’ll want to ensure we include these same steps, in our custom workflow. Okay, let’s create a custom model, that kicks off a simple accept project process. I’ll start by copying the AEM assets cloud post-processing workflow model.
First, edit the properties and provide a meaningful title and description.
Notice I left post-processing in the title, to make it clear this workflow is intended for post-processing of assets, in AEM cloud service.
Starting from a copy of the default asset cloud post-processing workflow model, makes it easy to ensure we carry forward any default steps, AEM might provide. Since it’s a good idea to maintain AEM’s native capabilities, we’ll leave the smart tag assets process, to ensure the asset gets smart-tagged by Adobe Sensei. After that, we’ll add our super simplified review process.
We’ll add a participant step, with the title of editorial review, and we’ll send it to the WKND Editors user group.
Then in OR split, that lets the editor accept or reject the asset. Now, a bona fide review and approval workflow, would likely take more action on the asset. Like setting approval or rejection metadata, or moving it to another folder. But let’s keep it simple, and put no operation steps in, for accept and reject.
Finally, we’ll keep the DAM update asset workflow completed step. This step is of interest for two reasons. First, only workflow models that contain this step, will show up in the auto-start workflow drop down. And secondly, this step is what toggles the processing badge off, for an asset. So since we’ve positioned the step to be the last, the asset will maintain its processing badge, during that tutorial review. If we move this step two set immediately after smart tags, then the processing badge will disappear after smart tech processing is done, but before the editorial review takes place. But, we’ll keep it at the bottom, to indicate to other AEM users, this asset is still being processed, and shouldn’t be used until the review is complete. Okay, let’s sync our changes and apply our new model, as an auto-start workflow, to the magazine folder.
Back in assets, files, select the magazine folder, tap properties, and navigate to the asset pressing tab. And since our workflow has the DAM update asset workflow completed step, it shows up in this drop down. If your model doesn’t show up here, it’s because you forgot to add to that workflow step. Let’s select our new editorial review workflow and save.
Now, whenever we upload an asset under the magazine folder, it’ll kick off the applicable processing profile, and then auto-start our editorial workflow, as specified in the auto-start workflow drop down.
For simplicity, I’ve added myself to the WKND Editors group, so I’ll be assigned the editorial review step. Now you see the asset is still labels processing, since we left the DAM update asset workflow completed step, at the very end of our workflow. This badge won’t go away, until we complete the review. Let’s use the timeline to verify the custom workflow has been invoked, and the editorial review has been assigned. Let’s accept and complete the review.
And there we have it, our editorial workflow review is done, and the processing badge has disappeared, just as expected. Similarly, when an existing asset is re-processed, there’s a checkbox that lets these determine if the auto-start workflow should be invoked or not. Reprocessing, with the checkbox selected, we’ll kick off the processing profile, and then our custom workflow.
And just like before, we see our custom workflow has indeed been invoked, by checking the assets timeline. Okay, hope this helps explain how auto-start workflows can be configured and applied to AEM assets. -
Use Auto-start Workflows for customizing assets post-processing rather than using Workflow Launchers. Auto-start workflows are only invoked once an asset is complete processing instead of launchers which may be invoked multiple times during asset processing.

Customizing the Post-Processing Workflow

To customize the Post-Processing workflow, copy the default Assets Cloud Post-Processing workflow model.

  1. Start at the Workflow Models screen by navigating to Tools > Workflow > Models

  2. Find and select the Assets Cloud Post-Processing workflow model

    Select the Assets Cloud Post-Processing Workflow model

  3. Select the Copy button to create your custom workflow

  4. Select your now workflow model (which will be called Assets Cloud Post-Processing1) and click the Edit button to edit the workflow

  5. From the Workflow Properties, give your custom Post-Processing workflow a meaningful name

    Changing the Name

  6. Add the steps to meet your business requirements, in this case adding a task when assets are complete processing. Make sure that the last step of the workflow is always the Workflow Complete step

    Add Workflow Steps

    note note
    Auto-start workflows run with every asset upload or reprocess so carefully consider the scaling implication of workflow steps, especially for bulk operations such as Bulk Imports or migrations.
  7. Select the Sync button to save your changes and synchronize the Workflow model

Using a Custom Post-Processing Workflow

Custom Post-Processing are configured on folders. To configure a Custom Post-Processing Workflow on a folder:

  1. Select the folder for which you want to configure the workflow and edit the folder properties
  2. Switch to the Asset Processing tab
  3. Select your Custom Post-Processing workflow in the Auto-start Workflow selection box

    Set the Post-Processing Workflow
  4. Save your changes

Now your custom Post-Processing Workflow will be run for all assets uploaded or reprocessed under that folder.