Skip to main content
Version: 5.1

Creating an Agent

WSO2 Integrator supports the creation of AI agents as either Chat agents or Inline agents.

Chat agents​

Chat agents are AI agents exposed through HTTP REST APIs, allowing users or external systems to send prompts and receive responses powered by large language models (LLMs). You create a chat agent from the Chat Agent Service artifact.

Inline agents​

Inline agents can be embedded directly within integration flows, such as automations, REST APIs, GraphQL resolvers, or backend service logic, and are invoked programmatically as part of the flow.

Launching the Artifacts page​

  1. Open your integration project in WSO2 Integrator.
  2. On the Design tab, select + Add Artifact (or Add Artifact manually if the project is still empty).
Artifacts page in WSO2 Integrator showing all artifact categories: Automation, AI Integration (AI Chat Agent, MCP Service), Integration as API (HTTP Service, GraphQL Service Beta, TCP Service Beta), Event Integration (Kafka, RabbitMQ, MQTT, Azure Service Bus, Salesforce, Twilio, GitHub, Solace, CDC for Microsoft SQL Server, CDC for PostgreSQL).Artifacts page in WSO2 Integrator showing all artifact categories: Automation, AI Integration (AI Chat Agent, MCP Service), Integration as API (HTTP Service, GraphQL Service Beta, TCP Service Beta), Event Integration (Kafka, RabbitMQ, MQTT, Azure Service Bus, Salesforce, Twilio, GitHub, Solace, CDC for Microsoft SQL Server, CDC for PostgreSQL).

Create a chat agent​

Under AI Integration, select Chat Agent Service.

  1. Configure the agent's model, role, and instructions:

    FieldRequiredDescription
    RoleYesDefines the agent's primary function, for example Customer Support Assistant.
    InstructionsYesDetailed instructions for the agent.
    ModelYesThe model used by the agent. Select an existing model provider connection, or select Create New Model Provider.
    Maximum IterationsNoThe maximum number of reasoning-action cycles the agent performs to complete a task. Defaults to INFER_TOOL_COUNT, which resolves to max(number of tools, 10).
    VerboseNoWhether verbose logging is enabled. Defaults to false.
    Tool Loading StrategyNoHow tool schemas are loaded into the agent. Defaults to NO_FILTER, which loads all tools without filtering.
    Execute Tool Calls In ParallelNoWhether multiple tool calls returned in a single LLM response are executed concurrently or sequentially. Defaults to true.
    The empty Create Chat Agent Service form with Role, Instructions, Model, and Maximum Iterations fields.The empty Create Chat Agent Service form with Role, Instructions, Model, and Maximum Iterations fields.
  2. Fill in Role, Instructions, and leave Model as the Default WSO2 Model Provider.

    The Create Chat Agent Service form filled in with Role set to Blog Reviewer, Instructions filled in, and Model set to Default WSO2 Model Provider.The Create Chat Agent Service form filled in with Role set to Blog Reviewer, Instructions filled in, and Model set to Default WSO2 Model Provider.
  3. Scroll down under Advanced Configurations to set:

    FieldRequiredDescription
    Agent NameYesIdentifier for the agent, such as blogReviewer, supportAssistant, or salesAdvisor.
    Service Base PathYesThe path where this chat service is exposed, for example /blog-reviewer.
  4. Select Create.

    The bottom of the Create Chat Agent Service form with Agent Name set to blogReviewer and Service Base Path set to /blog-reviewer.The bottom of the Create Chat Agent Service form with Agent Name set to blogReviewer and Service Base Path set to /blog-reviewer.

WSO2 Integrator generates the required integration artifacts and displays a progress indicator while configuring the service listener and related components.

When it completes, WSO2 Integrator automatically generates the following:

  • An HTTP service with a POST /chat resource
  • A listener endpoint (chatAgentListener)
  • An AI agent, listed under Agents
  • A resource flow that invokes the agent and returns its response

The resource flow shows Start, an agent:run node bound to a result variable with an Open Agent link, then Return.

The chat resource flow showing Start, an agent:run node bound to stringResult with an Open Agent link to blogReviewer, then Return.The chat resource flow showing Start, an agent:run node bound to stringResult with an Open Agent link to blogReviewer, then Return.

Selecting Open Agent (or the agent under Agents in the sidebar) opens the agent's own canvas: a single AI Agent block showing the agent's name, an + Add Memory button, and a preview of its role and instructions, connected to its model provider.

The AI Agent canvas showing the AI Agent node with its name, an Add Memory button, a role and instructions preview, and a connection to the model provider.The AI Agent canvas showing the AI Agent node with its name, an Add Memory button, a role and instructions preview, and a connection to the model provider.

Create an inline agent​

You can add an inline agent within integration flows, such as automations, REST APIs, GraphQL resolvers, or backend service logic.

  1. Create or open an integration artifact that has a flow editor, for example an Automation.

  2. In the flow editor, select + to open the Add Node panel.

  3. Under AI, select Agent. "Create or reuse an Agent."

    Add Node panel with the AI section showing Direct LLM, RAG, and Agent options, with the Agent option highlighted and its tooltip visible.Add Node panel with the AI section showing Direct LLM, RAG, and Agent options, with the Agent option highlighted and its tooltip visible. The Add Node panel's AI section with the Agent option selected and its Create or reuse an Agent tooltip shown.The Add Node panel's AI section with the Agent option selected and its Create or reuse an Agent tooltip shown.
  4. The Agents panel lists any agents already defined in the project (for example, an agent created by a Chat Agent Service) as reusable options, plus a + button to add a new one.

    The Agents panel listing the existing blogReviewer agent as a reusable option, with a + button to add a new agent.The Agents panel listing the existing blogReviewer agent as a reusable option, with a + button to add a new agent.
  5. Select + to open the Add Agent dialog. It offers three ways to add an agent:

    OptionDescription
    Create AgentCreate a one-off agent instance for this integration only.
    Create Agent DefinitionCreate a reusable agent definition that can be shared and used to create agent instances with the same configuration across projects.
    Pre-built AgentsSelect from pre-built agents available at the project or organization level.
    The Add Agent dialog with Create Agent, Create Agent Definition, and an empty Pre-built Agents section.The Add Agent dialog with Create Agent, Create Agent Definition, and an empty Pre-built Agents section.
  6. Select Create Agent. This opens the same Role, Instructions, Model, and advanced configuration fields as the Chat Agent Service form (see Create a chat agent above), ending with an Agent Name field instead of a service base path.

    The empty Create Agent form with Role, Instructions, Model, and Maximum Iterations fields.The empty Create Agent form with Role, Instructions, Model, and Maximum Iterations fields.
  7. Fill in Role, Instructions, and Agent Name, then select Create Agent.

    The Create Agent form scrolled down to Verbose, Tool Loading Strategy, Execute Tool Calls In Parallel, and the Agent Name field.The Create Agent form scrolled down to Verbose, Tool Loading Strategy, Execute Tool Calls In Parallel, and the Agent Name field.

    This adds the new agent under Agents in the sidebar. Immediately after, WSO2 Integrator opens the AI Agent node configuration panel to bind this specific invocation of the agent in the flow:

    FieldRequiredDescription
    QueryYesA query to start a new turn (string/Prompt), or a Resume to continue a paused run.
    Session IDNoThe ID associated with the agent memory. Defaults to sessionId.
    ContextNoAdditional context that can be used during agent tool execution. Defaults to new().
    ResultYesName of the result variable.
  8. Set Query. If there's no existing input variable to bind, leave Query in Prompt mode and type a literal string, for example Summarize this: WSO2 Integrator is a low-code platform for building APIs, integrations, and AI agents. Leave Result at its default and select Save.

    The AI Agent node panel with Query set to a literal prompt string and Result set to stringResult.The AI Agent node panel with Query set to a literal prompt string and Result set to stringResult.

This adds an agent:run node to the flow, bound to the result variable, with an Open Agent link back to the new agent's own canvas, the same pattern as a Chat Agent Service's resource flow.

Flow editor showing the agent:run node bound to stringResult with an Open Agent link to taskSummarizer, between Start and Error Handler.Flow editor showing the agent:run node bound to stringResult with an Open Agent link to taskSummarizer, between Start and Error Handler.

Selecting Open Agent opens the agent's own canvas: an AI Agent block showing its name, an + Add Memory button, and a preview of its role and instructions.

The taskSummarizer AI Agent canvas showing its name, an Add Memory button, and a role and instructions preview.The taskSummarizer AI Agent canvas showing its name, an Add Memory button, and a role and instructions preview.

After creating either kind of agent, you can configure:

Configure agent behavior​

Use the AI Agent node configuration panel to customize how the agent behaves and responds to requests.

Click the AI Agent node to open the configuration panel and update the following configurations.

SectionDescription
RoleDefines the primary responsibility or persona of the agent.
InstructionsSpecifies the behavior guidelines and operational instructions that the agent should follow while responding.
Advanced ConfigurationProvides additional runtime and execution settings for the agent.
ResultDefines the output or response generated by the agent after execution.

Advanced configuration​

SectionDescription
Maximum IterationsDefines the maximum number of reasoning or execution cycles the agent can perform before returning a response.
VerboseEnables detailed execution logs and intermediate reasoning information for debugging and observability purposes.
Tool Loading StrategyDetermines how tools are discovered and loaded by the agent during execution.
Agent CredentialConfigures the credentials or authentication details used by the agent when accessing external systems or tools.
ContextDefines contextual information that is passed to the agent during execution.
Type DescriptorSpecifies the expected structure or type information for agent inputs and outputs.

What's next​

  • Tools - Add tools and integrations to the agent.
  • Memory - Configure conversational and persistent memory.
  • Observability - Monitor traces, logs, and execution details.
  • Evaluations - Test and evaluate agent behavior and response quality.