You create a workflow model to define the series of steps executed when a user starts the workflow. You can also define model properties, such as whether the workflow is transient or uses multiple resources.

When a user starts a workflow, an instance is started; this is the corresponding runtime model, created when you Sync your changes.

Creating a New Workflow

When you first create a new workflow model it contains:

The steps, Flow Start and Flow End.
These represent the beginning and end of the workflow. These steps are required and cannot be edited/removed.

An example Participant step named Step 1.
This step is configured to assign a work item to the workflow initiator. Edit or delete this step, and add steps as required.

When updates to your workflow are complete you must use Sync to Generate a Runtime Model. See Sync your Workflow for details.

Sync your Workflow - Generate a Runtime Model

Sync (right in the editor toolbar) generates a runtime model. The runtime model is the model actually used when a user starts a workflow. If you do not Sync your changes, then the changes will not be available at runtime.

When you (or any other user) make any changes to the workflow you must use Sync to generate a runtime model - even when individual dialogs (for example, for steps) have had their own save options.

When the changes are synchronized with the runtime (saved) model, Synched is shown instead.

Some steps have mandatory fields and/or built in validation. When these conditions are not satisfied an error will be shown when you attempt to Sync the model. For example, when no participant has been defined for a Participant step:

Configure the Step Properties as required; the properties available depend on the step type, there may also be several tabs available. For example, the default Participant Step, present in a new workflow as Step 1:

Confirm your updates with the tick.

Confirm the changes with Sync (editor toolbar) to generate the runtime model.

When you run a workflow in transient mode AEM does not store any workflow history. Therefore, Timeline does not display any information related to that workflow.

Make workflow models available in Touch UI

If a workflow model that is present in Classic UI but is missing in the selection popup menu in Timeline rail of Touch UI, then follow the configuration to make it available. The following steps illustrates using the AEM Assets workflow models called Request for Activation and Request for Deactivation.

Confirm that the model is not available in Touch-enabled UI. Access an asset using /assets.html/content/dam path. Select the asset. Open Timeline in left rail. Click Start Workflow and notice that Request for Activation and Request for Deactivation models are not present in the popup list.

Click Tools > General > Tagging. Select Workflow.

Click Create > Create Tag. Set Title as DAM and Name as dam. Click Submit.

Add additional filters for any custom scripts that are used by your model.

Click Save to confirm your filter definitions.

Select Build from the toolbar of your package definition.

Select Download from the package toolbar.

Using Workflows to Process Form Submissions

You can configure a form to be processed by the selected workflow. When users submit the form, a new workflow instance is created with the data of the form submission as its payload.

To configure the workflow to be used with your form:

Create a new page and open it for editing.

Add a Form component to the page.

Configure the Form Start component that appeared in the page.

Use Start Workflow to select the desired workflow from those available:

Confirm the new form configuration with the tick.

Testing Workflows

It is a good practice when testing a workflow to use a variety of payload types; including types that are different to the one for which it has been developed. For example, if you intend your workflow to deal with Assets, test it by setting a Page as payload and make sure that it does not throw errors.