Report automation in 1C-Bitrix: setting up agents and cron

Manual report preparation consumes team time and slows down decisions. We set up automatic report generation in 1C-Bitrix turnkey: from task definition to scheduled launch. You get ready data without manual work and delays.

Our competencies:

Frequently Asked Questions

Automatic Report Generation in Bitrix: What Breaks Without Agents

Manual report export in Bitrix survives only until the first crunch: as long as the manager remembers to click the button, the data in the dashboard stays fresh.

As soon as reporting shifts into "when asked" mode, the funnel and stock levels in the system start diverging from reality by days, and decisions are made based on outdated data.

It hurts especially when the same report is assembled manually from several sources — each iteration takes hours and still produces different results for different employees.

The second typical failure is stuck agents. By default, an agent in Bitrix runs on hits and keeps working until someone calls it; if the script crashes midway or pulls a heavy query, it stays in the queue and blocks subsequent runs.

The report either doesn't update at all or updates partially — and no one notices, because the error isn't surfaced anywhere. On a production project, this looks like "the numbers seem to be there, but you can't trust them."

The third failure is reports that no one runs. They're simply forgotten: no schedule, no owner, no notification when ready. Data accumulates but never turns into a decision.

That's exactly why automatic report generation in Bitrix is built not on a "generate" button, but on a combination of agents and Bitrix cron: scheduled tasks run on a schedule regardless of site traffic, agents perform heavy queries in batches, and the result is compiled into a ready report with a notification to the responsible person. Let's break down how this gets covered without manual runs and outdated data.

What reporting automation gives a business

A manual report in 1C is always a chain: export, consolidation in spreadsheets, checking for discrepancies, distribution. Preparation takes from several hours to a couple of days, and by the time it is sent, the data is already a day out of date.

Automation removes the chain itself: 1C-Bitrix agents and the system scheduler generate the report on a schedule, place the finished file where it needs to go, and send it to the recipients.

Speed here is measured not in minutes of waiting, but in the absence of waiting: the report is ready by the start of the workday, because generation is triggered at night.

Data freshness no longer depends on whether an employee managed to refresh the export — there is a single source, and it is read directly from the accounting system.

A separate effect is that the entire class of manual entry errors disappears. An employee who manually consolidates figures from several sources will inevitably make mistakes: the wrong period, a skipped row, a broken formula in an intermediate spreadsheet.

A procedure hard-coded in the logic runs the same way every time — discrepancies in the figures stop being a matter of trusting the report.

Offloading employees is measured not in abstract savings, but in hours freed up: an accountant or analyst who used to spend half the workday on consolidation returns to the tasks that genuinely require a human.

Automatic report generation in Bitrix handles the regular routine, leaving manual review only for non-standard cases — when the figures really need to be explained, not merely assembled.

Options for launching reports: agents, cron, external services

Automatic report generation in Bitrix is built on choosing a launch mechanism. Bitrix agents are deferred tasks that run on hits (requests to the site): as long as there is traffic, the agent fires; if the site sits idle at night with no visits, the report won't be generated.

Cron works independently of load — the OS scheduler runs the script on a schedule, which is critical for heavy exports and nightly routines. External launching via API or a separate service moves generation outside the site and takes the load off the web server.

Option When it fits Limitations
Bitrix agents Lightweight reports tied to user activity Depend on traffic, don't run when the site is idle, accumulate in a queue
Cron (OS scheduler) Scheduled exports, heavy reports, nightly tasks Requires server access; if the script fails, there's no auto-retry without logging
External launch (API/service) Scheduled reports independent of the site, integrations with external systems Requires authorization and endpoint protection, an additional point of failure

In practice, approaches are more often combined: agents — for operational reports within the interface, cron — for scheduled exports and mailings, external calls — for integrations with 1C and third-party systems.

The key limitation of any option is idempotency: a repeated run must not duplicate data, so locking and status checks of the previous execution are built into the script. Without this, when runs overlap, the report is duplicated and the load on the database grows exponentially.

Another limitation is timeouts. Agents and web scripts hit the PHP execution limit, so long reports are split into batches or moved to console mode.

Logging and error notifications are configured for each mechanism — otherwise a generation failure is only discovered when the recipient doesn't receive the report.

How we implement automatic report generation

Implementing automatic report generation starts with an audit: we look at which reports are generated manually, who prepares them and how often, and what data is needed in the output.

At this stage we identify the sources — 1C modules, information blocks, external databases — and assess where report generation blocks users' work. The result of the audit is a process map and a list of reports that are actually worth automating.

Next, we design the solution and configure it step by step.

  1. Audit and inventory. We compile a list of reports, their frequency, the responsible people, and data sources. We note which ones are generated manually and how much time this takes.
  2. Schema design. We determine what the agent calculates, what is moved to cron, how results are stored, and where they are delivered — email, file, a section on the portal.
  3. Agent configuration. We register agents with the required frequency, configure handlers and launch parameters. We move heavy queries to cron so they don't slow down the portal pages.
  4. Cron and queue configuration. We spread out the launches over time, set intervals, and protect against parallel execution of the same report.
  5. Testing on real data. We compare the automatic report with the manual one, check edge cases: an empty period, a large volume, an unavailable source. We look at the logs and execution time.
  6. Handover and documentation. We show the team how to change parameters and add new reports, and we document the schema and control points.

After handover, reports are generated on schedule without employee involvement, and changes to them are made by editing parameters rather than rewriting the logic.

What the client receives

At the end of the project, the client is left not with a "working report" but with a set of deliverables that allows the system to be operated, extended, and handed over to another contractor without archaeological excavations in the code.

  • Agent and cron job configurations: which reports run on a schedule, at what frequency, in what order, with what parameters and timeouts.
  • Data flow diagram: where the source data comes from, where aggregation happens, where the finished report ends up, and who receives the notification.
  • Reporting regulations: the launch calendar, windows for heavy exports, and rules for behavior when overlapping with other tasks.
  • Error handling and re-runs: what happens when the source is unavailable, how a job returns to the queue, and how an incident is recorded.
  • Instructions for adding a new report: a step-by-step scenario so that a staff specialist can extend the list without contacting us.
  • Administrator instructions: how to pause, restart, or disable a specific job and where to view the execution log.
  • Monitoring map: which events are considered normal, which require a response, and to which addresses notifications are sent.
  • Documentation on access and roles: who has the right to change the schedule, report templates, and recipient parameters.

Each artifact is agreed upon with your team before handover: configurations and regulations are committed to the repository, while diagrams and instructions go into the shared knowledge base.

This removes dependence on a specific contractor and makes automatic report generation a manageable process rather than a set of scripts that only one person knows about.

Case Study: How We Accelerated Report Preparation in 1C-Bitrix

What It Was Like Before

The reporting loop relied on manual runs: an employee would open the 1C-Bitrix admin panel, export warehouse and sales data, consolidate it in spreadsheets, and send it out to managers.

Generating the monthly summary took 6-8 hours, and some exports would time out on large periods, forcing data to be collected again.

Errors in the numbers were only discovered at the morning meeting: discrepancies between the report and actual stock balances reached 4-5 positions per period.

No one could name the exact time the summary would be ready — it depended on the employee's workload and on how successfully the export went.

What We Changed

We moved report generation into background jobs and put them on the system scheduler so that heavy queries run at night rather than during working hours.

We added an intermediate store: aggregates are calculated once and reused, so re-running a report for the same period doesn't recalculate everything from scratch.

Every run writes a log — start time, volume of processed records, result. If a job fails, the system retries and notifies the responsible person instead of leaving an empty report. Summaries go out to managers on schedule, without employee involvement.

What It Became

The monthly summary is generated in 12-15 minutes instead of 6-8 hours — it's a background process that finishes before the workday begins.

Discrepancies in the numbers are gone: aggregates are calculated from a single source, and manual transfer between spreadsheets is eliminated.

The share of reports prepared without manual intervention has grown to 95%. Employees spend the freed-up time analyzing deviations rather than consolidating exports.

Job failures are now visible in the log immediately — previously, a failure was only discovered when the report didn't arrive on time.

How is cron different from Bitrix agents?

Cron is the operating system's system scheduler: it launches a process on a schedule from crontab, regardless of what is happening in the application.

Agents are an internal mechanism of the platform: they are tied to events and run on hits, that is, at the moment the site is accessed.

Hence the main practical difference: cron works even when there are no visitors on the site, while agents work only when someone has visited and the hit has processed the queue.

Then reliability comes into play. By default, agents run on user requests: if traffic drops at night, a report may not be generated on time, and if an agent is heavy, it slows down the response to the visitor.

During a migration or failure, the agent table can easily get out of sync, some tasks get "stuck" in the running status and no longer start. Cron does not depend on this: the process starts on time, writes a log, and on failure the return code is visible.

That is why we move scheduled reports, exports, and exchanges to cron, and leave agents for lightweight event-driven tasks.

There are also compatibility nuances. Some of the platform's built-in mechanisms depend on agents, and they cannot be disabled completely — otherwise service data will stop updating.

The working scheme: we switch agents to run only from cron (one entry point instead of a hundred hits), and move heavy reports into separate scripts with their own schedule and a lock against parallel execution.

The choice depends on the task. If a report must be ready by the start of the workday regardless of traffic — that is cron. If an action is tied to an event (order status change, new request) — an agent is suitable.

In practice, they are combined: an event queues a task, and cron processes it within a given window.

For reporting, we by default design the launch on cron: fixed time, execution log, retry on error, and notification to the responsible person.

This provides predictability — generation does not depend on traffic, and a failure is visible in the log rather than discovered in the morning by the absence of a file.

Common technical concerns

Automatic report generation in Bitrix almost always comes down to the same questions: will it overwhelm the site, will data leak, what happens if something fails. Below are brief answers to each.

Reports are generated on the production server — will the site slow down under load?

We move heavy queries outside user requests: aggregates are calculated on a schedule in the background, not at the moment a page is opened. If there is a lot of data, we build the report incrementally — based on changed records, not the entire database every time.

We account for peak hours in the schedule so that generation does not coincide with maximum traffic.

Who gets access to reports and data?

We separate access by roles: each person sees only their own sections and slices, and external export requires explicit permission. Accounts for jobs operate with the minimum necessary privileges, not as administrator. All runs and exports are recorded in a log — you can see who requested what and when.

How are reports connected to 1C and external systems?

We build the exchange through standard integration mechanisms: 1C provides the data, Bitrix receives it and lays it out according to the report structure. If an external system is unavailable, the job does not fail but retries at a specified interval.

We document the exchange scheme and formats so that the integration can be extended without rewriting.

What happens if a job fails — will the report simply not arrive?

Every run is logged; on error, the responsible person receives a notification rather than finding out about the problem from colleagues. A re-run is provided for, along with the ability to backfill a missed period.

If a report is critical, we add monitoring: the next run checks that the previous one completed and raises an alert on any discrepancy.

Will data volume grow, and how does it scale?

We limit report storage with a policy: we keep the required history depth and archive or delete old data. As the number of reports and users grows, we distribute the load — heavy builds go into a separate queue. Adding a new report does not require rebuilding existing ones: each is configured independently.

Describe which reports you need and from which systems — we will come back with an estimate and a plan for load, access, and integrations.

Let's discuss your report automation task

Automatic report generation in Bitrix rarely comes down to a single script: you need to figure out where the data comes from, on what schedule it is collected, and how the result reaches the recipient.

That is why we start not with code, but with an analysis of your task — which reports are generated now, who prepares them manually, and how much time it takes.

To come back with an estimate and a plan rather than general words, we need a minimum of input. Describe the task — then we work through clear steps.

  • Which reports are needed and at what frequency: once a day, on an event, or on demand from the interface.
  • Where the source data lives: Bitrix modules, information blocks, external databases, exports from 1C.
  • Who the recipient of the result is: a file by email, a section in the admin panel, an export to a shared folder or table.
  • How the server is configured: whether there is access to the task scheduler and the ability to run background processes.
  • What load constraints exist: during which hours it is acceptable to collect heavy queries so that the site does not slow down.
  • Whether there are ready-made report templates that need to be preserved exactly, or whether the format can be rebuilt.
  • Who is responsible for acceptance and how we will verify that the figures in the report match the source data.

After the analysis, we come back with a timeline estimate, a work plan, and a scheme for how reports will be collected and delivered without manual involvement. Let's discuss your task — write what needs to be automated, and we will propose a solution for your environment.