Portal Community

Steps to Register a Custom Service

  1. Implement IBusinessServiceDefinition
  2. Register with DI as IBusinessServiceDefinition
  3. Store credentials via ICredentialResolver admin API
  4. 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.