bc-approval-workflow
Audit, scaffold and debug approval workflows for custom tables in Business Central AL extensions, wired into Workflow Event Handling and Approvals Mgmt.
- Version
- 0.1.0
- Updated
- Nov 23, 2026
- Works with
- Claude Code, GitHub Copilot
- License
- MIT
- Source
- nantarwath-kom/bc-skills
Standard documents like purchase orders ship with approval workflows wired up. A custom table has none: the workflow engine doesn’t know it exists. This Skill gives your AI coding agent the full pattern for wiring a custom document into Workflow Event Handling and Approvals Mgmt., plus the failure modes that cost hours in production.
Quick start
1. Install
/plugin marketplace add nantarwath-kom/bc-skills
/plugin install bc-skills@supherogit clone https://github.com/nantarwath-kom/bc-skills
cp -r bc-skills/skills/bc-approval-workflow .github/skills/2. Open your AL project
Run claude in the folder that holds your app.json.
3. Ask in plain words
Prompt
Add an approval workflow to table 50100 "Advance Request"Other modes are below.
What it does
The Skill picks one of three modes from your request:
| Mode | Ask something like | What you get |
|---|---|---|
| Audit | “Audit the approval workflow in this extension” | A component table (file:line, ✅ / ❌ / ⚠️) against a 20-point checklist, with known anti-patterns flagged as findings |
| Create | “Add an approval workflow to table 50100 Advance Request” | A short interview (status values, header-only or header + lines, cancel design, object IDs), then one codeunit generated from a proven template |
| Debug | “Send Approval Request is greyed out” / “Cancel does nothing” | A symptom table walked top-down, pointing at the workflow table to inspect before touching code |
Inputs
- An AL project open in your agent (the Skill greps for
OnAddWorkflowEventsToLibraryand related subscribers). - For Create: the document table, its status field, and free object IDs.
- For Debug: the symptom, and ideally read access to the tenant’s workflow tables (1501, 1502, 1504, 1511).
Outputs
- Create: a workflow codeunit with send/cancel business events, library registration, Approvals Mgmt. subscribers, a seeded workflow template built with
InsertDocApprovalWorkflowSteps, a repair procedure for stuck instances, and the page actions. - Audit: a findings table with minimal fixes. It never restructures a working workflow just to match the template.
- Debug: the likely cause, how to verify it, and the fix.
Hard-won rules it enforces
- Send greyed out with no error? Usually a header↔line
Workflow - Table Relationon a document that can have zero lines. The engine treats an empty related table as “condition not met”. - Never hand-build bare template steps. Without an approver argument and the two conditioned approve branches, sends find no approver or release on the first approval.
- Buttons silent after a send? A notification response stuck in Processing makes the engine queue every later event against a dead session. The Skill ships a repair procedure.
- Never rename the
Run…Code()event literals on a live environment. Existing step instances reference the old codes. - Deleting an outdated template: clear
Template := falsefirst, or the publish fails with “You cannot delete a workflow template.”
Changelog
| Version | Date | Notes |
|---|---|---|
| 0.1.0 | 2026-11-23 | First public release |