Microsoft Dynamics Business Central v2

Microsoft Dynamics 365 Business Central is an ERP platform for managing finance, sales, purchasing, inventory, projects, and other day-to-day business operations through a standard application and API surface.

The Flowgear Microsoft Dynamics Business Central Node lets you query Business Central entity sets and create or update records from a Workflow. Use it when you want Flowgear to read operational data or push business changes into Business Central through the public API.

Revision History

0.0.0.1 - Initial release.
0.0.0.4 - Template changes.
0.0.0.10 - Added test cases.
0.0.0.13 - Node name correction.
0.0.0.15 - Maintenance release.
0.1.0.0 - Added eager startup and lazy continuation for streamed invokes.
0.1.0.2 - Removed query paging controls from templates and kept continuation paging inside the Node.
0.1.0.3 - Maintenance release.
0.1.0.7 - Generated templates from metadata acquired on the Connection, added custom API support and the optional MetadataUrl property, and renamed Connection properties to PascalCase.

Connection

Property Type Description
TenantId String The Azure Active Directory tenant ID used to issue OAuth tokens.
ClientId String The client ID from the Azure App Registration.
ClientSecret Masked The client secret from the Azure App Registration.
AccessToken Masked OAuth access token returned after delegated authorization.
RefreshToken Masked OAuth refresh token used to renew delegated access.
Scopes String The OAuth scopes requested during authorization. The default is offline_access https://api.businesscentral.dynamics.com/.default.
EnvironmentUrl String The Business Central API root URL, for example https://api.businesscentral.dynamics.com/v2.0/tenant/environment/api/v2.0. For a custom API, use https://api.businesscentral.dynamics.com/v2.0/<tenant>/<environment>/api/<publisher>/<group>/<version>. The URL must use HTTPS.
MetadataUrl String Optional location of the OData metadata document, as a path relative to EnvironmentUrl or an absolute HTTPS URL on the same origin. Leave blank to use $metadata under EnvironmentUrl.
DefaultCompanyId String Optional default company ID used when requests do not include CompanyId.

Setup Notes

  1. Register an application in Entra ID with the Business Central permissions required for your scenario.
  2. Grant admin consent for the selected permissions, or ensure the signed-in user has consented.
  3. In Business Central, register the same application so the environment accepts the OAuth client.
  4. Configure the Flowgear Connection with TenantId, ClientId, ClientSecret, Scopes, EnvironmentUrl, and DefaultCompanyId if you want a default company to be applied automatically.
  5. Authorize the Connection so that AccessToken and RefreshToken are populated, then test it.
  6. Run Acquire Metadata on the Connection before selecting templates. Templates are generated from the acquired metadata, so run it again after changing TenantId, EnvironmentUrl or MetadataUrl, or after API changes are deployed, and then refresh the Workflow templates. Changing DefaultCompanyId does not require acquiring metadata again.

Methods

Query

Parameter Type Description
Connection Connection The connection profile used for Business Central API calls.
EntitySet String The Business Central entity set to query, for example customers.
Options Object A query object with optional CompanyId, Select, Filter, and OrderBy settings.
Return Type Description
Response Array The Business Central rows returned by the query.

Create

Parameter Type Description
Connection Connection The connection profile used for Business Central API calls.
EntitySet String The Business Central entity set to create records in, for example items.
Options Object A mutation object with an optional CompanyId.
Items Array A stream of payload objects to create in the target entity set.
Return Type Description
Response Array The provider payload returned for each created record.
Flowgear Object Default mutation fields containing IsSuccess, Message and Request, a copy of the original Items input.

Update

Parameter Type Description
Connection Connection The connection profile used for Business Central API calls.
EntitySet String The Business Central entity set to update records in, for example items.
Options Object A mutation object with optional CompanyId and Id values. When Id is omitted, the Node uses the id value on each item.
Items Array A stream of payload objects to update in the target entity set.
Return Type Description
Response Array The provider payload returned for each updated record.
Flowgear Object Default mutation fields containing IsSuccess, Message and Request, a copy of the original Items input.

Usage Notes

  • Query methods do not append default mutation fields to returned rows.
  • If a query returns no matching records, the Node emits zero rows.
  • If the first provider query call fails, the provider error surfaces to the Workflow instead of being converted into an empty success result.
  • Query templates omit Top. The Node determines the provider page size, ignores stale saved Top values, and follows continuation links internally.
  • Query retrieves its first provider page while the Node invoke is awaited. It retrieves continuation pages only as the Workflow consumes rows.
  • Create and Update execute the first input item while the Node invoke is awaited, then process later items as the Workflow consumes results. Empty Items input emits zero rows and does not send a provider mutation.
  • Create and Update preserve the provider payload at the root and add Flowgear mutation metadata under Flowgear. Each row, including failed rows, echoes its original Items input under Flowgear.Request.
  • CompanyId must be supplied in Options or through the Connection's DefaultCompanyId.
  • Templates are generated from the metadata acquired on the Connection, including custom API entity sets and fields. Only direct collections under companies are available; nested navigation routes, media streams and actions are not supported. Read-only, computed and immutable fields are omitted where the metadata restricts them, but Business Central validation still applies.
  • Template sample values are illustrative and are not sent as defaults. Select has a sample but no default, so a query returns all exposed fields unless you supply a selection.
  • String and numeric scalar collections are bound as CSV values. Quote values that contain commas, quotes or newlines, and double any embedded quotes. An unquoted \N represents a null element. Object collections keep their structured fields.
  • Connection properties use PascalCase names. If a saved Connection uses earlier labels such as Tenant ID, Client Secret, Environment URL or Default Company ID, re-enter the values under the new property names, acquire metadata and refresh the Workflow templates.