bc-job-queue
Skill28 starsChanged 7 months agoMITView on GitHub
Guides AL developers through creating, parameterizing, executing, retrying, and diagnosing Business Central Job Queue workloads. Use when asked to enqueue codeunits or reports, pass parameters through Job Queue Entry, schedule recurring jobs, run or restart failed entries, compare Job Queue with TaskScheduler or StartSession, or add telemetry and diagnostics around background processing. Triggers: "job queue", "enqueue", "ScheduleJobQueueEntry", "Parameter String", "RunJobQueueEntryOnce", "Restart", "task scheduler", "job queue telemetry", "background session", "failed job".
In this repository38 other files it gives its agents.
- bc-agent-instructions-debuggerSkill
- bc-al-bug-fixSkill
- bc-al-code-reviewerSkill
- bc-al-project-contextSkill
- bc-api-page-generatorSkill
- bc-api-query-generatorSkill
- bc-approval-workflow-generatorSkill
- bc-attachments-generatorSkill
- skill-batch-processingSkill
- bc-business-events-generatorSkill
- bc-cds-page-generatorSkill
- bc-dataverse-entity-generatorSkill
- bc-dataverse-mapping-generatorSkill
- bc-field-propagationSkill
- bc-install-codeunit-generatorSkill
- bc-isolated-storage-generatorSkill
- bc-manifest-handoff-generatorSkill
- bc-matrix-page-generatorSkill
- bc-number-series-generatorSkill
- bc-pricing-refactorSkill
- bc-report-selection-generatorSkill
- bc-reportsSkill
- bc-setup-table-generatorSkill
- bc-setup-wizard-generatorSkill
- bc-table-dimensions-generatorSkill
- bc-telemetry-generatorSkill
- bc-test-codeunit-generatorSkill
- bc-upgrade-codeunit-generatorSkill
- documentation-bc-analysis-generatorSkill
- documentation-bc-architecture-generatorSkill
- documentation-bc-ccn-generatorSkill
- documentation-bc-md-to-docx-converterSkill
- documentation-bc-phase-plan-generatorSkill
- documentation-bc-release-note-generatorSkill
- documentation-bc-technical-spec-generatorSkill
- documentation-bc-user-story-generatorSkill
- onprem-remote-deploySkill
- skill-contribution-assistantSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. About 0 are common, 17 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Use this skill to design or troubleshoot Job Queue solutions in Business Central with a development-first focus.
- Very specific: line 27
Always verify the target runtime symbols for Job Queue Entry, Job Queue - Enqueue, and Job Queue Management before generating final AL.
- Distinctive: line 40
Use Job Queue when the user must be able to inspect entries, change scheduling, re-run jobs, or review logs in Business Central.
- Distinctive: line 49
Add recovery and diagnostics before considering the work complete.
- Distinctive: line 53
Use this block when the user asks to create a new background process, schedule it, or expose configuration that results in a Job Queue …
- Very specific: line 58
Prefer Job Queue over raw TaskScheduler.CreateTask when end users need to see or modify the schedule.
- Very specific: line 59
If the runtime exposes a suitable helper, prefer table methods such as ScheduleJobQueueEntry, ScheduleJobQueueEntryWithParameters, …
- Very specific: line 60
If you need full control over the entry, initialize Job Queue Entry explicitly and enqueue it through Codeunit::"Job Queue - Enqueue".
- Distinctive: line 62
Use category codes only when serialized execution is intentional.
- Distinctive: line 81
Use this block when the background code needs business context.
- Very specific: line 85
Prefer TableNo = "Job Queue Entry" on the runnable codeunit when the job consumes Parameter String, Record ID to Process, or report …
- Very specific: line 86
Keep Parameter String deterministic, culture-neutral, and compact.
- Very specific: line 87
Use Record ID to Process when the job acts on one specific record and identity matters more than text parsing.
- Very specific: line 93
Prefer machine formats such as YYYYMMDD.
- Distinctive: line 94
Prefer stable identifiers over captions.
- Distinctive: line 95
Keep parsing local and fail fast.
- Distinctive: line 96
If the payload is larger than the field limit, persist the payload elsewhere and pass a lookup key.
- Distinctive: line 106
Use this block when the request involves foreground testing, retry policies, restarts, stale jobs, or stability hardening.
- Very specific: line 112
Treat Confirm, Page.Run, Page.RunModal, Report.Run, Report.RunModal, Hyperlink, File.Upload, and File.Download as invalid when called from …
- Very specific: line 113
Use GuiAllowed() only to isolate optional UI behavior that may also run in foreground.
- Very specific: line 114
Use Job Queue Management.RunJobQueueEntryOnce for foreground testing when the user wants to validate a configured entry interactively.
- Distinctive: line 119
If the job depends on transient external services, favor several attempts with a meaningful delay window.
- Distinctive: line 120
If the job posts data or performs irreversible writes, make retry safety explicit before increasing attempts.
- Distinctive: line 121
If a job can become stale because of restarts, upgrades, or category serialization, add a recovery path and observability.
- Distinctive: line 132
Use this block when the user asks how to observe, debug, or stabilize Job Queue behavior.
- Distinctive: line 136
Always give the user at least one in-client diagnosis path and one telemetry path.
- Distinctive: line 140
If custom notifications are needed, prefer supported extensibility points such as enqueue events or validated status transitions.
- Distinctive: line 163
When this skill is used well, the output should usually contain:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Business Central Job Queue Skill
Purpose
Use this skill to design or troubleshoot Job Queue solutions in Business Central with a development-first focus. Prefer official platform and Base Application APIs, keep generated code safe for background sessions, and inspect target runtime symbols before relying on method signatures or event contracts.
Scope Boundaries
- In scope: AL design, enqueueing, parameter contracts, retry strategy, recovery, telemetry, and diagnostics.
- Out of scope: tenant administration runbooks, infrastructure-only monitoring, and customer-specific operational data.
- Always verify the target runtime symbols for
Job Queue Entry,Job Queue - Enqueue, andJob Queue Managementbefore generating final AL.
Decision Rule
Choose the async primitive before writing code.
| Need | Prefer |
| User-managed schedule, recurrence, Business Central logs, admin UI | Job Queue |
| One-shot queued background task without Business Central admin UI | Task Scheduler |
| Immediate background execution from current flow | StartSession |
| Read-only work bound to an open page | Page Background Task |
Use Job Queue when the user must be able to inspect entries, change scheduling, re-run jobs, or review logs in Business Central.
Working Sequence
- Confirm that Job Queue is the right primitive.
- Choose the creation pattern.
- Define the parameter contract.
- Make the runnable object background-safe and retry-safe.
- Add recovery and diagnostics before considering the work complete.
Knowledge Block 1: Create / Enqueue
Use this block when the user asks to create a new background process, schedule it, or expose configuration that results in a Job Queue Entry.
Core Rules
- Prefer Job Queue over raw
TaskScheduler.CreateTaskwhen end users need to see or modify the schedule. - If the runtime exposes a suitable helper, prefer table methods such as
ScheduleJobQueueEntry,ScheduleJobQueueEntryWithParameters,ScheduleJobQueueEntryForLater, or recurrent scheduling helpers. - If you need full control over the entry, initialize
Job Queue Entryexplicitly and enqueue it throughCodeunit::"Job Queue - Enqueue". - Set the minimum viable fields for manual creation: object type, object id, description, earliest start, retry policy, and parameter payload.
- Use category codes only when serialized execution is intentional.
- Reports can be scheduled as Job Queue objects, but report execution paths must still avoid UI-only behavior and should use report parameter helpers for request page payloads.
Creation Checklist
- Is the target object a codeunit or report that can run without UI?
- Does the request need one-shot, delayed, or recurrent execution?
- Will the execution user have permissions for all called objects?
- Are retry settings explicit instead of implicit defaults?
- Is the description stable enough for operations and support?
Red Flags
- Polling too frequently instead of using a better trigger.
- Creating many near-duplicate entries that should be one parameterized job.
- Encoding business meaning only in
Description.
Knowledge Block 2: Parameterize
Use this block when the background code needs business context.
Core Rules
- Prefer
TableNo = "Job Queue Entry"on the runnable codeunit when the job consumesParameter String,Record ID to Process, or report parameter payloads. - Keep
Parameter Stringdeterministic, culture-neutral, and compact. - Use
Record ID to Processwhen the job acts on one specific record and identity matters more than text parsing. - For richer report payloads, use XML or report parameter helpers instead of overloading
Parameter String. - Parse and validate parameters at the entry point before doing business work.
Parameter Design Heuristics
- Prefer machine formats such as
YYYYMMDD. - Prefer stable identifiers over captions.
- Keep parsing local and fail fast.
- If the payload is larger than the field limit, persist the payload elsewhere and pass a lookup key.
Anti-Patterns
- Locale-dependent parsing based on user language.
- Free-form text payloads that are not contract-based.
- Searching for the current in-process entry when
Reccan be bound directly.
Knowledge Block 3: Execute / Retry
Use this block when the request involves foreground testing, retry policies, restarts, stale jobs, or stability hardening.
Core Rules
- Runnable objects must be background-safe.
- Treat
Confirm,Page.Run,Page.RunModal,Report.Run,Report.RunModal,Hyperlink,File.Upload, andFile.Downloadas invalid when called from background execution code. This does not prohibit scheduling a report itself throughJob Queue Entry. - Use
GuiAllowed()only to isolate optional UI behavior that may also run in foreground. - Use
Job Queue Management.RunJobQueueEntryOncefor foreground testing when the user wants to validate a configured entry interactively. - Choose retry settings intentionally, especially for integrations and transient dependencies.
Retry Guidance
- If the job depends on transient external services, favor several attempts with a meaningful delay window.
- If the job posts data or performs irreversible writes, make retry safety explicit before increasing attempts.
- If a job can become stale because of restarts, upgrades, or category serialization, add a recovery path and observability.
Recovery Checklist
- Can the job be rerun safely?
- Is the failure transient, configuration-related, or business-data-related?
- Is a manual restart enough, or is data repair needed first?
- Are stale entries detectable through platform helpers or telemetry?
Knowledge Block 4: Monitor / Diagnose
Use this block when the user asks how to observe, debug, or stabilize Job Queue behavior.
Core Rules
- Always give the user at least one in-client diagnosis path and one telemetry path.
- In-client tools:
Job Queue Entries,Log Entries,Scheduled Tasks, andSession Eventtable2000000111. - Distinguish enqueue failures from execution failures and final-stop failures.
- Surface the official lifecycle event IDs and explain what each one proves.
- If custom notifications are needed, prefer supported extensibility points such as enqueue events or validated status transitions.
Lifecycle Events to Watch
AL0000E24: enqueued successfully.AL0000FNY: failed to enqueue.AL0000E25: started.AL0000E26: finished.AL0000HE7: failed but may retry.AL0000I49: rescheduled on login.AL0000FMG: run once by a user.AL0000JRG: failed for the last time and needs intervention.
Diagnostic Questions
- Did the entry enqueue at all?
- Did a scheduled task exist behind the entry?
- Did the job enter
In Process,Error, or final stopped state? - Is the failure due to UI callbacks, permissions, stale scheduling, bad parameters, or business data?
- Is the job safe to restart, or does it need repair first?
Expected Deliverables
When this skill is used well, the output should usually contain:
- An explicit Job Queue versus other async primitive decision.
- A creation or enqueue pattern.
- A parameter contract.
- A background-safe execution scaffold.
- A retry and recovery strategy.
- A monitoring and telemetry plan.
References
references/code-patterns.mdreferences/official-sources.mdreferences/release-plan-entry.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

