You're viewing help content for version:
- 6.4
- 6.3
- Older Versions
You create a workflow model to define the series of steps executed when a user starts the workflow. When a user starts a workflow, an instance is started; this is a copy of the workflow model at that point in time.
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 admin user. Edit or delete this step, and add steps as required.
-
Open the Workflow Models console; for example:
http://localhost:4502/libs/cq/workflow/admin/console/content/models.html/etc/workflow/models
-
Select your new workflow, then use Edit to open it for configuration:
- Open the Workflow console. For example, http://localhost:4502/libs/cq/workflow/content/console.html.
- On the Models tab, click New. The New Workflow dialog opens.
- Type the title for your workflow and click OK.
- The new model appears in the Models tab.
- Select your model, then click Edit to open it for configuration.
Editing an existing workflow can be done in the same manner as creating a workflow - after the actual create/new action. Again, it is dependent on the UI you are using:
Caution:
When you make any changes to the workflow you must use Save (left in the editor toolbar) to persist them to the workflow model; even when individual dialogs (for steps, etc.) have had their own save options.
Caution:
It is not recommended to edit any of the out-of-the-box workflows as you would (potentially) have to re-apply the edits after applying any form of update (e.g upgrade, service pack, feature pack, hot-fix amongst others).
It is recommended to either clone and modify the workflow model or, for specific scenarios, to use overlays; for example, see Example: Customized Request for Activation.
You can create a Transient workflow model when creating a new model, or by editing an existing one:
-
Create and/or edit the workflow model according to the UI you are using.
You can configure a workflow model for Multi Resource Support when creating a new model, or by editing an existing one:
-
Create and/or edit the workflow model according to the UI you are using.
Workflow Stages help visualize the progress of a workflow when handling tasks.
Caution:
If workflow stages are defined in Page Properties, but not used for any of the workflow steps, then the progress bar will not show any progress (regardless of the current workflow step).
The stages to be available are defined in the workflow models; existing workflow models can be updated to include stage definitions. You can define any number of stages for the workflow model.
You will need to add steps to your model to represent the activity to perform - each step performs a specific activity. A selection of step components are available in a standard AEM instance.
When you edit a model, the available steps appear in the various groups of the Components tab in the workflow sidekick.

Note:
For information about the primary step components that are installed with AEM, see Workflow Steps Reference.
You can Edit step components to configure and customize their behavior using the Step Properties dialogs.
-
To open the Step Properties dialog for a step either:
- Right-click the step in the workflow model and click Edit.
- Double-click on the step.
Note:
For information about the primary step components that are installed with AEM, see Workflow Steps Reference.
-
Configure the Apache Sling Logging Configuration and Apache Sling Logging Logger Configuration (Factory Configuration) as required.
Note:
See Logging for further information.
Test your new workflow as follows:
- Start your workflow model from the console.
- Define the Payload and click OK.
- Take actions as required so that the workflow proceeds.
- Monitor the log files while the workflow is running.
Note:
It is a good practice when debugging a workflow to test the workflow with 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.
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:
To illustrate some of the possibilities for creating a workflow, the following example creates a variation of the Publish Example workflow.
-
Open the User/Group tab:
- Select Administrator (admin) for the User/Group field.
- Activate Email to have the user notified by email.
Note:
For emails to be sent, the mail service and user account details need to be configured.
OR Split steps allow you to introduce conditional processing paths into your workflow.
To define an OR rule, proceed as follows:
Note:
See Using ECMAScript.
The following sample script returns true if the node is a JCR_PATH located under /content/we-retail/us/en:
function check() { if (workflowData.getPayloadType() == "JCR_PATH") { var path = workflowData.getPayload().toString(); var node = jcrSession.getItem(path); if (node.getPath().indexOf("/content/we-retail/us/en") >= 0) { return true; } else { return false; } } else { return false; } }
You can customize any of the out-of-the-box workflows. To have customized behavior you overlay details of the appropriate workflow.
For example, Request for Activation. This workflow is used for publishing pages within Sites and is automatically triggered when a content author does not have the appropriate replication rights. See Customizing Page Authoring - Customizing the Request for Activation Workflow for further details.