Skip to main content

Background process models

Background process models manage asynchronous job execution, scheduled tasks, and long-running operations in Chargeworx.

BackgroundProcess

Tracks background jobs and scheduled tasks executed by the system.

Key properties

PropertyTypeDescription
IdGuidUnique process identifier
ProcessTypeStringType of background process
StatusStringCurrent process status
PriorityIntExecution priority
ScheduledAtDateTimeScheduled execution time
StartedAtDateTime?Actual start time
CompletedAtDateTime?Completion time
RetryCountIntNumber of retry attempts
MaxRetriesIntMaximum retry attempts allowed
ErrorMessageStringError details if failed
ProcessDataStringJob-specific data (JSON)

Process types

TypeDescription
TransactionProcessingProcess pending transactions
BatchSettlementSubmit settlement batches
AccountUpdaterCheck for card updates
ReportGenerationGenerate scheduled reports
DataExportExport transaction data
EmailNotificationSend email notifications
RecurringBillingProcess recurring charges

Status values

StatusDescription
PendingQueued for execution
RunningCurrently executing
CompletedSuccessfully completed
FailedExecution failed
CancelledManually cancelled
RetryingRetry in progress

Usage patterns

Job scheduling

Background processes can be scheduled for immediate or future execution. Jobs are prioritized and executed by worker processes.

Retry logic

Failed jobs are automatically retried based on the configured retry policy. Each retry attempt is logged with error details.

Job monitoring

Process status can be monitored through the admin UI or API. Long-running jobs provide progress updates.

Job cancellation

Running or pending jobs can be cancelled manually if needed. Cancellation is graceful and allows cleanup operations.

Common background processes

Transaction processing

Asynchronous transaction processing for high-volume scenarios. Transactions are queued and processed in batches.

Batch settlement

Automated submission of transaction batches to payment processors on configured schedules.

Account updater

Scheduled checks for credit card updates from card issuers.

Report generation

Scheduled generation of transaction reports, reconciliation files, and analytics.

Recurring billing

Automated processing of recurring charges based on billing schedules.

Best practices

  • Set appropriate retry limits for different job types
  • Monitor failed jobs and investigate root causes
  • Use priority levels to ensure critical jobs execute first
  • Implement idempotent job handlers to safely retry operations
  • Log detailed error information for troubleshooting
  • Clean up completed job records periodically

Performance considerations

  • Jobs are executed by worker processes separate from web requests
  • High-priority jobs are processed before lower-priority jobs
  • Long-running jobs should provide progress updates
  • Failed jobs are retried with exponential backoff
  • Job queues are monitored for capacity and performance