Skip to content
Art2link ESB HomeDocumentationBlogContact
Updated August 2, 2026
AI Accelerator/Custom function

AI Accelerator, Custom function

Describe the function you need in the Accelerator chat and it writes the C# method body and the [CustomFunction] attribute, ready to save into the Custom Functions UI.

Custom functions look simple but they’re sensitive to two kinds of detail the Accelerator can’t infer: the exact signature the call sites expect, and any external dependencies (a database, a third-party API, a NuGet package) the function will reach out to. Both are worth putting in the prompt, because a function with the wrong signature does not fit its call site and a function that quietly hardcodes a connection string is not one you can promote between environments.

WORTH PUTTING IN THE PROMPTName + signatureBehaviour + edge casesExternal dependenciesCall siteAI Acceleratorfree-form chatC# method[CustomFunction]You reviewand save
A complete custom function, the C# method body, the [CustomFunction("fnX")] attribute, the parameter and return types, any required using statements, ready to save into the Custom Functions UI. The result is reviewed and saved by you; the Accelerator does not deploy it.

None of the following is required. A one-line request still gets you a function. These are the facts the Accelerator cannot infer, so each one you include is one it does not have to guess:

  • The function name, the [CustomFunction] token callers will reference.
  • The parameters, name, type, and what each one represents.
  • The return type, and what an empty / null / error result should look like.
  • The behaviour, described in plain language, including edge cases.
  • Any external dependencies, database connection, HTTP endpoint, NuGet package, and how they should be configured (parameter vs. constant).
  • Where the function will be called from, map, port property, pipeline component property, or routing expression, so the Accelerator can shape error handling appropriately for the call site.

The C# itself you can leave to it. Spend the prompt on the contract and the dependencies.

A request like this states all of it and gets the function back in one pass. Note the null-result behaviour and the call site, both stated rather than left open:

PROMPT
Write a custom function named LookupWarehouseCode that takes one string parameter, a plant id, and returns the matching warehouse code as a string. Read it from the WarehouseMap table on the OpsDb SQL connection, and return an empty string when no row matches. Expose the connection string as a parameter rather than hardcoding it. It will be called from a map binding.
Because it is one open chat, you can go wider than a single function in the same conversation: ask it to generate a custom function and the map that calls it together, so the binding token and the signature agree, or talk through naming and design before any code is generated. If the first draft has the wrong signature or swallows an error you wanted surfaced, say so in the next message.
⚠️
The generated function still needs review. Things the Accelerator can’t verify on your behalf: that a connection string actually reaches the target database from the runtime, that a NuGet package version is the one already in the platform catalogue, that the error-handling path returns a value any caller can safely consume. Treat the output as a first draft and exercise it with representative inputs before relying on it in production.