When I work with financial data, one thing I often need to check is whether the numbers make sense before using them in reporting or planning.
Journal entries are a good example. Most journal lines follow normal accounting patterns, but sometimes we may see unusually large amounts, entries posted late at night, manual adjustments over weekends, or transactions posted after the period closes.
These entries are not necessarily wrong. There may be valid business reasons for them. But they are worth reviewing.
I wanted to test whether a simple machine learning model can identify unusual journal lines without manually defining a rule for every possible exception.
For this experiment, I use Python and Isolation Forest. I generate 3,000 synthetic journal lines, deliberately introduce 30 unusual records, and check whether the model identifies them.
The data is structured like a journal-line extract that we might analyze from Workday Financial Management. It is not a real Workday export, and the model runs entirely in Python.
How I prepare the journal data
I start by generating 3,000 journal lines with different amounts, posting times and transaction sources.
Each record contains the journal amount in INR, posting hour, whether the entry occurs on a weekend, the source of the entry, and the number of days after period close.
For the normal records, I generate amounts using a lognormal distribution. Most posting times are concentrated around normal working hours, and only a small percentage of entries occur on weekends.
The source can be Integration, Accrual, Manual or Spreadsheet Upload.
I then select 30 records and deliberately change their characteristics.
These records have larger, rounded amounts between ₹40 lakh and ₹3 crore. Their posting hours are outside normal working hours, such as midnight, 2 AM, 10 PM or 11 PM.
I also mark 18 of them as weekend entries and 12 as posted after period close. The planted records use Manual or Spreadsheet Upload as their source.
This gives me a controlled dataset where I know which records I deliberately made unusual.
How I build the Isolation Forest model
I use Isolation Forest from scikit-learn.
The idea is straightforward. Instead of defining every abnormal transaction in advance, the model looks for observations that are different from the rest of the dataset.
I prepare six inputs: the logarithm of the journal amount, distance from the normal posting hour, weekend indicator, manual or spreadsheet source indicator, rounded amount indicator, and days after period close.
I use the logarithm of the amount because journal values can vary significantly. This reduces the effect of the absolute amount scale.
The model uses 300 trees, a fixed random seed and a contamination setting of 1.2%.
That contamination setting is important. It tells the model to classify approximately 1.2% of the fitted records as unusual.
For 3,000 records, this means approximately 36 flagged journal lines.
I train the model on the complete synthetic dataset and calculate an anomaly score for each record.
A higher score in my dashboard means the journal line is more unusual according to the model.
What the dashboard shows

The first chart shows journal amounts against posting hours.
Most records appear between approximately 8 AM and 8 PM, with amounts concentrated in the lower ranges.
The red points represent journal lines flagged by the model.
Many of the flagged records have large amounts and posting times close to midnight or late evening.
This is what I expect because I deliberately introduce these patterns into the test data.
The second chart shows how many planted unusual records the model finds.
| Result | Journal Lines |
|---|---|
| Total records | 3,000 |
| Planted unusual records | 30 |
| Planted records identified | 30 |
| Planted records missed | 0 |
| Other records flagged | 6 |
| Total flagged for review | 36 |
The model identifies all 30 planted records and flags another six records that were not deliberately modified.
In this controlled experiment, that gives me 100% recall for the planted records and approximately 83.3% precision against the synthetic labels.
However, I am evaluating the model on the same dataset used for fitting. The unusual records are also deliberately different from the normal population.
So I do not interpret this as proof that the model can identify every abnormal journal in a real financial system.
Understanding the anomaly scores
The third chart shows the distribution of anomaly scores for all 3,000 journal lines.
Most records have lower scores, while a smaller number have high scores.
The dashed red line represents the review threshold, approximately 0.696 in this test.
Records above the threshold are flagged for investigation.
What matters here is that the threshold depends partly on the contamination setting.
If I change the expected proportion of unusual transactions, the number of flagged records may change.
That means the model does not independently determine how many records Finance should investigate.
I need to select a reasonable review threshold based on the business requirement and the volume of exceptions the team can review.
Looking at the top journal lines
The fourth section of the dashboard lists the ten highest-scoring journal lines.
For example, one of the records has an amount of ₹2.17 crore, is posted at midnight on a weekend, comes through Spreadsheet Upload and falls three days after period close.
That combination makes the record stand out.
Another record has an amount of ₹2.92 crore, is posted at 2 AM, comes from a manual source and is recorded four days after close.
These are the kinds of entries I would want to examine more closely in a journal review.
But an unusual posting time or large amount does not mean the accounting is incorrect.
For example, automated integrations may run overnight, and period-end adjustments may legitimately involve large amounts.
The model helps me decide where to look. It does not establish whether a journal is valid or invalid.
How I would use this with Workday Financials
In a real implementation, I would first identify an appropriate journal report or data extract from Workday Financial Management.
Workday supports journal processing through automated accounting, manual journals and spreadsheet uploads. The available data and reporting access depend on the organization’s configuration and security permissions. would start with journal-line information such as amount, journal source, posting date, accounting period, ledger account, company, worktags and other relevant audit fields.
For this experiment, I only use a small subset of possible attributes.
I would prepare the data outside Workday, run the model in Python and produce a review file containing the journal identifiers, anomaly scores and relevant transaction details.
Then I would review the flagged entries with the Finance or controllership team.
I would not automatically reverse, reject or block journal entries based on the model output.
would first check the source document, accounting period, posting reason and supporting approvals.
would also compare the model’s results against the organization’s existing journal controls.
The model should support those controls rather than replace them.
This notebook does not connect to a Workday Financials tenant or create an actual journal exception workflow.
What I would test next
The first thing I would change is the validation approach.
Here, I create very obvious unusual records and evaluate the model on the same dataset used for fitting.
For a more meaningful test, I would use historical journal data, fit the model on an appropriate earlier period and test it on a separate period.
I would also compare the model’s results with known journal exceptions identified through existing reviews.
Another important test is the false-positive rate.
In this experiment, six records are flagged even though I did not deliberately modify them.
Those records may still be statistically unusual. A false flag relative to my synthetic labels is not necessarily an incorrect accounting alert.
I would want the Finance team to review these examples and determine whether the alerts are useful.
I would also test different contamination settings, compare the model with simple rule-based controls, and add more accounting context.
For example, a large manual journal may be normal for one account but unusual for another.
Similarly, entries posted after close may have different implications depending on the journal type and approval process.
I would need to consider those differences before using a model in production.
In this experiment, Isolation Forest identifies all 30 deliberately unusual journal lines out of 3,000 records and flags six additional records.
The result shows that a relatively simple Python model can identify unusual combinations of transaction characteristics in a controlled dataset.
It does not prove that the model detects fraud, accounting errors or control failures.
What I find useful is the possibility of creating a prioritized review list instead of manually checking every journal line with the same level of attention.
For me, the next step is not to make the model more complex. It is to test whether the flagged records are actually useful to someone reviewing financial transactions.
If the model helps identify relevant exceptions without creating too many unnecessary alerts, it may be worth integrating into a financial data review process.
That is how I want to approach this: start with a small experiment, check the output, understand the limitations and then decide whether it solves a real problem
ll journal lines, amounts and anomaly labels in this experiment are synthetic. No real Workday Financials or client data is used.