Building Complex Business Agent Assistants with Workflow
In SERVICEME NEXT, Agents created using the basic method are more suitable for simple Q&A scenarios and have relatively limited functionality. To handle more complex business logic or implement multi-step operations, you can build advanced Agents using Workflow, meeting richer business requirements.
This section will demonstrate, through a concrete example, how to use Workflow to build a complex process.
Scenario Example: Sensitive Word Extraction from Contract Content
In real business scenarios, contract texts are usually lengthy and complex. Manually checking each clause to identify whether sensitive words are present is time-consuming, labor-intensive, and prone to omissions, especially when the number of sensitive words is large, making accuracy even harder to guarantee.
With Workflow capabilities, you can build an intelligent Agent that supports file upload, content parsing, sensitive word recognition, and annotation.
Through this process, users can quickly understand sensitive information in contracts without manual review, greatly improving audit efficiency and accuracy.
✅ Tip: This type of Agent is especially suitable for scenarios such as legal review, content audit, and compliance management.
Preparing the Sensitive Word Data Source
Before building the workflow, you need to prepare the sensitive word data. In this case, sensitive words are stored in a database, so you need to add the database as a data source through the Data module and complete data synchronization.
Prerequisites for Data Preparation
- Sensitive word data has been written into the database (table name:
SensitiveWords). - The database type is
SQLServerand is accessible via the network.

Steps to Add Data Source
- Enter the Data Module
- Open the SERVICEME platform and click “Data” in the left navigation bar.
- Select “Data Source” to enter the data source management page.

- Add Data Source
- Click the “Add Data Source” button in the upper right corner.
- Fill in the following information in the pop-up configuration window:
- Data Source Name: e.g.,
Sensitive Word - Database Type: Select
SQLServer - Connection Information: Includes
host,port,username,password,database name
- Data Source Name: e.g.,
- Click “Test Connection”. After confirming the connection is successful, click “Confirm” to complete the addition.

- Select Data Table
- Return to the data source list and click the newly created data source item.
- The system will display available data tables in the database. Check the table containing sensitive words (e.g.,
SensitiveWords) and click “Confirm” to add.

- Data Catalog Synchronization
- In the left menu, select “Data Catalog”, find and click the
Sensitive Worddata source. - Execute the “Sync” operation to ensure the platform obtains the latest data.
- In the left menu, select “Data Catalog”, find and click the

After completing the above steps, the sensitive word data source is configured. In the subsequent workflow, you can access this data table via nodes to extract and compare sensitive words from contract content.
Creating the “Sensitive Word Extraction” Agent via Workflow
- Go to the SERVICEME NEXT homepage, click AI Studio in the left navigation bar to enter the Agent interface.
- Click the “Create Assistant” button in the upper right corner and select “Advanced Orchestration Creation”.
- Fill in the following basic information:
- Assistant Name: Enter
Sensitive Word Extraction - Agent Avatar: Select one from the built-in avatars (custom upload is not supported currently)
- Category: Select the business category, e.g.,
Legal and Compliance - Description: For example,
Sensitive Word Extraction
- Assistant Name: Enter
- After completing the information, click “Create” to successfully generate the workflow Agent.

Configuring the “Sensitive Word Extraction” Agent
📌 Workflow Planning
The core goal of this workflow is: to enable the Agent to automatically identify sensitive words present in contract files uploaded by users. To achieve this, we need to guide users to upload contract files and parse their content into processable text; meanwhile, load sensitive word data from the configured database, and use the model to intelligently compare contract content with sensitive words, identifying matches and their positions. Finally, the model outputs the recognition results and returns them to the user. The entire process covers key steps such as file processing, data source invocation, model recognition, and result output, suitable for automated text review business scenarios.
📌 Node Configuration and Connection Instructions
In this Workflow example, each node's input and output are configured by referencing the result of the previous node. To achieve sensitive word extraction, the process mainly involves the following nodes: Start Node, File Processing Node, Data Source Node, Model Node, and End Node. Below is a step-by-step explanation of each node's configuration and connection.
Configuration Process
- Start Node Input Instructions
The Start Node can select two inputs:
USER_FILE: The file uploaded by the user in this round.USER_IMAGES: The images uploaded by the user in this round.
These inputs will be referenced by subsequent nodes for file processing and model recognition.

- File Processing Node Configuration
This node is responsible for processing the contract file uploaded by the user, including text extraction, slicing, and vectorization.
Configuration steps:
- Add a File Processing Node to the canvas.
- Connect the Start Node to the File Processing Node.
- Click the File Processing Node to enter the configuration interface and set the following:
- Input Reference: Set
USER_INPUTas a reference, format:
Start/USER_INPUT - File Reference: Click "Add File" and select
USER_FILE(the contract file uploaded by the user) - TopK Setting: Choose an appropriate TopK (e.g., 3~5).
- TopK indicates the maximum number of text segments returned by the model during text vector matching.
- Suggestion: Too low a TopK may miss key content, too high may affect the model's focus.
- Input Reference: Set

- Data Source Node Configuration
This node is used to introduce the previously created sensitive word data table for subsequent comparison.
Configuration steps:
- Add a Data Source Node to the canvas and connect it to the Start Node.
- Click the node and configure the data source information:
- Select data source:
Sensitive Word - Input reference configuration:
Start/USER_INPUT(user's input command)
- Select data source:
The output of this node is the sensitive word list needed by the model.

- Model Node Configuration
This node is the core processing module of the workflow, responsible for intelligently comparing contract text with sensitive words and returning the results.
Configuration steps:
- Add a Model Node and connect it to both the File Processing Node and the Data Source Node.
- Model selection:
gpt-4.1 - Tool selection: No external tools needed for this scenario, can be skipped.
- Add MCP: No MCP needed for this scenario, can be skipped.
- Input references:
input: Reference the output of the File Processing Node, format:
FileHandler/outputparam2: Reference the output of the Data Source Node, format:
DataSource/output
- Prompt configuration:
- System Prompt:
Analyze the file in {{input}} and compare it with the sensitive words in {{param2}}. If there are sensitive words in the file, output the sensitive words along with their positions. - User Prompt:
Analyze the file in {{input}} and compare it with the sensitive words in {{param2}}. If there are sensitive words in the file, output the sensitive words along with their positions.
- System Prompt:
✅ Tip: The system prompt provides behavioral instructions to the model, while the user prompt simulates actual user input. Here, both are the same for more stable results.

- Output Node Configuration
This node is used to return the model's processing results to the end user.
Configuration steps:
- Connect the Model Node to the End Node.
- Click the End Node and set the input reference:
- Input content: Reference the output of the Model Node, format:
Model/output
- Input content: Reference the output of the Model Node, format:
- Fill in the output content configuration:
{{output}}
✅ Tip: Only filling in
{{output}}as the output at the end can better preserve the model's output. If needed, you can also specify the output of specific content.

The complete configuration is as follows:

How to Use the “Sensitive Word Extraction” Agent Assistant
- The user uploads the contract file in the chat interface.
- The Agent automatically parses the text and accurately detects sensitive words within it.
- The system returns the sensitive words and their positions.
- Through this process, users can quickly understand sensitive information in contracts without manual review, greatly improving audit efficiency and accuracy.