xFlow
  • Overview
    • Introduction
    • Core Features
    • Architecture
      • High Level Architecture
      • Tech Stack
      • Deployment Flexibility
      • Performance and Scalability
      • Security Compliance
  • Getting Started
    • Installation
    • Quick Start
    • Configuration
  • Core Concepts
    • Serverless Workflow Specification
    • Workflow data handling
    • Workflow Expressions
    • Error handling
    • Input and Output schema definition
    • User Task
    • User Forms
      • Lowcode Form
      • Advanced User Form
    • AI Agents in Enterprise Business Processes
    • Comparisons
      • BPMN2
  • Developer Guide
    • Architecture
    • API Reference
    • Workflow States Reference
      • Event State
      • Operation State
      • Switch State
      • Parallel State
      • Inject State
      • ForEach State
      • Callback State
      • UserTask State
      • AIAgent State
      • AIAgentProxy State
      • UserProxyAgent State
      • AI Outbound Agent State
    • Workflow Functions
      • REST
      • GraphQL
      • Custom
        • Built-in Functions
        • Lowcoder Query Function
      • Function Auth
    • Workflow Secrets
    • Integrations
    • Workflow Modeler
    • Frontend Development
      • Forms
        • Lowcode Form
        • Advanced User Form
    • Serverless Workflow Development
      • Operation State
      • Switch State
      • Parallel State
      • ForEach State
      • Callback State
      • User Task State
    • AI Agent Development
      • AI Agent
        • Predefined LLM
        • LLM Configuration
        • Multi LLM Configuration
        • Chat Memory
        • Tools
        • Data Output
        • Agent Outcomes
      • AI Agent Proxy
        • AI Agents Integration
      • User Proxy Agent
      • xChatBot Integration
  • Examples
    • Basic Examples
    • Advanced Examples
      • Loan Approval Workflow
      • QMS AP Workflow
  • Administration
    • Monitoring and Logging
    • Security
    • Performance Tuning
  • Extensions and Customizations
    • Plugins and Add-ons
  • Troubleshooting
    • Common Issues
    • FAQs
  • Release Notes
    • Version History
    • Upcoming Features
  • Support
    • Contact Information
    • Community
Powered by GitBook
On this page
  • AIAgentProxyState
  • OnAgentOutcome
  • AgentProxyExecution
  1. Developer Guide
  2. Workflow States Reference

AIAgentProxy State

The AIAgentProxyState is used to define an AI Agent Proxy state within a serverless workflow. This state facilitates interaction with an AI agent, allowing for user messages, system prompts, and agent outcomes to be managed within a workflow.

AIAgentProxyState

The AIAgentProxyState is a specialized state in a serverless workflow designed to integrate AI agents developed by any AI framework. The state defines the agent's configuration, including the integration details, possible outcomes, and other properties.

Parameter

Description

Type

Required

agentName

The name of the agent.

string

yes

systemMessage

The system message used to construct the LLM prompt.

string

no

userMessage

The user message.

string

yes

memoryId

The memory ID to store the agent history. If not specified, the workflow process instance scope is used.

string

no

array

yes

Agent proxy execution described by the AgentProxyExecution schema.

object

yes

Filter to apply to the state data.

string

no

OnAgentOutcome

The OnAgentOutcome object defines the actions to be performed based on the outcome of the AI agent. The actions are executed if the outcome matches the specified conditions.

Field

Description

Type

Required

condition

Expression, if defined, must evaluate to true for this outcome to be matched. If false, the outcome is disregarded.

string

no

finish

If true, the agent will finish after this action is executed. If false, the agent will continue to process.

boolean

no

object

no

The outgoing transition when the outcome is selected, if not defined the default transition will be used.

object

no

AgentProxyExecution

Field

Description

Type

Required

References a reusable function definition to be invoked

object

yes

Example:

YAML

This document provides a detailed view of the AIAgentProxyState state and its related objects, including comprehensive schema definitions, required fields, and descriptions for each attribute within the AIAgentProxyState and associated schemas. This specification ensures clarity and completeness for integrating AI agents within serverless workflows.

PreviousAIAgent StateNextUserProxyAgent State

Last updated 11 months ago

Define list of agent outcomes. Each outcome is described by the schema.

Event data filter described by the schema.

The AgentProxyExecution object specifies how the AI Agent are to be invoked by the AI Agent Proxy. The function will be executed and provided with 3 arguments: workflowId, agentConfig, and agentContext. (See )

states:
  - name: RagAgentProxy
    agentName: RagAgentProxy
    type: aiagentproxy
    systemMessage: You are a helpful assistant
    userMessage: '${ .request.question }'
    execution:
      functionRef:
        refName: "ExecuteRagAgentProxy"
    agentOutcomes:
    - condition: '${ true }'
      finish: true
      transition: InformRagAgentProxyResult
  - name: InformRagAgentProxyResult
    agentName: InformRagAgentProxyResult
    type: userproxyagent
    agentRole: relay
    userMessage: '${ .request.question }'
    relayMessage:
      text: ${ ._ai_agent_state.RagAgentProxy.agentOutcome.finish.output.message }
      mediaExp: ${ ._ai_agent_state.RagAgentProxy.agentOutcome.finish.output.images }
    output: |-
      {
          "type": "object",
          "properties": {
              "answer": {
                  "type": "string"
              }
          },
          "required": ["answer"]
      }
    agentOutcomes:
    - condition: '${ true }'
      finish: true
      transition: Finish
functions:
  - name: ExecuteRagAgentProxy
    type: custom
    operation: ExecuteQueryAction
    metadata:
      libraryQueryName: post.rag_agent_proxy
      libraryQueryRecordId: latest
      params: '["workflowId", "agentConfig", "agentContext"]'
AI Agent Proxy Integration
dataFilter
dataFilter
EventDataFilter
transition
functionRef
agentOutcomes
OnAgentOutcome
execution