Portal Community

Two Integration Directions

Agents → Workflows

An Octopus agent calls the start_workflow MCP tool to trigger any Flow Studio process by name. The agent can wait for the result or fire-and-forget.

Workflows → Agents

A Flow Studio workflow uses the AI Agent Node to call an Octopus agent with a prompt. The agent's text response becomes the node's output, feeding into subsequent workflow nodes.

AI Agent Node in Flow Studio

The AI Agent Node is a standard Flow Studio execution node that calls Octopus. It appears in the node palette under the "AI" category:

// AIAgentNodeExecutor — the backend for the AI Agent Node
public class AIAgentNodeExecutor : BaseNodeExecutor
{
    public override async Task<NodeExecutionResult> ExecuteAsync(
        NodeExecutionContext context)
    {
        var agentId = context.GetInput<Guid>("agentId");
        var prompt = context.GetInput<string>("prompt");
        var sessionId = context.GetInput<string>("sessionId", Guid.NewGuid().ToString());

        // Call Octopus agent
        var response = await _octopusClient.ChatAsync(new OctopusRequest
        {
            AgentId = agentId,
            SessionId = sessionId,
            Message = prompt,
            TenantId = context.TenantId
        });

        return NodeExecutionResult.Success(new
        {
            response = response.Content,
            toolCalls = response.ToolCalls,
            sessionId = sessionId
        });
    }
}

Agent Triggers a Workflow

With the Process plugin enabled, an agent can call the start_workflow tool:

// Tool definition exposed by the Process plugin:
// Tool name: start_workflow
// Input schema:
{
  "processName": "string",      // the Flow Studio process name
  "input": "object",            // JSON data passed as workflow input
  "waitForResult": "boolean",   // true = synchronous, false = fire-and-forget
  "timeoutSeconds": "integer"   // max wait time if synchronous
}

// Example agent conversation:
// User: "Please onboard the new vendor Acme Corp with contract #12345"
// Agent decides to call start_workflow:
// → start_workflow({ processName: "VendorOnboarding", input: { vendor: "Acme Corp", contract: "12345" }, waitForResult: true })
// → Workflow runs, returns { vendorId: "V-9912", status: "Onboarded" }
// → Agent: "Acme Corp has been successfully onboarded as vendor V-9912."

Agent as HIL Actor

An Octopus agent can be assigned as an automated responder to Human-In-the-Loop tasks in WorkDesk. Instead of a human reviewing the task, the agent reviews the data and responds:

// HIL task routing: when a task is assigned to an "Octopus agent actor":
public class OctopusHILActor : IHILActor
{
    public async Task<HILResponse> RespondAsync(HILTask task)
    {
        // Build a prompt from the HIL task data
        var prompt = $"Review this approval request: {JsonSerializer.Serialize(task.Data)}. " +
                     $"Based on the policy, approve or reject with a reason.";

        var response = await _octopusClient.ChatAsync(new OctopusRequest
        {
            AgentId = _approvalAgentId,
            Message = prompt,
            TenantId = task.TenantId
        });

        // Parse agent's structured response
        return ParseApprovalDecision(response.Content);
    }
}

The AI Function Node

A lighter alternative to the AI Agent Node: the AI Function Node calls Octopus to generate and execute code for a specific computation, without maintaining a conversation session:

FeatureAI Agent NodeAI Function Node
Session / memoryFull conversation contextStateless — no session
Tool useYes — all agent toolsNo — code only
Use caseReasoning, multi-step decisionsData transformation, calculation
LatencyHigher (memory retrieval)Lower (direct generation)