Workflow Entity Commands
Workflow entities define configurable request forms that start mapped BPMN processes. A WorkflowEntity is the definition; a WorkflowEntityRequest is one submitted application/request.
All commands require Admin_Required authorization, so a general authenticated or customer user cannot call them. They are additionally permission-gated: definition management requires bpm_manage_workflow_entities; request creation requires bpm_create_workflow_requests; request and process retrieval requires bpm_view_workflow_requests. Management permission also grants access to request operations.
Command catalogue​
| Command | Purpose |
|---|---|
CreateWorkflowEntityCommand | Create the definition, fields, permissions, and process mappings. |
UpdateWorkflowEntityCommand | Update or deactivate a definition and replace supplied child configuration. |
UpdateWorkflowEntityFieldCommand | Update one configured field without replacing the complete field collection. |
DeleteWorkflowEntityCommand | Delete a workflow entity only when it has no workflow requests. |
AddWorkflowEntityPermissionCommand | Add one create/view/manage permission mapping without replacing existing permissions. |
RemoveWorkflowEntityPermissionCommand | Remove one permission mapping by mapping ID or by access type and permission code. |
AddWorkflowEntityProcessCommand | Add one process-definition mapping and optionally make it the default. |
RemoveWorkflowEntityProcessCommand | Remove one process mapping and automatically select a replacement default when necessary. |
GetWorkflowEntitiesQuery | Paginated workflow-entity definitions visible to the administrator. |
GetWorkflowEntityByIdQuery | Complete definition details. |
GetWorkflowEntityFieldsQuery | Paginated standard-field catalogue plus configured custom fields. |
GetWorkflowEntityProcessesQuery | Paginated process mappings. |
GetWorkflowEntityLookupsQuery | Paginated resolved field options, including branch and process options. |
GetWorkflowEntityLookupConfigBundleQuery | Raw and parsed General Configuration, schema, standard fields, and binding examples. |
GetWorkflowEntityUserByEmailQuery | Validate a reportedFor email and return the user's name and customer/back-office classification. |
BackfillWorkflowEntityRequestLookupSnapshotsCommand | Persist missing lookup-label snapshots on legacy requests before lookup YAML is renamed or removed. |
GetWorkflowEntityProcessInstancesQuery | Paginated direct, mapped, and scheduled process executions. |
CreateWorkflowEntityRequestCommand | Validate and create a request, then start every active mapped process. |
GetWorkflowEntityRequestsQuery | Paginated requests, including the current user's processing inbox. |
GetWorkflowEntityRequestByIdQuery | One request with files, tasks, custom data, and process instances. |
Supporting process lookup​
| Command | Purpose |
|---|---|
GetAllProcessDefinitionsLookupCommand | Return the lightweight cached list of non-deleted process definitions used to populate the process selector when configuring workflow-entity mappings. |
Command inputs​
| Command | Required data | Important optional data |
|---|---|---|
CreateWorkflowEntityCommand | code, name | description, allowRequestCreation, isActive, fields, permissions, processes, statusTemplateCode or statusLifecycle |
UpdateWorkflowEntityCommand | id | Any editable definition property or child collection |
UpdateWorkflowEntityFieldCommand | workflowEntityId, fieldId | fieldName for custom fields, displayName, fieldType, isVisible, isMandatory, displayOrder, lookupKey, parentFieldName, defaultValue, defaultLabel |
DeleteWorkflowEntityCommand | id | None |
AddWorkflowEntityPermissionCommand | workflowEntityId, accessType, permissionCode | None |
RemoveWorkflowEntityPermissionCommand | workflowEntityId plus a mapping selector | workflowEntityPermissionId, or accessType with permissionCode |
AddWorkflowEntityProcessCommand | workflowEntityId, processDefinitionId | isDefault, isActive, displayOrder |
RemoveWorkflowEntityProcessCommand | workflowEntityId plus a mapping selector | workflowEntityProcessId or processDefinitionId |
GetWorkflowEntitiesQuery | None | pageIndex, pageSize, isExport, search, includeInactive, accessType |
GetWorkflowEntityByIdQuery | id | None |
GetWorkflowEntityFieldsQuery | None | workflowEntityId, pageIndex, pageSize, isExport |
GetWorkflowEntityProcessesQuery | workflowEntityId | pageIndex, pageSize, isExport, search, includeInactive |
GetWorkflowEntityLookupsQuery | workflowEntityId | pageIndex, pageSize, isExport |
GetWorkflowEntityLookupConfigBundleQuery | None | None |
GetWorkflowEntityUserByEmailQuery | emailAddress | None |
BackfillWorkflowEntityRequestLookupSnapshotsCommand | None | workflowEntityId, afterId, pageSize (maximum 500) |
GetWorkflowEntityProcessInstancesQuery | workflowEntityId | processDefinitionId, status, entityType, showClosedProcesses, isTestMode, search, paging/export |
CreateWorkflowEntityRequestCommand | workflowEntityId plus configured mandatory fields | selfServiceBranchId, files, items, additionalData |
GetWorkflowEntityRequestsQuery | None | workflowEntityId, numeric status, statusCode (or statusName), search, pendingMyProcessing, paging/export |
GetWorkflowEntityRequestByIdQuery | id | None |
Request creation does not accept or require processDefinitionId. It starts every mapping where WorkflowEntityProcess.IsActive is true and the mapped process definition is enabled and not deleted. At least one active mapping is required.
Every started process uses ProcessEntityType.WorkflowEntityRequest (400, YAML alias workflowEntityRequest). Its entityReferenceId is the saved WorkflowEntityRequest.Id, not the parent WorkflowEntity.Id.
To populate the process mappings while creating or updating a workflow entity, call:
{
"cmd": "GetAllProcessDefinitionsLookupCommand",
"data": {}
}
Use each selected result's id as processDefinitionId inside the definition's processes array. This is definition setup only; it is not sent when creating a request. The lookup has no pagination or filter inputs because it returns a cached selector dataset; see the complete command reference.
Sample payloads for every command​
All payloads use the standard command envelope. IDs below are illustrative.
CreateWorkflowEntityCommand​
{
"cmd": "CreateWorkflowEntityCommand",
"data": {
"code": "SERVICE_REQUEST",
"name": "Service Request",
"description": "Operational and customer service requests",
"allowRequestCreation": true,
"isActive": true,
"fields": [
{
"fieldName": "subject",
"displayName": "Subject",
"fieldType": 0,
"isVisible": true,
"isMandatory": true,
"displayOrder": 1
},
{
"fieldName": "category",
"displayName": "Category",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"displayOrder": 2,
"lookupKey": "serviceRequest.categories"
},
{
"fieldName": "subCategory",
"displayName": "Subcategory",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"displayOrder": 3,
"lookupKey": "serviceRequest.categories",
"parentFieldName": "category"
}
],
"permissions": [
{
"accessType": 0,
"permissionCode": "ops_create_service_request"
},
{
"accessType": 1,
"permissionCode": "ops_view_service_requests"
}
],
"processes": [
{
"processDefinitionId": 125,
"isDefault": true,
"isActive": true,
"displayOrder": 1
}
]
}
}
Lookup keys belong to the workflow entity, not to the standard field name. For example, a Report Issue entity can bind category and subCategory to reportIssue.categories, while a Card Request entity binds the same standard fields to cardRequest.categories. serviceRequest.* is only the editable starter example.
A hidden lookup field uses isVisible: false, isMandatory: false, and a defaultValue. With a lookupKey, the YAML supplies the canonical value and label. To use a fixed value without a YAML list, omit lookupKey or set it to null and supply an optional defaultLabel. The value serves as the label when defaultLabel is omitted.
{
"fieldName": "category",
"displayName": "Category",
"fieldType": 8,
"isVisible": false,
"isMandatory": false,
"lookupKey": "reportIssue.categories",
"defaultValue": "CUSTOMER_COMPLIANCE"
}
For a fixed subcategory without a list, the field configuration can be saved as follows.
{
"fieldName": "subCategory",
"displayName": "Subcategory",
"fieldType": 8,
"isVisible": false,
"isMandatory": false,
"lookupKey": null,
"defaultValue": "GENERAL_SUPPORT",
"defaultLabel": "General Support"
}
Set parentFieldName to category if both fields use fixed defaults and the relationship should be recorded on the request. Clear any existing lookup key by passing lookupKey: null when updating the field. Visible dropdowns require a configured lookup key.
UpdateWorkflowEntityCommand​
Only supplied scalar properties are updated. When fields is supplied, it becomes the complete custom-field collection: a previously configured custom field omitted from the payload is removed. Standard fields are retained even when omitted. Their fixed fieldName values cannot be renamed or reused by custom fields, but their display label, visibility, mandatory setting, order, type, and lookup binding remain configurable. permissions and processes continue to replace their complete supplied collections.
Include a field's id when editing an existing field. Field names are unique case-insensitively, so names such as customerNumber and CUSTOMERNUMBER cannot coexist.
{
"cmd": "UpdateWorkflowEntityCommand",
"data": {
"id": 10,
"code": "SERVICE_REQUEST",
"name": "Customer Service Request",
"description": "Updated request definition",
"allowRequestCreation": true,
"isActive": true,
"fields": [
{ "id": 81, "fieldName": "requestType", "displayName": "Request Type", "fieldType": 8, "isVisible": true, "isMandatory": true, "displayOrder": 1, "lookupKey": "serviceRequest.requestTypes", "parentFieldName": null },
{ "id": 82, "fieldName": "name", "displayName": "Name", "fieldType": 0, "isVisible": true, "isMandatory": false, "displayOrder": 2, "lookupKey": null, "parentFieldName": null },
{ "id": 83, "fieldName": "subject", "displayName": "Request Subject", "fieldType": 0, "isVisible": true, "isMandatory": true, "displayOrder": 3, "lookupKey": null, "parentFieldName": null },
{ "id": 84, "fieldName": "reportedFor", "displayName": "Reported For", "fieldType": 0, "isVisible": true, "isMandatory": false, "displayOrder": 4, "lookupKey": null, "parentFieldName": null },
{ "id": 85, "fieldName": "contactNumber", "displayName": "Contact Number", "fieldType": 0, "isVisible": true, "isMandatory": false, "displayOrder": 5, "lookupKey": null, "parentFieldName": null },
{ "id": 86, "fieldName": "category", "displayName": "Category", "fieldType": 8, "isVisible": true, "isMandatory": true, "displayOrder": 6, "lookupKey": "serviceRequest.categories", "parentFieldName": null },
{ "id": 87, "fieldName": "subCategory", "displayName": "Subcategory", "fieldType": 8, "isVisible": true, "isMandatory": true, "displayOrder": 7, "lookupKey": "serviceRequest.categories", "parentFieldName": "category" },
{ "id": 88, "fieldName": "selfServiceBranchId", "displayName": "Branch", "fieldType": 11, "isVisible": true, "isMandatory": false, "displayOrder": 8, "lookupKey": null, "parentFieldName": null },
{ "id": 89, "fieldName": "shortDescription", "displayName": "Short Description", "fieldType": 0, "isVisible": true, "isMandatory": false, "displayOrder": 9, "lookupKey": null, "parentFieldName": null },
{ "id": 90, "fieldName": "description", "displayName": "Description", "fieldType": 1, "isVisible": true, "isMandatory": true, "displayOrder": 10, "lookupKey": null, "parentFieldName": null },
{ "id": 91, "fieldName": "files", "displayName": "Files", "fieldType": 9, "isVisible": true, "isMandatory": false, "displayOrder": 11, "lookupKey": null, "parentFieldName": null },
{ "id": 92, "fieldName": "assignedTo", "displayName": "Assigned To", "fieldType": 10, "isVisible": true, "isMandatory": false, "displayOrder": 12, "lookupKey": null, "parentFieldName": null },
{ "id": 93, "fieldName": "startDate", "displayName": "Start Date", "fieldType": 5, "isVisible": true, "isMandatory": false, "displayOrder": 13, "lookupKey": null, "parentFieldName": null },
{ "id": 94, "fieldName": "endDate", "displayName": "End Date", "fieldType": 5, "isVisible": true, "isMandatory": false, "displayOrder": 14, "lookupKey": null, "parentFieldName": null },
{ "id": 95, "fieldName": "items", "displayName": "Item Requests", "fieldType": 12, "isVisible": true, "isMandatory": false, "displayOrder": 15, "lookupKey": null, "parentFieldName": null },
{ "id": 96, "fieldName": "customerNumber", "displayName": "Customer Number", "fieldType": 0, "isVisible": true, "isMandatory": true, "displayOrder": 16, "lookupKey": null, "parentFieldName": null }
],
"permissions": [
{ "accessType": 0, "permissionCode": "dev_create_workflow_requests" },
{ "accessType": 1, "permissionCode": "dev_view_workflow_requests" },
{ "accessType": 2, "permissionCode": "dev_manage_workflow_entities" }
],
"processes": [
{ "processDefinitionId": 125, "isDefault": true, "isActive": true, "displayOrder": 1 }
]
}
}
The IDs above are examples. Load the actual definition with GetWorkflowEntityByIdQuery and send back the returned field IDs. This example updates the entity scalars and the complete configured field list in one call. Any previously configured custom field omitted from fields is deleted; omitted standard fields remain configured. When permissions or processes is included, the supplied list becomes the desired complete mapping list. Repeated identical permission mappings are normalized and stored only once.
UpdateWorkflowEntityFieldCommand​
Use this command when only one field needs to change. Obtain fieldId from GetWorkflowEntityByIdQuery or GetWorkflowEntityFieldsQuery.
{
"cmd": "UpdateWorkflowEntityFieldCommand",
"data": {
"workflowEntityId": 10,
"fieldId": 87,
"displayName": "Request Subject",
"isVisible": true,
"isMandatory": true,
"displayOrder": 3
}
}
For a custom field, fieldName may also be supplied to rename it. A standard field such as subject, category, or description cannot be renamed. Renaming a custom field also updates configured child fields whose parentFieldName refers to its previous name. The command rejects duplicate names, mandatory hidden fields, visible lookup fields without lookupKey, and invalid parent-field references.
DeleteWorkflowEntityCommand​
{
"cmd": "DeleteWorkflowEntityCommand",
"data": {
"id": 10
}
}
Deletion removes the definition and its field, permission, and process mappings. It is rejected when at least one WorkflowEntityRequest already belongs to the entity; deactivate the entity with UpdateWorkflowEntityCommand instead when historical requests must be retained.
AddWorkflowEntityPermissionCommand​
accessType values are 0 = create requests, 1 = view requests, and 2 = manage definition.
{
"cmd": "AddWorkflowEntityPermissionCommand",
"data": {
"workflowEntityId": 10,
"accessType": 1,
"permissionCode": "ops_view_service_requests"
}
}
RemoveWorkflowEntityPermissionCommand​
Preferred mapping-ID payload:
{
"cmd": "RemoveWorkflowEntityPermissionCommand",
"data": {
"workflowEntityId": 10,
"workflowEntityPermissionId": 54
}
}
Composite selector alternative:
{
"cmd": "RemoveWorkflowEntityPermissionCommand",
"data": {
"workflowEntityId": 10,
"accessType": 1,
"permissionCode": "ops_view_service_requests"
}
}
AddWorkflowEntityProcessCommand​
The first process mapping becomes the default automatically. Setting isDefault to true on a later mapping removes the default flag from the previous mapping.
{
"cmd": "AddWorkflowEntityProcessCommand",
"data": {
"workflowEntityId": 10,
"processDefinitionId": 142,
"isDefault": false,
"isActive": true,
"displayOrder": 2
}
}
RemoveWorkflowEntityProcessCommand​
Preferred mapping-ID payload:
{
"cmd": "RemoveWorkflowEntityProcessCommand",
"data": {
"workflowEntityId": 10,
"workflowEntityProcessId": 81
}
}
The mapping can alternatively be selected using processDefinitionId:
{
"cmd": "RemoveWorkflowEntityProcessCommand",
"data": {
"workflowEntityId": 10,
"processDefinitionId": 142
}
}
GetWorkflowEntitiesQuery​
{
"cmd": "GetWorkflowEntitiesQuery",
"data": {
"search": "service",
"includeInactive": false,
"pageIndex": 0,
"pageSize": 20,
"isExport": false
}
}
GetWorkflowEntityByIdQuery​
{
"cmd": "GetWorkflowEntityByIdQuery",
"data": {
"id": 10
}
}
GetWorkflowEntityFieldsQuery​
Omit workflowEntityId to return only the complete standard field catalogue.
{
"cmd": "GetWorkflowEntityFieldsQuery",
"data": {
"workflowEntityId": 10,
"pageIndex": 0,
"pageSize": 50,
"isExport": false
}
}
GetWorkflowEntityProcessesQuery​
{
"cmd": "GetWorkflowEntityProcessesQuery",
"data": {
"workflowEntityId": 10,
"includeInactive": true,
"search": "approval",
"pageIndex": 0,
"pageSize": 20,
"isExport": false
}
}
Each result includes the workflow-entity process mapping id; pass it as workflowEntityProcessId when removing the mapping.
GetWorkflowEntityLookupsQuery​
{
"cmd": "GetWorkflowEntityLookupsQuery",
"data": {
"workflowEntityId": 10,
"pageIndex": 0,
"pageSize": 50,
"isExport": false
}
}
GetWorkflowEntityLookupConfigBundleQuery​
{
"cmd": "GetWorkflowEntityLookupConfigBundleQuery",
"data": {}
}
GetWorkflowEntityUserByEmailQuery​
{
"cmd": "GetWorkflowEntityUserByEmailQuery",
"data": {
"emailAddress": "customer@example.com"
}
}
{
"selfServiceUserId": 20625,
"emailAddress": "customer@example.com",
"displayName": "Ada Lovelace",
"userClassification": 0,
"userClassificationName": "CUSTOMER",
"userClassificationDescription": "Customer",
"isCustomer": true,
"isBackOfficeAdministrator": false,
"accountType": 1,
"accountTypeName": "INDIVIDUAL"
}
The command returns only active, unambiguous users. Request creation repeats the same validation, saves reportedForSelfServiceUserId, and stores the submitted user's name/classification snapshot; a UI lookup alone is never treated as sufficient validation.
BackfillWorkflowEntityRequestLookupSnapshotsCommand​
Run this in batches before changing lookup values or labels used by legacy requests:
{
"cmd": "BackfillWorkflowEntityRequestLookupSnapshotsCommand",
"data": {
"workflowEntityId": 10,
"afterId": 0,
"pageSize": 200
}
}
Continue with the returned nextAfterId while hasMore is true. Backfill adds missing snapshots and preserves the saved request values and existing snapshots. unresolvedFields identifies legacy values that could not be matched to the available lookup options.
GetWorkflowEntityProcessInstancesQuery​
{
"cmd": "GetWorkflowEntityProcessInstancesQuery",
"data": {
"workflowEntityId": 10,
"processDefinitionId": 125,
"showClosedProcesses": true,
"isTestMode": false,
"pageIndex": 0,
"pageSize": 20,
"isExport": false
}
}
CreateWorkflowEntityRequestCommand​
{
"cmd": "CreateWorkflowEntityRequestCommand",
"data": {
"workflowEntityId": 10,
"subject": "Account mandate update",
"category": "ACCOUNT_SERVICES",
"subCategory": "MANDATE_CHANGE",
"selfServiceBranchId": 5,
"description": "Please update the attached mandate.",
"additionalData": {
"customerNumber": "C00001234"
},
"files": [
{
"fileName": "mandate.pdf",
"contentType": "application/pdf",
"size": 104857,
"storageProvider": "MinIO",
"bucketName": "workflow-requests",
"storagePath": "SERVICE_REQUEST/2026/mandate.pdf",
"documentType": "MANDATE"
}
]
}
}
GetWorkflowEntityRequestsQuery​
{
"cmd": "GetWorkflowEntityRequestsQuery",
"data": {
"workflowEntityId": 10,
"statusName": "PendingApproval",
"pendingMyProcessing": true,
"search": "mandate",
"pageIndex": 0,
"pageSize": 20,
"isExport": false
}
}
Each list row returns both the enum value and its display text. For example:
{
"id": 42,
"requestNumber": "WFR-000042",
"workflowEntityId": 10,
"workflowEntityName": "Report an issue",
"subject": "Account correction",
"requestType": "INTERNAL",
"requestTypeLabel": "Internal Request",
"category": "CUSTOMER_COMPLIANCE",
"categoryLabel": "Customer Service and Compliance",
"subCategory": "FRAUD_REPORT",
"subCategoryLabel": "Fraud Report",
"status": 1,
"statusDescription": "Pending Approval",
"createdAt": "2026-11-23T16:33:47Z",
"workflowStartError": null,
"hasWorkflowStartError": false
}
List and detail responses keep the saved values for filtering and workflow rules and add their display labels. lookupSelections includes value, label, lookupKey, and source for resolved standard and custom lookups. Saved snapshots remain visible even if a field is later removed from the definition. For a legacy request without a snapshot, the reader checks the entity's binding or the standard request type and category lists when no binding exists. This applies to standard values saved by older forms as text. The fallback is marked currentConfiguration when an option matches and unresolved otherwise. Run the backfill command to persist the resolved legacy labels before editing the YAML.
GetWorkflowEntityRequestByIdQuery​
{
"cmd": "GetWorkflowEntityRequestByIdQuery",
"data": {
"id": 245
}
}
Lookup configuration bundle​
The editable YAML is stored as General Configuration code WORKFLOW_ENTITY_LOOKUPS. It can also be retrieved through the generic GetConfigDefinitionByCodeQuery, but the workflow-specific bundle is more useful to a form designer.
{
"cmd": "GetWorkflowEntityLookupConfigBundleQuery",
"data": {}
}
Example response shape:
{
"isSuccessful": true,
"statusCode": "00",
"message": "Workflow entity lookup configuration bundle retrieved.",
"data": {
"configuration": {
"id": 41,
"name": "Workflow Entity Lookup Configuration (Editable Example)",
"code": "WORKFLOW_ENTITY_LOOKUPS",
"isEnabled": true,
"data": "lookups:\n serviceRequest.requestTypes: ...",
"schemaValidation": "{ ... JSON schema ... }"
},
"lookupConfiguration": {
"lookups": {
"serviceRequest.categories": [
{
"value": "ACCOUNT_SERVICES",
"label": "Account Services",
"children": [
{ "value": "ACCOUNT_OPENING", "label": "Account Opening" },
{ "value": "ACCOUNT_UPDATE", "label": "Account Information Update" },
{ "value": "MANDATE_CHANGE", "label": "Mandate Change" },
{ "value": "STATEMENT_REQUEST", "label": "Statement Request" },
{ "value": "ACCOUNT_CLOSURE", "label": "Account Closure" }
]
}
]
}
},
"sampleFieldBinding": {
"fieldName": "category",
"displayName": "Category",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"lookupKey": "serviceRequest.categories",
"parentFieldName": null
},
"sampleDependentFieldBinding": {
"fieldName": "subCategory",
"displayName": "Subcategory",
"fieldType": 8,
"lookupKey": "serviceRequest.categories",
"parentFieldName": "category"
}
}
}
The automatically created example has six categories with five subcategories each:
- Account Services
- Cards
- Payments and Transfers
- Loans and Credit
- Digital Banking
- Customer Service and Compliance
Administrators should create entity-specific keys and edit these examples to match the tenant's operating model. Reusing one serviceRequest.categories key across unrelated entities intentionally gives them the same options; it is not required by the standard category field.
Copy-ready standard field starter​
The configuration is named Workflow Entity Lookup Configuration (Editable Example) and its General Configuration code is WORKFLOW_ENTITY_LOOKUPS. Its YAML contains the editable lookup values. Standard field names and types remain code-defined so they are consistent for every tenant.
GetWorkflowEntityLookupConfigBundleQuery returns starterFields, a complete array that can be copied directly into the fields property of CreateWorkflowEntityCommand. GetWorkflowEntityFieldsQuery without workflowEntityId returns the same recommended defaults through the standard paginated list response.
{
"starterFields": [
{
"fieldName": "requestType",
"displayName": "Request Type",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"displayOrder": 1,
"lookupKey": "serviceRequest.requestTypes",
"parentFieldName": null
},
{
"fieldName": "name",
"displayName": "Name",
"fieldType": 0,
"isVisible": true,
"isMandatory": false,
"displayOrder": 2,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "subject",
"displayName": "Subject",
"fieldType": 0,
"isVisible": true,
"isMandatory": true,
"displayOrder": 3,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "reportedFor",
"displayName": "Reported For",
"fieldType": 0,
"isVisible": true,
"isMandatory": false,
"displayOrder": 4,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "contactNumber",
"displayName": "Contact Number",
"fieldType": 0,
"isVisible": true,
"isMandatory": false,
"displayOrder": 5,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "category",
"displayName": "Category",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"displayOrder": 6,
"lookupKey": "serviceRequest.categories",
"parentFieldName": null
},
{
"fieldName": "subCategory",
"displayName": "Subcategory",
"fieldType": 8,
"isVisible": true,
"isMandatory": true,
"displayOrder": 7,
"lookupKey": "serviceRequest.categories",
"parentFieldName": "category"
},
{
"fieldName": "selfServiceBranchId",
"displayName": "Branch",
"fieldType": 11,
"isVisible": true,
"isMandatory": false,
"displayOrder": 8,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "shortDescription",
"displayName": "Short Description",
"fieldType": 0,
"isVisible": true,
"isMandatory": false,
"displayOrder": 9,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "description",
"displayName": "Description",
"fieldType": 1,
"isVisible": true,
"isMandatory": true,
"displayOrder": 10,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "files",
"displayName": "Files",
"fieldType": 9,
"isVisible": true,
"isMandatory": false,
"displayOrder": 11,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "assignedTo",
"displayName": "Assigned To",
"fieldType": 10,
"isVisible": true,
"isMandatory": false,
"displayOrder": 12,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "startDate",
"displayName": "Start Date",
"fieldType": 5,
"isVisible": true,
"isMandatory": false,
"displayOrder": 13,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "endDate",
"displayName": "End Date",
"fieldType": 5,
"isVisible": true,
"isMandatory": false,
"displayOrder": 14,
"lookupKey": null,
"parentFieldName": null
},
{
"fieldName": "items",
"displayName": "Item Requests",
"fieldType": 12,
"isVisible": true,
"isMandatory": false,
"displayOrder": 15,
"lookupKey": null,
"parentFieldName": null
}
]
}
The catalogue defines permanent standard field identities. Standard fields are created automatically and cannot be removed or renamed. An administrator can hide an unused standard field with isVisible: false, change its label and order, or adjust isMandatory. Additional custom fields can be appended to the same array and can later be removed by omitting them from the fields collection supplied to UpdateWorkflowEntityCommand.
How fields work​
WorkflowEntity.Fields is the form definition. It contains both kinds of fields:
- Standard fields are known by the system, such as
subject,category,subCategory,description,files,items, andselfServiceBranchId. Their names are fixed because their values map to typed columns or established request relationships. They can be hidden but not deleted. - Custom fields use any additional
fieldName. They still define label, type, visibility, mandatory behavior, order, and lookup binding. Their values are preserved inWorkflowEntityRequest.AdditionalDataJson.
Send the selected numeric fieldType in the create or update payload. For example, use 1 for TextArea and 0 for Text. If omitted, an existing field keeps its saved type and a new standard field uses its catalogue type. A new custom field without a type defaults to Text.
Selections backed by YAML are canonicalised to the configured value. The backend captures the resolved label for each standard or custom lookup field in immutable request metadata at creation. YAML changes apply to new forms, and existing requests keep their saved labels. Clients cannot submit reserved snapshot metadata or unknown custom fields.
Hidden lookup fields are server-owned. The backend applies their saved defaultValue and defaultLabel at request time and captures both on the request. The frontend omits hidden fields from the submission.
This keeps common reporting fields strongly typed while allowing each tenant or request type to extend its form.
Status lifecycle​
Choose a lifecycle when you create a workflow entity. GetWorkflowEntityLookupConfigBundleQuery returns the creation options in statusLifecycleTemplates.
{
"cmd": "GetWorkflowEntityLookupConfigBundleQuery",
"data": {}
}
Read outData.data.statusLifecycleTemplates from the command response. Use templateName for the dropdown label, templateCode for the selected value, and mainPathLabel for the preview. The ordered mainPath contains the status codes, and statuses includes every allowed transition.
{
"templateCode": "MULTI_STEP_APPROVAL",
"templateName": "Multi-step Approval",
"initialStatusCode": "PendingApproval",
"mainPath": ["PendingApproval", "PartiallyApproved", "Approved"],
"mainPathLabel": "Pending Approval → Partially Approved → Approved",
"statuses": [
{ "value": 1000, "code": "PendingApproval", "label": "Pending Approval", "allowedTo": ["PartiallyApproved", "Rejected"] },
{ "value": 1001, "code": "PartiallyApproved", "label": "Partially Approved", "allowedTo": ["Approved", "Rejected"] },
{ "value": 1002, "code": "Approved", "label": "Approved", "allowedTo": [] },
{ "value": 1003, "code": "Rejected", "label": "Rejected", "allowedTo": [] }
]
}
| Template code | Starts at | Main path |
|---|---|---|
STANDARD | Pending Approval | Pending Approval can move to Approved, Rejected, Returned, or Cancelled |
REVIEW | Pending | Pending → In Review → Reviewed |
MULTI_STEP_APPROVAL | Pending Approval | Pending Approval → Partially Approved → Approved, with rejection available before final approval |
SUPPORT | Open | Open → In Progress → Resolved → Closed, with cancellation and a return from Resolved to In Progress |
To use a template, include its code in the create payload alongside the usual fields, permissions, and process mappings.
{
"cmd": "CreateWorkflowEntityCommand",
"data": {
"code": "ACCESS_APPROVAL",
"name": "Access Approval",
"statusTemplateCode": "MULTI_STEP_APPROVAL"
}
}
To define your own lifecycle or adapt a template, send statusLifecycle instead of statusTemplateCode.
{
"initialStatusCode": "Pending",
"statuses": [
{ "code": "Pending", "label": "Pending", "allowedTo": ["InReview"] },
{ "code": "InReview", "label": "In Review", "allowedTo": ["Reviewed"] },
{ "code": "Reviewed", "label": "Reviewed", "allowedTo": [] }
]
}
Every status needs a unique code and a label. Every transition must point to a status in the same lifecycle, and every status must be reachable from the initial status. An empty allowedTo marks a terminal state. Omitting both options selects the standard lifecycle. Existing entities keep their standard lifecycle. The lifecycle is selected on create, so omit statusLifecycle and statusTemplateCode from update payloads.
Use the exact status codes in BPMN entityState settings. For example, the first approver sets PartiallyApproved and the final approver sets Approved in the multi-step template. A direct transition from PendingApproval to Approved is rejected for that template. If an entity starts several processes, coordinate which process writes each request status.
Definition and request detail responses expose that entity's availableStatuses, including code, label, isInitial, allowedFrom, and allowedTo. Request responses return the numeric status, statusCode, and statusDescription. Use statusCode to filter request lists across entities, since numeric values for custom statuses are scoped to the entity. The active BPMN task remains available separately as the workflow stage.
Creating a request​
{
"cmd": "CreateWorkflowEntityRequestCommand",
"data": {
"workflowEntityId": 10,
"subject": "Account mandate update",
"category": "ACCOUNT_SERVICES",
"subCategory": "MANDATE_CHANGE",
"selfServiceBranchId": 5,
"description": "Please update the attached mandate.",
"additionalData": {
"customerNumber": "C00001234"
}
}
}
The request is saved before its mapped processes are started. Its public number is deliberately short and identity-based: WFR-000042 for request ID 42. If one or more process starts fail, the response is unsuccessful but the request remains available for diagnosis and retry. The response message identifies each failed process by name and ID and includes its failure reason. The same combined detail is persisted and returned as workflowStartError by GetWorkflowEntityRequestByIdQuery; list results also expose workflowStartError and hasWorkflowStartError.
If reportedFor is supplied, it must be the email address of one active customer or back-office administrator. Use GetWorkflowEntityUserByEmailQuery to preview the resolved person. If selfServiceBranchId is supplied, it must be the current user's default branch, an explicitly associated branch, or the user must have all-branch access. The backend enforces both checks again during request creation.
Request timestamps and timezone​
createdAt and updateAt are stored in UTC and returned as ISO-8601 UTC values with the Z suffix. Frontends should parse these values as dates and convert them to the user's display timezone. SQL Server datetime2 does not retain timezone metadata, so the API restores DateTimeKind.Utc when workflow requests are materialized. The same rule is applied to loan-quote audit dates, process-definition audit dates, and process-instance audit/lifecycle dates (startedAt, endedAt, and errorOccurredAt).
Tenants:TimeZoneId remains the tenant's business/display timezone. Request numbers no longer contain a timestamp, so timezone configuration cannot change their value.
{
"Tenants": {
"TimeZoneId": "Africa/Lagos"
}
}
Example partial failure:
{
"isSuccessful": false,
"message": "Request WFR-000042 was saved. 0/2 active processes started; 2 failed. First Review (125): Process definition has invalid BPMN XML.; Second Review (126): Script task failed: accountNumber is missing.",
"data": {
"id": 42,
"workflowEntityId": 10,
"requestNumber": "WFR-000042",
"workflowStartError": "First Review (125): Process definition has invalid BPMN XML.; Second Review (126): Script task failed: accountNumber is missing.",
"processInstances": []
}
}
A start can fail because the mapping or definition is inactive, BPMN XML is missing/invalid, conflict policy rejects another active instance, XML normalization fails, or the initial BPMN execution reaches an error (for example, a script or service task failure). Each active mapping is started through IProcessEventDispatcher.DispatchProcessDefinitionAsync with event OnWorkflowEntityRequestCreated and entity type WorkflowEntityRequest; the manual StartProcessInstanceCommand and its IsEventCheck guard are not bypassed. Initial execution errors are treated as start failures even when the process-instance row was successfully persisted. The engine error is copied into workflowStartError, and the error process instance remains available for diagnosis.
The dispatcher sets context.entityId and context.id to the saved request ID. context.workflowEntityRequestId and context.requestId carry that same ID. context.workflowEntityId identifies the form definition. The process instance stores the request ID as entityReferenceId, with entityType set to WorkflowEntityRequest (400).
The dispatched context also includes the request number, form values, labels, branch, status, requester, initiator, additional data, items, files, and submitted requestData. The dispatcher adds processDefinitionId, processDefinitionName, and triggerEvent before execution.
The process starts in Unsupervised execution mode. Unsupervised means the engine automatically runs until it reaches a wait state such as a user task or receive task. It does not mean simulation, and FireAndForget is not an execution mode.
Standard list contract​
List commands accept pageIndex, pageSize, and isExport. Applicable lists also support search/searchText and entity-specific filters.
{
"isSuccessful": true,
"message": "20/73 records",
"data": [],
"count": 73,
"size": 20,
"pages": 4,
"hasPrevious": false,
"hasNext": true,
"totalRows": 73,
"totalPages": 4
}
When isExport is true, pagination is bypassed and all authorized matching rows are returned.
Pending my processing​
{
"cmd": "GetWorkflowEntityRequestsQuery",
"data": {
"workflowEntityId": 10,
"pendingMyProcessing": true,
"pageIndex": 0,
"pageSize": 20
}
}
pendingMyProcessing, showMyProcess, and the legacy pendingMyAction alias use the same active task, assignment, permission, role, and branch-scope projection used by other BankLingo process inboxes.
Process instances​
GetWorkflowEntityProcessInstancesQuery includes instances linked directly to requests and all instances of currently mapped definitions. Scheduled/recurring instances are therefore included even though their entity type is ScheduledProcess.
{
"cmd": "GetWorkflowEntityProcessInstancesQuery",
"data": {
"workflowEntityId": 10,
"showClosedProcesses": true,
"pageIndex": 0,
"pageSize": 20
}
}
Each row reports source as WorkflowEntityRequest, ScheduledExecution, or MappedProcessDefinition. Existing generic process commands remain available by passing entityType = 400 (WorkflowEntityRequest) and the request ID.