projects/{pid}/settings/workflow (PUT)

Assign a workflow template to the given project, or to one target language of the project.

URL

(PUT) /api/projects/{pid}/settings/workflow?id={id}

(PUT) /api/projects/{pid}/settings/workflow?id={id}&locale={locale}

PARAMETERS

URL parameters are:

pid

The project id. Use projects/list to find projects and get the project IDs.

int, Mandatory

id

The workflow template to assign. Use settings/workflows/list to find templates and get the template IDs and names.

Please note that a template is defined for either Codyt or Standard projects. Make sure to pick a template compatible with your project.

int, Mandatory

locale

A target language of the project, for example fr or fr-CA. When set, only the workflow steps of this language are replaced by the template's steps. When missing or empty, the template replaces the whole project workflow.

Upper and lower case do not matter (FR-ca is the same as fr-CA). fr and fr-CA are different languages: steps set for fr never apply to fr-CA jobs.

string, Optional

RESULTS

None.

BEHAVIOR

Call

What changes

What stays as it is

Without locale

The whole workflow. The template's steps become the default steps for all languages, and all its project-wide settings apply to the project. Language-specific steps set before are removed.

Nothing of the previous workflow.

With locale

The steps of that language only.

The default steps, the steps of other languages, and all project-wide settings.

REMARKS

  • Call order: send the call without locale first, then one call per language that needs its own steps. A later call without locale replaces the whole workflow again and removes all language-specific steps. Set them again afterwards if needed.

  • One call at a time: send the calls for one project one after another, not in parallel. A call sent in parallel may fail and must then be sent again.

  • Languages without their own steps follow the default steps. Calling again with the same locale replaces that language's steps. To return one language to the default steps, call without locale again, then set the other languages again.

  • Project-wide settings: a call with locale takes only the step list from the template. Every other template setting is applied only by a call without locale. This includes start workflow, deliverable creation, auto-consolidate, auto-deliver, job deadlines and reminders, automatic cost calculation, supplier invoice options, job openings, project and order completion, and Flex and CMS settings.

  • Existing jobs are never changed, in Standard or Codyt projects. The new steps apply to jobs created afterwards. In Codyt projects they also apply to new file versions, unless the project uses Keep same workflow between file versions, which reuses the previous version's workflow. Reminders already scheduled for open jobs are not recalculated.

  • Limit: through this method, a project workflow can hold at most 30 step lists: the default steps plus 29 languages with their own steps. Languages that were removed from the project but still have steps count too. You can always replace the steps of a language that already has its own. Calls without locale are never blocked by this limit.

  • Differences with the user interface: on the project's Workflow & Suppliers page, Preset from Workflow Template with a language selected also overwrites the project-wide settings. A call with locale does not. Applying a preset to the default steps in the user interface keeps the language-specific steps. A call without locale removes them.

  • Reading the result: the steps show on the project's Workflow & Suppliers page, the same as steps set by hand. By API, use projects/{pid}/settings/workflow (GET): in details.steps, the default steps are under "*" and each language's own steps are under its language code as spelled in the project, for example "fr".

ERRORS

None of these errors change the project workflow.

Condition

Result

locale is not a valid language code (e.g. xz)

Error on locale: "Not a valid locale."

locale is valid but is not a target language of the project (e.g. fr on a project that only has fr-CA, or the source language)

Error on locale: "The locale {locale} is not a target language of the project."

locale would add a 31st step list

Error on locale: "The project workflow already has the maximum of 30 step lists (default steps and language specific steps). Steps for {locale} cannot be added."

The template does not match the project type (Codyt or Standard)

Error, with or without locale

id is not a valid workflow template

Error, with or without locale

EXAMPLES

The project has French, German and Spanish as target languages. German and Spanish should follow Translation + Revision (template 10). French should follow Translation + Revision + QA (template 25).

1. Set the project default. Template 10's steps become the default for all languages, and its settings apply to the project:

(PUT) /api/projects/{pid}/settings/workflow?id=10

2. Give French its own steps. Only French's steps change:

(PUT) /api/projects/{pid}/settings/workflow?id=25&locale=fr

New French jobs now follow template 25's steps. New German and Spanish jobs follow template 10's steps. All project-wide settings come from template 10.