End of Day Processing and Cron Jobs
  • 17 May 2022
  • 13 Minutes To Read
  • Dark
    Light
  • PDF

End of Day Processing and Cron Jobs

  • Dark
    Light
  • PDF

By default, Mambu runs a daily series of automated tasks outside of business hours and an hourly series of additional processing tasks. These can be grouped into two general categories:

  • Backup: Mambu makes a daily internal backup of your production database and retains it for seven days.
  • End-of-Day processing (EOD processing): These tasks ensure that all account states, days in arrears, penalties, and fees are up to date and consistent with any transactions that have been posted.

These tasks are executed by cron jobs, or scheduled tasks. Backup jobs run once a day, and run at the same time as daily or hourly jobs. Accounting, reconciliation, and related tasks are carried out by daily and hourly cron jobs, depending on the task.

Backup jobs run on production tenants only. All EOD processing jobs run on both production and sandbox tenants.

There is no downtime while these scheduled tasks execute.

EOD processes may also be configured to run at a manually-scheduled time or triggered by API. For more information, see Manual end of day processing and Manual end of day processing via the API below.

Please Note
This element can also be configured using Configuration as Code (CasC). For more information, see Configuration as Code.

Sequence of scheduled tasks

  1. At midnight, as determined by your time zone settings, you pass the accounting cutoff, and all further transactions are logged to the next calendar day in the ledger. See Accounting Cutoff below for more information.
  2. After that time, an automated backup job creates a duplicate image of your production database.
  3. Every hour, Mambu checks to see if we have run daily jobs on the most recent accounting day's data.
    • If not, the daily jobs run:
      1. Account jobs (first execution)
      2. Early organization jobs
      3. Loan jobs, savings jobs
      4. Account jobs (second execution)
      5. Late organization jobs
    • If so, we skip to hourly jobs.
  4. Hourly jobs run.

Accounting Cutoff

The accounting cutoff specifies the end of the accounting day. Any transaction made before the cutoff of a given day and after the cutoff of the preceding day will be considered to have occured "during that day" only for accounting purposes.

If you have the Early Access Accounting Cutoff configuration feature enabled, then you can configure your accounting cutoff time.

Early Access Feature
If you would like to request early access to this feature, please get in touch with your Mambu Customer Success Manager to discuss your requirements. For more information, see Mambu Release Cycle - Feature Release Status.

By default, if no specific accounting cutoff is set (that is, if the field is empty), then the accounting cutoff is at midnight as determined by your organization's configured time zone. For more information about time zones, see Organization Contact Details and Time Zone.

To set the accounting cutoff time:

  1. On the main menu, go to Administration > Financial Setup > EOD processing.
  2. Select Automatic in the dropdown box labeled End Of Day Processing.
  3. Enter the time at which accounting should be cutoff in the Accounting Cut Off Time field. All transactions after this time will have the next day as their Journal Entry Date.

Scheduling Accounting Cutoff Time in Mambu UI

Backup jobs

A daily backup job creates internal backups of your production database for compliance reasons, disaster recovery, and so forth. This data is stored for seven days.

Backup jobs are run at or around the same time as daily jobs. They are not executed during business hours, if they are already in progress, or if they have already completed. They are run on your production tenant only.

Name Description
DATABASE_BACKUP Create a copy of the database at that moment.

Daily jobs

Daily jobs are executed if they are not already in progress or completed. Daily jobs are executed sequentially in this order:

  1. Account jobs (first execution)
  2. Early organization jobs
  3. Loan jobs, savings jobs
  4. Account jobs (second execution)
  5. Late organization jobs

Note that that account jobs are executed twice.

Account jobs

Account jobs are executed twice as part of the daily jobs execution. This is necessary to support certain business scenarios, such as those involving backdated or adjusted transactions.

This may result in unexpected behaviour in rare cases. For example, when disbursing a loan where the first repayment date is in the past or on the current day, Mambu will collect the loan repayment with two transfer transactions rather than just one.

Name Description
AUTOMATED_TRANSFERS Automated transfers from deposit settlement accounts to loan accounts, as per loan account schedule.
UPDATE_SAVINGS_WITH_PRODUCT
_SETTINGS
Updates deposit accounts with any changes made to underlying Deposit Product Settings.
UPDATE_LOANS_WITH_PRODUCT
_SETTINGS
updates loan accounts with any changes made to underlying Loan Product Settings.

Appraisal per account

Mambu performs account appraisals on a per-account basis. In other words, we run through all the steps for a single account and then move on to the next account.

If EOD processing fails for a single account for any reason, Mambu still moves on to the next account. We then attempt to complete EOD processing for the failed accounts every hour in case the error has a temporary cause. However, if the account appraisal continues to fail, Mambu’s technical support will be alerted and will manually repair the account.

Early organization jobs

Early organization jobs focus on general ledger entries, making sure that they reflect all transactions, including any which may have been made on the current date, but backdated to have a booking date in the past.

Name Description
RESET_GL_JOURNAL_ENTRY
_SUMMARIES_INFO
Resets all the information related to journal entry summary items in order to be able to recreate them from scratch.
GENERATE_GL_JOURNAL_ENTRY
_SUMMARIES
Generates the GL journal entries summary items for the accounting entries logged since the last EOD job was executed.
UPDATE_JOURNAL_ENTRIES_FOR
_EARLY_INTEREST_ACCRUAL
Updates the journal entries reflecting accrued interest before the accrual takes place.

Detailed description of steps

The accounting summaries include all general ledger entries since the initialization of your Mambu system is automatically regenerated daily.

First, all existing summaries are deleted by executing the RESET_GL_JOURNAL_ENTRY_SUMMARIES_INFO job. They are then recreated from scratch by executing the GENERATE_GL_JOURNAL_ENTRY_SUMMARIES process.

The summaries are generated by taking into consideration all the General Leder (GL) journal entries logged during the day, grouped in a number of buckets, as determined by:

  • The GL account for which the entries were logged,
  • The branch of the loan / savings account for which the financial,transactions triggering the journal entries were logged - this is helpful in order to be able to filter by branch
  • The type (debit / credit), and
  • The entry date of the financial transaction triggering the journal entries. This is helpful in order to have a timeline for our accounting reports (basically, seeing how the balance sheet was looking on a given day).

The balance of a summary is determined by the sum of the amounts logged along with the journal entries grouped using the aforementioned buckets. The formula used is Debit - Credit. If the result is positive or zero, the type of the summary will be debit, and if the result is negative, the type will be credit.

Loan accounts jobs

The next batch of jobs concern loan accounts. Some examples include:

  • Making sure that any changes to interest or tax rates have been applied,
  • Marking loans as in arrears if a payment was expected on the current day, or the grace period has expired, or
  • Managing the application of fees, penalties and accrued interest.
Name Description
AUTO_CLOSE_PAID_OFF_LOANS Automatic closure of loan accounts with zero balances, based on the Loan Product Dormancy settings.
AMOUNTS_AMORTIZATION Fee amortization in accounting.
INTEREST_RATE_UPDATE Updates Interest Rate based on Index Interest Rate changes.
TAX_RATE_UPDATE Update tax rate based on Tax Rate changes.
PERIODIC_PAYMENT_UPDATE Updates periodic payment.
CREATE_REVOLVING_CREDIT
_DUE_REPAYMENTS
Creates repayment schedule for Revolving Credit loan accounts.
LOCK_CAPPING_CHECKER Checks if capping constraints have been exceeded and pass the loan account into locked capping state if necessary.
LOAN_INTEREST_APPLY Application of interest accrued.
LATE_LOAN_CHECKER Sets the loan accounts to "In Arrears" state.
PAYMENT_DUE_FEES_APPLY Application of due fees.
PENALTIES_APPLY Application of any penalties.
AUTO_REDRAW_REPAYMENT Automatically redraws due repayment.
AUTO_LOCK_ARREARS_LOANS Locks the loan accounts that have been in arrears for a specific period of time as defined in Loan Product setup.
DUE_AMOUNTS_UPDATE Updates all amounts due based on any interest, penalties and fees applied for that day.

Saving accounts jobs

Savings accounts jobs run against deposit accounts. Similar to loan accounts jobs, these will manage application of accrued interest, fees, and penalties as well as mark accounts as dormant if the product is configured to automatically set accounts as dormant after a period of inactivity.

Name Description
SAVINGS_ACCOUNT_APPRAISER
  • Accrue and apply interest (positive and overdraft interest)
  • For saving accounts with Tiered Interest → update Interest Rate and loan transaction if needed
  • Updates overdraft account state → update account state from Active to Active In Arrears and log activity when expiry date is met and account's balance is negative
  • Applies monthly fees on due date
AUTO_DORMANT_INACTIVE
_SAVINGS_ACCOUNTS
Sets deposit accounts as Dormant as defined in Deposit Product Settings.

Late organization jobs

The late organization jobs include jobs which are run to add notifications to queues. For example, if you have set up notifications to let customers know a repayment is due or about a scheduled disbursement, the notification message will be generated at this time and added to the queue to be sent at the opening of business. This set also includes some system-related jobs such as enforcing password rotation for Mambu users.

Name Description
ARCHIVE_ACCOUNTING
_NOTIFICATION_MESSAGES
Archives all the accounting notifications.
UPDATE_JOURNAL_ENTRIES
_FOR_LATE_INTEREST_ACCRUAL
Updates journal entries reflecting the accrued interest after the accrual takes place.
END_OF_DAY_CLOSURE Performs end of day accounting closures.
UPCOMING_REPAYMENTS_CHECKER Searches for all the repayments which are in Pending or Partially Paid state and trigger reminder Notifications using templates (check the due dates equal to today plus a configured number of days (how many days before that due date)  and create notifications).
ACCOUNT_IN_ARREARS_CHECKER Triggers notifications after a configured number of days since the account is passed into arrears state.
UPCOMING_DISBURSEMENT_CHECKER Triggers notifications for Approved accounts with a configured number of days before the expected disbursement date (loans and tranches).
ENFORCE_USER_PASSWORD_RESET Resets user passwords if the period defined in "Internal Controls" is up.
ORGANIZATION_SNAPSHOT Creates a snapshot of all indicators for organization.
Please Note

For the current status of daily actions, please see Scheduled jobs summary.

Hourly jobs

Hourly jobs are executed after daily jobs.

Name Description
SEND_QUEUED_NOTIFICATIONS Checks for queued notifications and schedule them for sendout.
AUTHORIZATION_HOLDS_EXPIRATION Expires any authorization hold requests on which a settlement action has not been taken before the expiration period has elapsed. For example, if 14 days is the expiration period set for authorization holds, then any authorization holds created or updated 14 days ago are candidates to expire. When an authorization hold expires, its status changes from PENDING to EXPIRED and the hold amount no longer affects a client's available balance. For more information, see Card Transactions and Configuring authorization holds settings.
BACKGROUND_PROCESS_EVICTION A technical task to clean any background processes.
Please Note

SMS notifications are not sent at midnight, but starting at 9:00 am in your organization's configured time zone.

EOD processing emails and notifications

Please be Aware

EOD-related alarms are supported for production processing only.

By default, if an EOD process fails, you will be notifed by email, unless the email quota for your tenant is exceeded, in which case a log error will be written only. The email will include information such as the names of all cron jobs that had errors.

You may also receive notifications for EOD process failure via webhooks or event streaming, but you must create the notification yourself.

Please Note

We recommend configuring EOD webhook notifications to improve your monitoring of the process.

To create a notification webhook, select End of Day Processing as the Target and Accounts Updated as the On Event option. For more information, see Defining a new Webhook and Event Streaming API.

Manual end of day processing

This feature is not available by default. If you would like to request access to this feature, please get in touch with your Mambu Customer Success Manager to discuss your requirements. For more information, see Mambu Release Cycle - Feature Release Status.

You may execute EOD processes manually instead of having them run automatically every night. Manual execution guarantees that Mambu will not run account appraisals every night, but the backup jobs will still duplicate your production data every night.

You may schedule manual EOD processing at any time. However, if you execute them before 23:01, then the cron jobs will run on the snapshot of the system that was taken at midnight (23:59) of the previous day.

To run manual EOD processing from Mambu:

  1. Make sure you have the Manual EOD Processing feature enabled - see Mambu Release Cycle- How do we identify the stage of a feature? for instructions. If you need it enabled, please contact you Customer Success Manager.
  2. On the main menu, go to Administration > Financial Setup > EOD Processing.
  3. In the End of Day Processing dropdown, select Manual.
  4. Select Run Now.

Manual end of day processing via the API

To run manual EOD processing using the API, please refer to the Crons documentation in our API v2 Reference.

Please Note

Triggering the EOD processing manually will run both the hourly and daily jobs. If the daily jobs already ran for the day, then only the hourly jobs will run. Remember to run them before closing accounting books, to make sure that all the accounts are up-to-date.

Cancelling EOD processing

This feature is not available by default. If you would like to request access to this feature, please get in touch with your Mambu Customer Success Manager to discuss your requirements. For more information, see Mambu Release Cycle - Feature Release Status.

Under certain unusual circumstances, you may wish to cancel a running EOD process. Specific cron jobs cannot be terminated, but if a group of EOD processing jobs is taking a long time to complete, they may sometimes be terminated via API.

Warning!

If you terminate EOD processing jobs, you are responsible for ensuring that the jobs are re-run. If you are using manual EOD processing, you must reinitiate the job. If you are using automatic EOD processing, the cancelled group of jobs will re-run automatically at the next scheduled time.

To cancel EOD processing, use the Background Process endpoints. For more information, see Background Process in our API Reference.

To access the Background Process endpoints, your user must have Admin access rights. For more information, see Creating a User - User Rights.

EOD process cancellation requests

Manually-triggered EOD processing jobs with the MANUAL_CRON_JOBS_TRIGGER type and automatically-triggered EOD processing jobs with the CRON_JOBS type may be cancelled under either of the following conditions:

  • The state of the currently-running cron job is QUEUED; or
  • The state of the currently-running cron job is IN_PROGRESS, and its execution time has already taken longer than the longest of the last five EOD processing jobs of the same type that have been run.

Cancelling EOD processing has two steps: getting the ID of a currently-running job, and sending the cancellation request.

Get the ID of a currently-running job

The first step is to retrieve the ID (encoded key) of the group of cron jobs by making a GET request to /api/backgroundprocess/latest, specifying the type query parameter as either CRON_JOBS or MANUAL_CRON_JOBS_TRIGGER depending on which EOD processing mechanism you have set up. The endpoint will return the last-started group of jobs of the specified type and indicate whether or not it is still executing.

We recommend making two GET requests: one with type=CRON_JOBS and another with type=MANUAL_CRON_JOBS_TRIGGER to be certain you are getting any possibly-running job. If you request a background process with a type that has never been used in your instance, you will get an error informing you that there was No background process found by specified type.

The following example shows a request for data on the currently-running job with the CRON_JOBS type:

GET https://TENANT_NAME.mambu.com/api/backgroundprocess/latest?type=CRON_JOBS

Example response:

{
    "encodedKey": "402881647fb680c8017fb68c29f00470",
    "type": "CRON_JOBS",
    "state": "QUEUED",
    "creationDate": "2022-03-30T09:00:00Z"
}

In this example, the job may be cancelled, because the type is CRON_JOBS and the state is QUEUED.

Sending the cancellation request

The second step is to send a cancellation request using the returned encodedKey value. To do so, make a PUT request to /api/backgroundprocess/{encodedKey}, passing in the encodedKey value of the jobs you retrieved in the first step, and providing the string "CANCEL" as the payload.

Example request:

PUT https://TENANT_NAME.mambu.com/api/backgroundprocess/402881647fb680c8017fb68c29f00470

"CANCEL"

Example response:

{
    "encodedKey": "402881647fb680c8017fb68c29f00470",
    "type": "CRON_JOBS",
    "state": "CANCEL",
    "creationDate": "2022-03-23T11:31:53Z",
    "startDate": "2022-03-23T11:31:54Z",
    "endDate": "2022-03-23T11:31:58Z"
}

This response indicates that the set of EOD Processing jobs has been stopped. Be sure to manually re-initiate the jobs if necessary.


Was This Article Helpful?