Interface WorkflowAgentInvoker

All Known Implementing Classes:
WorkflowAgentInvokerImpl

public interface WorkflowAgentInvoker
SPI for invoking an AI agent from an <agent> node, bound by the AI module. With no binding, an <agent> node fails at runtime with a clear error.
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(String agentCode, String message, Map<String,Object> context, List<AgentOutputField> output)
    Runs agentCode with message and context (record model/id and workflow variables) and returns the agent's text answer.
    default String
    validateAgent(String agentCode)
    Checks at save time that agentCode names an enabled, invokable agent that is neither internal nor a template.
  • Method Details

    • invoke

      String invoke(String agentCode, String message, Map<String,Object> context, List<AgentOutputField> output)
      Runs agentCode with message and context (record model/id and workflow variables) and returns the agent's text answer.

      output is the declared answer shape, empty when none, and is already described in message; an implementation may also constrain generation with it.

    • validateAgent

      default String validateAgent(String agentCode)
      Checks at save time that agentCode names an enabled, invokable agent that is neither internal nor a template. Returns null when usable, else a short reason; the default accepts any.