workflow_by_name()

Resolves a workflow by its model name (ModelName) to exactly one ECMWorkflow — analogous to ecm.dms.model_by_name. Internally calls workflow_list() and filters by model_name.

1. Signature

  • Sync

  • Async

ecm.workflow.workflow_by_name(
    model_name: str,
    user: ECMOrganisationObjectIdLike,
    client_type: str | ECMClientType,
    organisation: str | ECMOrganisation | None = None,
) -> ECMWorkflow
await ecm.workflow.workflow_by_name(
    model_name: str,
    user: ECMOrganisationObjectIdLike,
    client_type: str | ECMClientType,
    organisation: str | ECMOrganisation | None = None,
) -> ECMWorkflow

2. Parameters

Parameter Type Default Description

model_name

str

The workflow model name to match (ECMWorkflow.model_name).

user

str | ECMOrganisationObject | ECMOrganisationObjectRef

The workflow-organisation user (see workflow_list()).

client_type

str | ECMClientType

Client type as an ECMClientType, a GUID, or a name. Mandatory.

organisation

str | ECMOrganisation | None

None

Defaults to the active organisation when None.

3. Return value

The single matching ECMWorkflow (see the data model in workflow_list()).

4. Errors

  • ECMNotFoundException — no workflow with that model name

  • ECMWrongStateException — more than one workflow with that model name (ambiguous; the message lists the colliding `family_id`s)

5. Example

wf = ecm.workflow.workflow_by_name("test", user, "#OSECM_Client#")
print(wf.family_id)

6. See also