Portal Community

appsettings.json Configuration

{
  "ProcessPlugin": {
    "ProcessServerUrl":        "https://processserver.internal.company.com",
    "ApiKeyCredentialId":      20,
    "TimeoutSeconds":          60,
    "SyncTimeoutSeconds":      120,
    "MaxRetries":              3,

    "WorkflowAccessPolicy": {
      "Mode":           "Allowlist",
      "AllowedWorkflows": [
        "leave-approval-workflow",
        "purchase-request-workflow",
        "it-ticket-workflow"
      ]
    },

    "HILActor": {
      "Enabled":      true,
      "AgentId":      "approval-agent",
      "QueuePollMs":  5000
    }
  }
}

Configuration Properties

PropertyTypeDescription
ProcessServerUrlstringBase URL of the Flow Studio ProcessServer
ApiKeyCredentialIdintCredential ID for the ProcessServer API key
TimeoutSecondsintTimeout for individual HTTP calls to ProcessServer
SyncTimeoutSecondsintMax seconds to wait for synchronous workflow completion
WorkflowAccessPolicy.ModestringAllowlist or Open — which workflows agents may trigger
WorkflowAccessPolicy.AllowedWorkflowsstring[]Workflow IDs that agents are permitted to start
HILActor.EnabledboolWhether this Octopus instance acts as a HIL actor for ProcessServer
HILActor.AgentIdstringWhich Octopus agent handles automated HIL tasks

OnStartAsync

public async Task OnStartAsync(IServiceProvider sp, CancellationToken ct)
{
    var config = sp.GetRequiredService<IOptions<ProcessPluginConfig>>().Value;
    var creds  = sp.GetRequiredService<ICredentialResolver>();
    var apiKey = await creds.GetPasswordAsync(config.ApiKeyCredentialId);

    // Configure the ProcessServer HTTP client
    var clientFactory = sp.GetRequiredService<IHttpClientFactory>();
    // (Client configured via named client registered in OnRegister)

    // Register the start_workflow MCP tool
    var registry = sp.GetRequiredService<MCPToolRegistry>();
    registry.Register(new MCPTool
    {
        Schema  = StartWorkflowToolDefinition,
        Handler = async (input, ctx, token) =>
        {
            using var scope    = sp.CreateScope();
            var triggerService = scope.ServiceProvider.GetRequiredService<IWorkflowTriggerService>();
            return await triggerService.HandleStartWorkflowAsync(input, ctx, token);
        }
    });

    // Start HIL actor polling if enabled
    if (config.HILActor.Enabled)
    {
        var hilActor = sp.GetRequiredService<IOctopusHILActor>();
        await hilActor.StartPollingAsync(ct);
    }
}