Octopus
Enabling the Plugin
The ProcessPlugin requires connection details for the Flow Studio ProcessServer. The API key for ProcessServer communication is resolved via ICredentialResolver.
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
| Property | Type | Description |
|---|---|---|
ProcessServerUrl | string | Base URL of the Flow Studio ProcessServer |
ApiKeyCredentialId | int | Credential ID for the ProcessServer API key |
TimeoutSeconds | int | Timeout for individual HTTP calls to ProcessServer |
SyncTimeoutSeconds | int | Max seconds to wait for synchronous workflow completion |
WorkflowAccessPolicy.Mode | string | Allowlist or Open — which workflows agents may trigger |
WorkflowAccessPolicy.AllowedWorkflows | string[] | Workflow IDs that agents are permitted to start |
HILActor.Enabled | bool | Whether this Octopus instance acts as a HIL actor for ProcessServer |
HILActor.AgentId | string | Which 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);
}
}