Skip to main content

Create Workflows/Jobs From Content Summary

he content summary highlights the added or modified segments that require processing through workflows (jobs). The current method enables the creation of these workflows.

URL

CODE
(POST) /api/apps/wbflex/documents/{id}/branches/content/workflows/new

PARAMETERS

The URL parameters are:

id

Specify the Flex container ID

string, Mandatory

The BODY must be a JSON object with these properties:

token

The token obtained when creating the content summary

string, Mandatory

branch

Optional. Create workflows only for this specific branch. Otherwise we create workflows for all branches.

string?, Optional

locales

Optional list of target locales to create jobs for. If null then work in all locales will be assigned to jobs.

string[], Optional

maxSegments

Optional, default is 500. The maximum is 10.000.

For each branch and locale, the system will create a workflow (jobs) with no more than this number of segments. No job will contain more than this number of segments.

int?, Optional

JOB PROPERTIES

workflowProfileId

An optional workflow profile ID. If null then the method uses the project’s profile (see the “Workflow & Supplier” page in the project).

int, Optional

deadline

Optional deadline for completion of work. Deadlines are assigned to the jobs that are created with the workflow. Example:

CODE
"deadline": "2024-04-03T06:00:00Z"

datetime?, Optional

instructions

Optional instructions added to each job. Visible to the workers.

string?, Optional

comments

Optional internal comments added to each job. Not visible to workers (unless these are internal and have sufficient access rights)

string?, Optional

jobsCfs

Optional custom fields to assign to all jobs created for a file’s workflow. See Custom Field Collection Record for details. Note: You reference a CF by either its “id” or its “title” (name).

Example:

CODE
"jobsCfs": {
    fields": [
      { "title": "Activity", "value": "Fulltime" },
      { "id": 4, "value": "A-221" }    
    ]
}

object[], Optional

CALLBACKS

callbackurl
callback

Specify a URL which will be called upon success or failure of operation. This makes polling for operation status unnecessary. See Callbacks (with asynchronous operations)

Optional

RESULTS

The operation is asynchronous and may take a few seconds to complete. The method returns an Asynchronous operation result:

CODE
{
  "trm": {
    "requestid":32230,
    "status":"Waiting",
    "statusText":"Waiting..."
  }
}

Specify the callback in the payload to be automatically notified of completion. Otherwise you need to poll the operation for completion (until status = “Finished”). When finished (or via the callback) you obtain the results as a JSON:

CODE
{
    "trm": { ... }
    "custom": {
        "items": [ .... information about created workflows ... ]
    }
}

The items node contains one object per branch and locale. Example:

CODE
[
	{
		"locale": "de",
		"branch": "V1",
		"jobIds": [
			3824
		],
		"segments": {
			"assigned": 21,
			"skipped": 0,
			"failures": 0
		}
	},
	{
		"locale": "fr",
		"branch": "V1",
		"jobIds": [
			3825
		],
		"segments": {
			"assigned": 31,
			"skipped": 0,
			"failures": 0
		}
	},
	{
		"locale": "de",
		"branch": "V2",
		"jobIds": [
			3826
		],
		"segments": {
			"assigned": 10,
			"skipped": 0,
			"failures": 0
		}
	},
	{
		"locale": "fr",
		"branch": "V2",
		"jobIds": [
			3827
		],
		"segments": {
			"assigned": 2,
			"skipped": 0,
			"failures": 0
		}
	}
]

The properties are:

  • locale: The target locale of the workflow.

  • branch: The branch from which all segments originate.

  • jobIds: The list of jobs created for the segments of this branch and locale. For example, if the workflow configuration defines both Translation and Revision steps, two jobs will be created.

  • segments.assigned: The total number of segments assigned to the workflow.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.