Skip to content
N1
CRM / Bitrix24 · cron jobs · deal control

The CRM enforces deal discipline on its own

Client: Automotive marketplace, NDA Category: CRM / Bitrix24 Stack: PHP 8.3, Bitrix24 D7, cron + flock, Bitrix24 tasks, 1C (HTTP API), chat notifications Timeline: rolled out in stages
Problem

Deal rules relied on managers' memory: a car reservation under a preliminary contract could hang for days, payments and scans of signed documents were checked selectively, and the contract total in the CRM differed from reality in 12 of 71 audited deals (17%).

Constraints

The rules act on live deals and car reservations in 1C — a false positive would roll back a good deal. 1C changes amounts without deal events, and approval runs in parallel with the cron jobs.

What I did
  • Automatic release of an expired reservation under a preliminary contract after 3 hours: removal in 1C and a deal rollback, accounting for the race with approval, covered by 43 tests
  • Payment control on day 3 after contract approval: a task for the manager with result control
  • Control of signed-document scans: a task, an "OK / Reject" review window and a morning watchdog for overdue items
  • Re-sync of the contract total every 15 minutes with a safeguard against mass changes — 1C changes amounts without deal events
  • A watchdog for stuck handovers: if 1C returned an error but may have posted the sale on its side, the people responsible get a chat alert
  • Eliminated double submission of approvals to 1C — in August, 172 of 758 approvals went out this way
Architecture
Cron + flock → Rule in dry-run → Enable flag → Task, rollback or alert → Deal and 1C
Result

The rules are ready and are being enabled in production in September 2026 — each one by flag, after dry runs. The 3-hour window was chosen by measurement: 97% of deals go from preliminary to main contract in a median of 6 minutes, so the rule does not touch the healthy flow.

What can be reused
Cron-rule template: dry-run → flag → enable A task with result control instead of an activity Re-sync with a mass-change safeguard