Flow Studio
Registering a Custom Business Service
Step-by-step guide to implementing IBusinessServiceDefinition and registering your own internal service for use in workflows.
Steps to Register a Custom Service
- Implement
IBusinessServiceDefinition - Register with DI as
IBusinessServiceDefinition - Store credentials via
ICredentialResolveradmin API - Service appears in the Flow Studio node config dropdown
Full Example
// InventoryServiceDefinition.cs
public class InventoryServiceDefinition : IBusinessServiceDefinition
{
public string ServiceId => "inventory-service";
public string DisplayName => "Inventory Service";
public string BaseUrl => "https://inventory.internal.acme.com";
public string ApiVersion => "v1";
public AuthType AuthType => AuthType.ApiKey;
public IReadOnlyList<ServiceOperation> Operations => new[]
{
new ServiceOperation
{
OperationId = "checkStock",
HttpMethod = "GET",
Path = "/api/v1/products/{sku}/stock",
OutputSchema = @"{
type: 'object',
properties: {
sku: { type: 'string' },
available: { type: 'integer' },
reserved: { type: 'integer' },
warehouseId: { type: 'string' }
}
}"
},
new ServiceOperation
{
OperationId = "reserveStock",
HttpMethod = "POST",
Path = "/api/v1/reservations",
InputSchema = @"{
required: ['sku', 'quantity', 'orderId'],
properties: {
sku: { type: 'string' },
quantity: { type: 'integer' },
orderId: { type: 'string' }
}
}"
}
};
}
// Program.cs / DI registration
services.AddSingleton<IBusinessServiceDefinition, InventoryServiceDefinition>();
Credential Setup
POST /api/credentials
{
"name": "inventory-service-api-key",
"type": "ApiKey",
"value": "inv_live_Abc123...",
"serviceId": "inventory-service"
}
Response: { "credentialId": 1087 }
The credentialId is referenced in the InventoryServiceDefinition (or via config) so the auth provider can resolve it at runtime.