Skip to main content

Process Administration Commands

Overview

Process Administration Commands manage the lifecycle of process definitions (BPMN workflows) in the BankLingo BPM Engine. These commands handle creating, updating, deleting, querying, and configuring workflows. This is separate from Process Execution Commands which manage running process instances.

Quick Navigation

Each command has its own dedicated documentation page with complete request/response examples, use cases, and best practices.

Command Categories

📝 Process Definition Management

Commands for creating, updating, and managing process definitions.

🔍 Process Definition Queries

Commands for retrieving process definition information.

🔧 Configuration & Setup

Commands for process configuration and context management.


Command Matrix

Quick reference for when to use each command:

TaskCommandFrequency
Create new workflowCreateProcessDefinitionCommandAs needed
Update workflow logicUpdateProcessDefinitionCommandMonthly
Just rename workflowRenameProcessDefinitionCommandAs needed
Delete workflowDeleteProcessDefinitionCommandRarely
View single workflowGetProcessDefinitionByIdQueryVery frequently
List all workflowsGetProcessDefinitionListQueryVery frequently
Export workflowGetProcessBundleQueryAs needed
Schedule workflowUpdateSchedulingInformationCommandAs needed
See available contextsGetContextLoadersQueryDuring design

Typical Workflows

Creating a New Process

  1. GetContextLoadersQuery - Determine available variables
  2. Design BPMN using available variables
  3. CreateProcessDefinitionCommand - Upload process
  4. GetProcessDefinitionByIdQuery - Verify creation
  5. Test process in development
  6. Update isActive: true to enable

Updating an Existing Process

  1. GetProcessDefinitionByIdQuery - Get current version
  2. GetProcessInstanceListQuery - Check active instances
  3. Update BPMN XML
  4. UpdateProcessDefinitionCommand - Deploy new version
  5. Monitor active instances on old version
  6. Wait for completion or gracefully migrate

Deleting a Process

  1. GetProcessDefinitionByIdQuery - Check status
  2. UpdateProcessDefinitionCommand - Set isActive: false
  3. GetProcessInstanceListQuery - Verify no active instances
  4. Cancel/complete any remaining instances
  5. DeleteProcessDefinitionCommand - Delete safely

Scheduling a Process

  1. GetProcessDefinitionByIdQuery - Get process details
  2. Design cron expression for schedule
  3. UpdateSchedulingInformationCommand - Configure schedule
  4. GetProcessInstanceListQuery - Monitor scheduled executions

Best Practices Summary

✅ Process Definition Do's

  1. Use clear, descriptive names - "SME Loan Approval Workflow" not "Process1"
  2. Add comprehensive documentation - Use BPMN documentation elements
  3. Version your processes - Include version in metadata
  4. Test before activating - Create as isActive: false, test thoroughly
  5. Use categories wisely - Group related processes (Lending, Deposits, Compliance)
  6. Include context loaders - Auto-initialize variables from entities
  7. Configure triggers appropriately - Auto-start on relevant events
  8. Monitor active instances - Before updating or deleting
  9. Use scheduling for batch jobs - Automate recurring processes
  10. Export/backup definitions - Use GetProcessBundleQuery regularly

❌ Process Definition Don'ts

  1. Don't force delete with active instances - Cancel instances first
  2. Don't update without versioning - Track changes properly
  3. Don't create duplicate definitions - Check existing first
  4. Don't skip BPMN validation - Ensure valid BPMN 2.0
  5. Don't ignore breaking changes - Review impact on running instances
  6. Don't over-schedule - Avoid too many concurrent scheduled jobs
  7. Don't hardcode values - Use variables and context loaders
  8. Don't create overly complex processes - Break into subprocesses
  9. Don't skip testing - Test with real data before production
  10. Don't forget error handling - Include boundary events and error flows


Support & Troubleshooting

Common Issues

Process Won't Start:

  • Check isActive: true
  • Verify BPMN has start event
  • Check trigger event configuration
  • Verify context loader setup

Process Update Failed:

  • Validate BPMN XML
  • Check for breaking changes
  • Verify no active instances (if needed)
  • Check permissions

Schedule Not Triggering:

  • Verify schedulingEnabled: true
  • Check cron expression validity
  • Verify timezone configuration
  • Check Hangfire background server status

Process Deletion Blocked:

  • Check for active instances
  • Look for call activity references
  • Verify no scheduled executions
  • Check trigger event configurations

Last Updated: January 6, 2026
Version: 1.0

Request

{
"name": "Loan Approval Workflow",
"description": "Multi-stage loan approval process with credit checks",
"category": "Lending",
"bpmnXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\">...</definitions>",
"contextLoaderType": "LoanApplicationContext",
"triggerEvents": ["OnLoanCreation"],
"isActive": true,
"metadata": {
"version": "1.0",
"author": "System Admin",
"tags": ["lending", "approval"]
}
}

Request Fields

FieldTypeRequiredDefaultDescription
namestringYes-Unique name for the process definition
descriptionstringNo""Human-readable description
categorystringNo"General"Logical category for grouping (e.g., "Lending", "Customer Onboarding")
bpmnXmlstring (XML)Yes-Valid BPMN 2.0 XML definition
contextLoaderTypestringNonullType of context loader to use for variable initialization
triggerEventsarrayNo[]System events that auto-trigger this process (e.g., ["OnLoanCreation", "OnDepositOpening"])
isActivebooleanNotrueWhether process can be instantiated
metadataobjectNoAdditional metadata (version, author, tags, etc.)

BPMN XML Validation

The system validates the BPMN XML for:

  • ✅ Valid XML structure
  • ✅ BPMN 2.0 schema compliance
  • ✅ Required elements (process, start event, end event)
  • ✅ Valid task types (userTask, serviceTask, scriptTask, etc.)
  • ✅ Valid gateway types (exclusiveGateway, parallelGateway, etc.)
  • ✅ Valid sequence flows
  • ✅ Script task syntax (if using embedded scripts)
  • ✅ Service task configuration (command names, parameters)

Response

{
"isSuccessful": true,
"message": "Process definition created successfully",
"statusCode": "00",
"data": {
"id": 456,
"name": "Loan Approval Workflow",
"category": "Lending",
"version": 1,
"isActive": true,
"createdDate": "2026-01-06T10:30:00Z",
"createdBy": "admin@bank.com",
"triggerEvents": ["OnLoanCreation"],
"contextLoaderType": "LoanApplicationContext",
"elementCounts": {
"totalElements": 15,
"startEvents": 1,
"endEvents": 2,
"userTasks": 5,
"serviceTasks": 3,
"scriptTasks": 2,
"gateways": 2
}
}
}

Response Fields

FieldTypeDescription
idlongUnique identifier for the process definition
namestringProcess definition name
categorystringLogical category
versionintVersion number (auto-incremented)
isActivebooleanActivation status
createdDatedatetimeCreation timestamp
createdBystringUser who created the definition
triggerEventsarrayConfigured trigger events
contextLoaderTypestringContext loader type
elementCountsobjectSummary of BPMN elements

Supported BPMN Elements

Events

  • Start Event (startEvent) - Process entry point
  • End Event (endEvent) - Process completion point
  • Intermediate Throw Event (intermediateThrowEvent) - Signal/message throwing
  • Intermediate Catch Event (intermediateCatchEvent) - Signal/message catching
  • Timer Event (timerEvent) - Time-based triggers

Tasks

  • User Task (userTask) - Human interaction task
  • Service Task (serviceTask) - Automated system task
  • Script Task (scriptTask) - JavaScript/expression execution
  • Send Task (sendTask) - Message/notification sending
  • Receive Task (receiveTask) - Message/signal receiving

Gateways

  • Exclusive Gateway (exclusiveGateway) - XOR decision point
  • Parallel Gateway (parallelGateway) - Fork/join parallel flows
  • Inclusive Gateway (inclusiveGateway) - OR decision point
  • Event-Based Gateway (eventBasedGateway) - Event-driven routing

Other Elements

  • Subprocess (subProcess) - Embedded workflow
  • Call Activity (callActivity) - External workflow reference
  • Boundary Event (boundaryEvent) - Exception/timer on task
  • Sequence Flow (sequenceFlow) - Flow connections
  • Message Flow (messageFlow) - Cross-process communication

Trigger Events

Process definitions can be configured to automatically start when specific system events occur:

Trigger EventDescriptionUse Case
OnLoanCreationFired when a loan account is createdLoan approval workflows
OnDepositCreationFired when a deposit account is createdAccount opening workflows
OnClientCreationFired when a client is registeredKYC/onboarding workflows
OnTransactionCreationFired on any transactionFraud detection, notifications
OnCashDepositFired on cash deposit transactionsLarge deposit monitoring
OnCashWithdrawalFired on cash withdrawal transactionsWithdrawal limit checks
OnLoanDisbursementFired when loan is disbursedPost-disbursement tasks
OnLoanRepaymentFired on loan repaymentRepayment tracking

Context Loaders

Context loaders initialize process variables from entity data:

Context LoaderEntity TypeAvailable Variables
LoanApplicationContextLoan AccountloanId, amount, clientId, productId, branch, status
DepositAccountContextDeposit AccountaccountId, accountNumber, balance, clientId, productId
ClientContextClientclientId, clientCode, firstName, lastName, email, phone
TransactionContextTransactiontransactionId, amount, type, accountId, reference

Error Responses

Invalid BPMN XML

{
"isSuccessful": false,
"message": "Invalid BPMN XML: Start event 'StartEvent_1' is missing",
"statusCode": "40",
"data": {
"validationErrors": [
"Start event required",
"End event 'EndEvent_1' has no incoming sequence flow"
]
}
}

Duplicate Name

{
"isSuccessful": false,
"message": "Process definition with name 'Loan Approval Workflow' already exists",
"statusCode": "40"
}

Example: Creating a Simple Approval Workflow

{
"name": "Simple Approval",
"description": "Basic approval workflow with 2 steps",
"category": "General",
"bpmnXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\"
xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\"
targetNamespace=\"http://banklingo.com/bpmn\">
<process id=\"SimpleApproval\" name=\"Simple Approval Process\">
<startEvent id=\"StartEvent_1\" name=\"Start\"/>
<userTask id=\"Task_Review\" name=\"Review Request\"/>
<userTask id=\"Task_Approve\" name=\"Approve Request\"/>
<endEvent id=\"EndEvent_1\" name=\"End\"/>

<sequenceFlow id=\"Flow_1\" sourceRef=\"StartEvent_1\" targetRef=\"Task_Review\"/>
<sequenceFlow id=\"Flow_2\" sourceRef=\"Task_Review\" targetRef=\"Task_Approve\"/>
<sequenceFlow id=\"Flow_3\" sourceRef=\"Task_Approve\" targetRef=\"EndEvent_1\"/>
</process>
</definitions>",
"isActive": true
}

Best Practices

  1. Use Descriptive Names: Process names should clearly indicate purpose

    ✅ "Loan Approval Workflow - SME Lending"
    ❌ "Process1"
  2. Add Comprehensive Documentation: Use BPMN documentation elements

    <userTask id="Task_1" name="Credit Check">
    <documentation>
    Perform comprehensive credit check including:
    - Credit bureau report
    - Internal scoring
    - Risk assessment
    </documentation>
    </userTask>
  3. Version Your Processes: Include version in metadata

    {
    "name": "Loan Approval Workflow",
    "metadata": {
    "version": "2.1.0",
    "changelog": "Added automated credit checks"
    }
    }
  4. Use Categories: Organize processes logically

    • Lending - Loan-related workflows
    • Deposits - Deposit account workflows
    • Compliance - Regulatory/compliance workflows
    • Operations - Operational processes
  5. Test Before Activation: Create as inactive, test thoroughly, then activate

    {
    "name": "New Workflow",
    "isActive": false, // Test first
    "bpmnXml": "..."
    }

UpdateProcessDefinitiionCommand

Updates an existing process definition.

Purpose

Modifies the BPMN XML, configuration, or metadata of an existing process definition. Creates a new version while preserving existing instances.

Request

{
"id": 456,
"name": "Loan Approval Workflow v2",
"description": "Updated with automated checks",
"bpmnXml": "<?xml version=\"1.0\"...",
"isActive": true,
"metadata": {
"version": "2.0",
"changelog": "Added automated fraud detection"
}
}

Request Fields

FieldTypeRequiredDefaultDescription
idlongYes-ID of process definition to update
namestringNo(unchanged)Updated name
descriptionstringNo(unchanged)Updated description
bpmnXmlstringNo(unchanged)Updated BPMN XML
categorystringNo(unchanged)Updated category
isActivebooleanNo(unchanged)Activation status
metadataobjectNo(unchanged)Updated metadata

Versioning Behavior

When updating a process definition:

  • New Version Created: A new version number is assigned
  • Existing Instances Preserved: Running instances continue with old version
  • New Instances Use New Version: Future instances use updated definition

Response

{
"isSuccessful": true,
"message": "Process definition updated successfully",
"data": {
"id": 456,
"version": 2,
"previousVersion": 1,
"activeInstances": 5, // Number still running old version
"warningMessage": "5 active instances still running version 1"
}
}

Error Responses

Process Definition Not Found

{
"isSuccessful": false,
"message": "Process definition with ID 456 not found",
"statusCode": "404"
}

Invalid Update (Breaking Change)

{
"isSuccessful": false,
"message": "Cannot update: Breaking changes detected",
"data": {
"breakingChanges": [
"Start event 'StartEvent_1' removed",
"User task 'Task_Approve' references removed"
]
}
}

DeleteProcessDefinitiionCommand

Deletes a process definition.

Purpose

Removes a process definition from the system. Only allowed if no active instances exist.

Request

{
"id": 456,
"force": false // Set true to force deletion even with active instances
}

Request Fields

FieldTypeRequiredDefaultDescription
idlongYes-ID of process definition to delete
forcebooleanNofalseForce deletion even with active instances (use with caution)

Response

{
"isSuccessful": true,
"message": "Process definition deleted successfully",
"data": {
"id": 456,
"name": "Loan Approval Workflow",
"instancesDeleted": 0
}
}

Error Responses

Has Active Instances

{
"isSuccessful": false,
"message": "Cannot delete: Process has 3 active instances",
"statusCode": "40",
"data": {
"activeInstances": 3,
"instanceIds": ["guid1", "guid2", "guid3"],
"suggestion": "Use force=true to delete anyway or wait for instances to complete"
}
}

Safety Notes

⚠️ Use force=true with extreme caution:

  • Deleting a definition with active instances will orphan those instances
  • Orphaned instances cannot be resumed or managed
  • Consider canceling instances first using CancelProcessInstanceCommand

RenameProcessDefinitiionCommand

Renames a process definition without creating a new version.

Purpose

Changes the display name of a process definition while keeping the same ID and version.

Request

{
"id": 456,
"newName": "SME Loan Approval Workflow"
}

Request Fields

FieldTypeRequiredDescription
idlongYesID of process definition to rename
newNamestringYesNew name for the process

Response

{
"isSuccessful": true,
"message": "Process definition renamed successfully",
"data": {
"id": 456,
"oldName": "Loan Approval Workflow",
"newName": "SME Loan Approval Workflow",
"version": 2 // Version unchanged
}
}

Use Case

Use this instead of UpdateProcessDefinitiionCommand when you only want to change the display name without creating a new version:

✅ Renaming for clarity without functional changes
❌ Changing BPMN logic (use UpdateProcessDefinitiionCommand)

GetProcessDefinitiionByIdQuery

Retrieves a single process definition by ID.

Purpose

Gets complete details of a specific process definition including BPMN XML and metadata.

Request

{
"id": 456,
"includeXml": true, // Include full BPMN XML in response
"includeStatistics": true // Include instance statistics
}

Request Fields

FieldTypeRequiredDefaultDescription
idlongYes-ID of process definition to retrieve
includeXmlbooleanNofalseInclude full BPMN XML in response
includeStatisticsbooleanNofalseInclude instance count statistics

Response

{
"isSuccessful": true,
"data": {
"id": 456,
"name": "Loan Approval Workflow",
"description": "Multi-stage loan approval process",
"category": "Lending",
"version": 2,
"isActive": true,
"createdDate": "2026-01-06T10:30:00Z",
"updatedDate": "2026-01-10T15:45:00Z",
"createdBy": "admin@bank.com",
"updatedBy": "manager@bank.com",
"triggerEvents": ["OnLoanCreation"],
"contextLoaderType": "LoanApplicationContext",
"bpmnXml": "<?xml version=\"1.0\"...", // Only if includeXml=true
"statistics": { // Only if includeStatistics=true
"totalInstances": 150,
"activeInstances": 12,
"completedInstances": 135,
"failedInstances": 3,
"averageDurationMinutes": 180
},
"elementCounts": {
"totalElements": 15,
"userTasks": 5,
"serviceTasks": 3,
"scriptTasks": 2,
"gateways": 2
}
}
}

GetProcessDefinitiionListQuery

Retrieves paginated list of process definitions.

Purpose

Lists all process definitions with filtering, searching, and pagination.

Request

{
"pageNumber": 1,
"pageSize": 20,
"searchText": "loan", // Search in name/description
"category": "Lending", // Filter by category
"isActive": true, // Filter by active status
"sortBy": "name", // Sort field
"sortDirection": "asc" // Sort direction
}

Request Fields

FieldTypeRequiredDefaultDescription
pageNumberintNo1Page number (1-based)
pageSizeintNo20Items per page (max 100)
searchTextstringNonullSearch in name/description
categorystringNonullFilter by category
isActivebooleanNonullFilter by active status (null = all)
sortBystringNo"name"Sort field: name, category, createdDate, version
sortDirectionstringNo"asc"Sort direction: asc or desc

Response

{
"isSuccessful": true,
"data": {
"items": [
{
"id": 456,
"name": "Loan Approval Workflow",
"category": "Lending",
"version": 2,
"isActive": true,
"createdDate": "2026-01-06T10:30:00Z",
"triggerEvents": ["OnLoanCreation"],
"activeInstanceCount": 5
},
{
"id": 789,
"name": "SME Loan Processing",
"category": "Lending",
"version": 1,
"isActive": true,
"createdDate": "2026-01-08T14:20:00Z",
"triggerEvents": [],
"activeInstanceCount": 0
}
],
"pageNumber": 1,
"pageSize": 20,
"totalPages": 3,
"totalRecords": 45
}
}

Filtering Examples

Get all active processes:

{
"isActive": true,
"pageSize": 100
}

Get processes by category:

{
"category": "Compliance",
"sortBy": "createdDate",
"sortDirection": "desc"
}

Search for specific processes:

{
"searchText": "approval",
"isActive": true
}

GetProcessBundleQuery

Retrieves complete process definition package with all metadata and dependencies.

Purpose

Gets a comprehensive "bundle" of process definition information including BPMN, context loaders, trigger configurations, and related metadata.

Request

{
"processDefinitionId": 456,
"includeInstances": true, // Include sample instances
"includeRelatedDefinitions": true // Include related/called processes
}

Request Fields

FieldTypeRequiredDefaultDescription
processDefinitionIdlongYes-ID of process definition
includeInstancesbooleanNofalseInclude recent process instances
includeRelatedDefinitionsbooleanNofalseInclude definitions called by this process

Response

{
"isSuccessful": true,
"data": {
"processDefinition": {
"id": 456,
"name": "Loan Approval Workflow",
"version": 2,
"bpmnXml": "<?xml version...\"",
"category": "Lending"
},
"contextLoader": {
"type": "LoanApplicationContext",
"availableVariables": [
{ "name": "loanId", "type": "long", "description": "Loan account ID" },
{ "name": "amount", "type": "decimal", "description": "Loan amount" },
{ "name": "clientId", "type": "long", "description": "Client ID" }
]
},
"triggerConfiguration": {
"events": ["OnLoanCreation"],
"autoStart": true,
"conditions": "loanAmount > 50000" // Optional trigger condition
},
"recentInstances": [ // Only if includeInstances=true
{
"instanceId": "guid1",
"businessKey": "LOAN-001",
"status": "COMPLETED",
"startTime": "2026-01-10T09:00:00Z",
"endTime": "2026-01-10T12:30:00Z"
}
],
"relatedDefinitions": [ // Only if includeRelatedDefinitions=true
{
"id": 123,
"name": "Credit Check Subprocess",
"relationship": "CallActivity"
}
]
}
}

Use Cases

  1. Export/Import: Get complete process package for backup or migration
  2. Documentation: Generate comprehensive process documentation
  3. Debugging: Understand all process dependencies and configurations
  4. Deployment: Bundle all required components for deployment

GetContextLoadersQuery

Retrieves list of available context loaders for process variable initialization.

Purpose

Lists all context loader types that can be used to automatically initialize process variables from entity data.

Request

{
"category": "Lending" // Optional: filter by category
}

Response

{
"isSuccessful": true,
"data": {
"contextLoaders": [
{
"type": "LoanApplicationContext",
"category": "Lending",
"description": "Loads loan account data into process variables",
"entityType": "LoanAccount",
"requiredFields": ["loanId"],
"variables": [
{
"name": "loanId",
"type": "long",
"description": "Loan account ID",
"required": true
},
{
"name": "amount",
"type": "decimal",
"description": "Loan amount requested"
},
{
"name": "clientId",
"type": "long",
"description": "Associated client ID"
},
{
"name": "productId",
"type": "long",
"description": "Loan product ID"
},
{
"name": "branch",
"type": "object",
"description": "Branch information"
},
{
"name": "status",
"type": "string",
"description": "Loan application status"
}
]
},
{
"type": "DepositAccountContext",
"category": "Deposits",
"description": "Loads deposit account data",
"entityType": "DepositAccount",
"requiredFields": ["accountId"],
"variables": [
{
"name": "accountId",
"type": "long",
"description": "Deposit account ID",
"required": true
},
{
"name": "accountNumber",
"type": "string",
"description": "Account number"
},
{
"name": "balance",
"type": "decimal",
"description": "Current account balance"
}
]
}
]
}
}

Use Case

When creating a process definition, query available context loaders to determine what variables will be available:

// 1. Get available context loaders
const loaders = await getContextLoaders({ category: "Lending" });

// 2. Choose appropriate loader
const loanLoader = loaders.contextLoaders.find(l => l.type === "LoanApplicationContext");

// 3. Use loader's variables in BPMN process
// Now you know you have access to: loanId, amount, clientId, productId, etc.

// 4. Create process definition with chosen loader
await createProcessDefinition({
name: "My Loan Process",
contextLoaderType: "LoanApplicationContext",
bpmnXml: "..." // Can reference ${loanId}, ${amount}, etc.
});

UpdateSchedulingInformationCommand

Configures scheduled execution of a process definition.

Purpose

Sets up recurring or scheduled automatic execution of a process, useful for batch jobs, periodic reports, or maintenance workflows.

Request

{
"processDefinitionId": 456,
"schedulingEnabled": true,
"cronExpression": "0 0 2 * * ?", // Every day at 2 AM
"timezone": "Africa/Lagos",
"variables": {
"reportDate": "${today}",
"batchSize": 100
},
"maxConcurrentInstances": 1, // Prevent overlapping runs
"description": "Daily loan portfolio report generation"
}

Request Fields

FieldTypeRequiredDefaultDescription
processDefinitionIdlongYes-ID of process definition to schedule
schedulingEnabledbooleanNofalseEnable/disable scheduling
cronExpressionstringYes (if enabled)-Cron expression for schedule
timezonestringNo"UTC"Timezone for schedule
variablesobjectNoDefault variables for scheduled instances
maxConcurrentInstancesintNo1Maximum concurrent instances allowed
descriptionstringNo""Description of schedule purpose

Cron Expression Format

Standard cron format: second minute hour day month dayOfWeek

Examples:

"0 0 2 * * ?"        // Every day at 2:00 AM
"0 */15 * * * ?" // Every 15 minutes
"0 0 9 * * MON-FRI" // Every weekday at 9:00 AM
"0 0 0 1 * ?" // First day of every month at midnight
"0 30 23 * * SUN" // Every Sunday at 11:30 PM

Response

{
"isSuccessful": true,
"message": "Scheduling configured successfully",
"data": {
"processDefinitionId": 456,
"schedulingEnabled": true,
"cronExpression": "0 0 2 * * ?",
"nextRunTime": "2026-01-07T02:00:00Z",
"timezone": "Africa/Lagos",
"jobId": "recurring_job_456"
}
}

Response Fields

FieldTypeDescription
processDefinitionIdlongID of scheduled process
schedulingEnabledbooleanWhether scheduling is active
cronExpressionstringConfigured cron expression
nextRunTimedatetimeNext scheduled execution time
timezonestringTimezone used
jobIdstringHangfire job ID for monitoring

Use Cases

  1. Daily Reports: Generate end-of-day reports

    {
    "cronExpression": "0 0 23 * * ?", // 11 PM daily
    "variables": { "reportType": "daily_summary" }
    }
  2. Monthly Processing: Run month-end procedures

    {
    "cronExpression": "0 0 1 1 * ?", // 1 AM on 1st of month
    "variables": { "processType": "month_end" }
    }
  3. Periodic Maintenance: Regular cleanup tasks

    {
    "cronExpression": "0 0 3 * * SUN", // 3 AM every Sunday
    "variables": { "retentionDays": 90 }
    }
  4. Real-time Monitoring: Frequent checks

    {
    "cronExpression": "0 */5 * * * ?", // Every 5 minutes
    "maxConcurrentInstances": 3
    }

Disabling Scheduled Execution

To stop scheduled execution without deleting the configuration:

{
"processDefinitionId": 456,
"schedulingEnabled": false
}

The configuration is preserved and can be re-enabled later.


Summary: Command Usage Matrix

TaskCommandTypical Frequency
Create new workflowCreateProcessDefinitiionCommandAs needed
Update workflow logicUpdateProcessDefinitiionCommandMonthly
Just rename workflowRenameProcessDefinitiionCommandAs needed
Delete workflowDeleteProcessDefinitiionCommandRarely
View single workflowGetProcessDefinitiionByIdQueryFrequently
List all workflowsGetProcessDefinitiionListQueryVery frequently
Export workflowGetProcessBundleQueryAs needed
Schedule workflowUpdateSchedulingInformationCommandAs needed
See available contextsGetContextLoadersQueryDuring design


Best Practices Summary

✅ Do's

  1. Use clear, descriptive names - "Loan Approval - SME" not "Process1"
  2. Add comprehensive documentation - Use BPMN documentation elements
  3. Version your processes - Include version info in metadata
  4. Test before activating - Create as inactive, test thoroughly
  5. Use categories wisely - Group related processes logically
  6. Include context loaders - Auto-initialize variables from entities
  7. Configure triggers appropriately - Auto-start on relevant events
  8. Monitor active instances - Before updating or deleting
  9. Use scheduling for batch jobs - Automate recurring processes
  10. Export/backup definitions - Use GetProcessBundleQuery regularly

❌ Don'ts

  1. Don't force delete with active instances - Cancel instances first
  2. Don't update without versioning - Track changes properly
  3. Don't create duplicate definitions - Check existing first
  4. Don't skip XML validation - Ensure valid BPMN
  5. Don't ignore breaking changes - Review impact on running instances
  6. Don't over-schedule - Avoid too many concurrent scheduled jobs
  7. Don't hardcode values - Use variables and context loaders
  8. Don't create overly complex processes - Break into subprocesses
  9. Don't skip testing - Test with real data before production
  10. Don't forget error handling - Include boundary events and error flows

Last Updated: January 6, 2026
Version: 1.0