copilot-agentic-business-process / business-process-api
AGENTS.md1 starsChanged 52 days agoMITView on GitHub
C# plug-in that implements the faf001_* Custom Actions behind the Workflow Console and the monitoring agent. The public contract is README.md; the build, test, and registration procedure is DEVELOPMENT.md. Read both before changing behavior. A business process should almost never need to change this project. Process flows write the core tables directly through the Dataverse connector. Change the API only for process-agnostic capability the user has agreed to add to the core. - Target framework net462 (Dataverse sandbox) — no…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- business-processes/AGENTS.mdAGENTS.md
- business-processes/order-processing/AGENTS.mdAGENTS.md
- core/AGENTS.mdAGENTS.md
- core/codeapps/workflow-console/AGENTS.mdAGENTS.md
- evaluate-order-discounts-promotionsSkill
- validate-order-product-identitySkill
- validate-order-product-availabilitySkill
- sap-order-jsonSkill
- sap-order-excelSkill
- deploy-business-process-coreSkill
- deploy-order-processingSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Not strong-name signed. Output is a NuGet plug-in package (business-process-api), registered as a package, never as a standalone DLL.
- Very specific: line 39
Never pass -Apply without the user confirming the target environment and organization ID.
- Distinctive: line 92
Do not embed environment URLs, organization IDs, package IDs, or solution IDs in source or scripts — pass them as parameters.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
AGENTS.md — Business Process API (Dataverse plug-in)
C# plug-in that implements the faf001_* Custom Actions behind the Workflow Console and
the monitoring agent. The public contract is README.md; the build, test, and
registration procedure is DEVELOPMENT.md. Read both before changing
behavior.
A business process should almost never need to change this project. Process flows write the core tables directly through the Dataverse connector. Change the API only for process-agnostic capability the user has agreed to add to the core.
Toolchain
- Target framework
net462(Dataverse sandbox) — no APIs or packages beyond .NET Framework 4.6.2. SDK pinned by global.json (.NET 10 feature band). - Windows with the .NET Framework 4.8 runtime is required to run the unit tests.
- Packages are pinned with lock files: always restore with
--locked-mode. If you intentionally change a package version, regenerate and commit the affectedpackages.lock.json. Do not add new dependencies without the user's agreement — the plug-in package ships to the Dataverse sandbox. - Not strong-name signed. Output is a NuGet plug-in package (
business-process-api), registered as a package, never as a standalone DLL.
Commands (run from this folder)
dotnet restore business-process-api.sln --locked-mode
dotnet build business-process-api.sln --configuration Release --no-restore
dotnet test tests/BusinessProcessApi.Tests/BusinessProcessApi.Tests.csproj --configuration Release --no-restore # offline unit tests
dotnet test business-process-api.sln --configuration Release --no-restore # all; integration tests skip by default
pwsh -NoProfile -File scripts/build-package.ps1 # verified .nupkg in artifacts/packageIntegration tests (tests/BusinessProcessApi.IntegrationTests, Category=Integration)
are read-only but hit a real environment: run them only when the user asks and supplies
a non-production environment (see DEVELOPMENT.md for the required environment variables).
scripts/register-business-process-api.ps1 is a dry run unless -Apply is passed.
Never pass -Apply without the user confirming the target environment and organization ID.
Layout
| Path | Responsibility |
src/BusinessProcessApi/Api/ | One stateless entry point per Custom Action (<Name>Plugin.cs), deriving from Infrastructure/Execution/CustomApiPluginBase |
src/BusinessProcessApi/Services/ | Validation, authorization, visibility, submission parsing (WidgetSubmission.cs), business behavior |
src/BusinessProcessApi/Repositories/ | Dataverse queries and persistence (Dataverse*Repository.cs, interfaces I*Repository) |
src/BusinessProcessApi/Infrastructure/ | Execution base class, continuation-token codec |
spec/<uniquename>.json | Custom API provisioning contract; pluginTypeName binds it to the class |
tests/BusinessProcessApi.Tests/ | xUnit + Moq offline tests, incl. ApiMetadataTests that check spec/ against entry points and Fixtures/Metadata/ choice XML |
tests/BusinessProcessApi.IntegrationTests/ | Opt-in read-only tests against an installed API |
Invariants — do not break
- Run as the caller.
CustomApiPluginBasecreates the organization service forcontext.UserId; Dataverse row, column, and table security stay authoritative. Never elevate to SYSTEM to work around a privilege failure. - Registration shape. Main operation (stage 30), synchronous (mode 0); the base class rejects anything else.
- Transactional completion.
faf001_CompleteTaskrequires the ambient synchronous transaction; any failure must propagate so all writes roll back. Do not wrap it inExecuteMultiple,ExecuteTransaction, orTransactionScope. - Optimistic concurrency. Task, step, and output writes use row-version checks
(
IfRowVersionMatches); conflicts surface as explicit errors, never silent overwrites. - Opaque continuation tokens bound to action, caller, organization, filters, and page size; reject tokens whose binding does not match.
- Errors are
InvalidPluginExecutionExceptionwith a clear message; never return a partial response. - No instance state. Dataverse caches plug-in instances — keep per-call state in local variables.
- Submission contract (outcome, notes,
values[], output-key prefix = widget ID minus-ui, reserveddecision/notes) is consumed by every process flow. Treat it as a public API: extend compatibly, never change existing semantics.
Adding or changing a Custom Action
Change all of these together:
src/BusinessProcessApi/Api/<Name>Plugin.cs+ service/repository logic.spec/faf001_<Name>.json(same name asuniquename, withpluginTypeName).core/solution/export/customapis/faf001_<Name>/—customapi.xml,customapirequestparameters/<param>/customapirequestparameter.xml,customapiresponseproperties/<prop>/customapiresponseproperty.xml.- Unit tests, including the
ApiMetadataTestsdata rows for the new contract. - README.md action index and contract section.
- Console consumers if any (
src/features/*/…-api-contracts.ts; register generated bindings withnpx --no-install pa app add dataverse-api --api-name faf001_<Name>). - Rebuild the package and refresh
core/solution/export/pluginpackages/faf001_business-process-api/package/*.nupkg, then repack the core solution (root AGENTS.md).
Do not embed environment URLs, organization IDs, package IDs, or solution IDs in source or scripts — pass them as parameters.
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.

