Workflows

List Workflows

This operation provides support for retrieving all the workflows accessible to the current user, determined via the applied request authorization. This operation supports filtering and sorting of workflows based on the provided search criteria. By default this call will return a maximum of 50 sorted in descending order by the workflow’s start time.

The caller can define other limits suited to their application (see the limit query parameter), but the limit cannot be higher than 50. To ask for the next set of items pass the value of the cursor provided in the response to the cursor query parameter.

SecuritybearerAuth
Request
query Parameters
cursor
string (Cursor) non-empty

When the number of results for a request exceeds the allowed limit, the response will include a cursor. That value can then be sent via this parameter on a subsequent request to retrieve the next set of items.

limit
integer <int32> (Limit) [ 1 .. 50 ]

For a paginated request, this parameter defines the maximum number of items to retrieve.

object (WorkflowSearchPattern)

The query parameter provides filtering and sorting criteria that should be applied when performing a search. The value passed should be valid JSON that has been URL encoded.

Example: query="{ "filter" : { "fragmentId" : "593210d0-6ffe-42c9-818f-d7825e21d93d" } }"
Responses
200

A response containing a potentially paginated list of workflows.

400

Bad Request. Indicates that the server cannot or will not process the request due to something that is perceived to be a client error. The Problem Details object will provide more information about the exact cause.

406

Not Acceptable. Indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

Internal Server Error. Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

get/cf/workflows
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "cursor": "string"
}

Start a workflow

This operation starts an AEM workflow related to Content Fragments. The following type of operations are available:

  • publish-folder - recursively publishes the fragments from a certain folder
  • unpublish-fragments - unpublish content fragments
  • unpublish-models - unpublish content fragment models
  • create-translation-structure - creates the folder structure for Language Copies of Content Fragments
  • move-fragments - move multiple Content Fragments
SecuritybearerAuth
Request
Request Body schema: application/json

Request parameters to start a workflow.

type
required
string (WorkflowType)

Type of workflow

workflowModelId
string
Default: "/etc/workflow/models/scheduled_tree_activation"

The workflow model id used for initiating the workflow instance

workflowTitle
string

A freely defined string used to identify the workflow when it executes.

agentId
string
Default: "publish"

The agent id used for publishing the content fragments.

scheduledTime
integer <int64>

The scheduled time as an epoch timestamp

folderPath
required
string (ContentFragmentPath) ^\/content\/dam(\/.*)?$

A valid path to a Content Fragment resource.

excludeSubFolders
boolean
Default: false

Whether the subfolders should be ignored

filterReferencesByStatus
Array of arrays unique

Provides the option to select which references should be included in the publication based on their status. When a status is selected (e.g., DRAFT), references with that status will be published along with the content fragment. Multiple statuses can be selected to include references with any of those statuses. If no option is selected, no references will be published regardless of their status.

Items Enum: "DRAFT" "UNPUBLISHED" "MODIFIED"
validateReferences
boolean
Default: false

Whether to validate content fragment references before publishing. When enabled, fragments with invalid references will be skipped during publish. Note: Enabling this option will significantly slow down the publish workflow.

Responses
200

OK

400

Bad Request. The Problem Details object will provide more information about the exact cause.

403

Forbidden. Indicates that the server understood the request but refuses to fulfil it.

406

Not Acceptable. Indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

409

Conflict. Indicates that the request could not be completed due to a conflict with the current state of the target resource.

413

Content Too Large. Indicates that the server is refusing to process a request because the request content is larger than the server is willing or able to process.

415

Unsupported Media Type. Indicates that the origin server is refusing to service the request because the content is in a format not supported by this method on the target resource.

500

Internal Server Error. Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

post/cf/workflows
Request samples
application/json
{
  • "type": "publish-folder",
  • "workflowModelId": "/etc/workflow/models/scheduled_tree_activation",
  • "workflowTitle": "string",
  • "agentId": "publish",
  • "scheduledTime": 0,
  • "folderPath": "string",
  • "excludeSubFolders": false,
  • "filterReferencesByStatus": [
    ],
  • "validateReferences": false
}
Response samples
application/json
{
  • "type": "publish-folder",
  • "workflowInstanceId": "string"
}

Get a Workflow

SecuritybearerAuth
Request
path Parameters
workflowInstanceId
required
string (Path) ^[^\\\[\]|*]*$

The workflow instance identifier.

Responses
200

OK

400

Bad Request. Indicates that the server cannot or will not process the request due to something that is perceived to be a client error. The Problem Details object will provide more information about the exact cause.

404

Not Found. Indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

406

Not Acceptable. Indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request.

500

Internal Server Error. Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

get/cf/workflows/{workflowInstanceId}
Request samples
Response samples
application/json
{
  • "workflowInstanceId": "string",
  • "workflowModel": "string",
  • "state": "RUNNING",
  • "initiator": "string",
  • "requestedBy": "string",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "payload": [
    ],
  • "comment": "string",
  • "type": "publish-fragments",
  • "invalidFragments": [
    ]
}