bitrix-background-jobs
Deferred and async work in Bitrix — CAgent agents and cron, Application::addBackgroundJob, Messenger queues (messages, receivers, brokers, messenger:consume). Use when moving work out of the request or scheduling it.
How do I install this agent skill?
npx skills add https://github.com/bxmaximum/bitrix-framework-skills --skill bitrix-background-jobsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill documents Bitrix framework features for background tasks, including the Bitrix Agent system which uses eval() for code execution. It identifies risks associated with interpolating variables into these agent definitions and recommends proper escaping. No malicious intent was detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Background jobs
Baseline: main 23.0+ · Verified: main 26.800.0
| Task | Read |
|---|---|
| Periodic or delayed task, agents on cron, long agents | rules/agents.md |
| Short tail work after the response | rules/background-job.md |
| Queue: message, receiver, dispatch, retries | rules/messenger.md |
Queue config, brokers, messenger:consume, kernel queues | rules/messenger-config.md |
Pick: schedule → agent (on cron); seconds of work after the response → addBackgroundJob; retries, volume, parallel workers → Messenger (Since main 25.100.300, alpha); one-off long migration → console command (bitrix-console-commands).
Invariants
- Background code has no user context: agents and receivers set
global $USER = null; no$_SESSION/cookies. Pass user/site IDs explicitly. - On hits, agents,
web-mode Messenger andaddBackgroundJob()run after the response is sent, afterOnAfterEpilogandsession_write_close(), with the DB pool forced to master. - Keep job code thin: resolve a service via
ServiceLocator::getInstance()->get()and call it (no constructor DI in agents —bitrix-framework). - Jobs must be idempotent: agents can run twice in parallel, messages can be redelivered.
- Log failures through a PSR-3 logger (
bitrix-logger); remove your agents on module uninstall.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/bxmaximum/bitrix-framework-skills/bitrix-background-jobs">View bitrix-background-jobs on skillZs</a>