Skip to main content

2.14.3. AI Scenarios and Their Tools

2.14.3.1. AI Scenario Tools

AI scenario tools are additional components that extend AI capabilities when working with documents. They provide the AI model with access to up-to-date information from the platform, enabling more informed decisions.


How it works: When the AI processes a document, scenario tools automatically pass additional data from the system to the model. This can include document statistics (count, types, statuses), document type settings, user information and their roles, or any other context from the platform.


To create an AI scenario tool:

  1. In the navigation panel, select the Studio 1 workspace.

  2. Select the AI Center 2 shortcut group, then select the AI Scenario Tools 3 shortcut.

  3. In the toolbar, select Create 4.

  4. Fill in the fields using the hints in the table below.

FieldDescription
Name*Enter the name of the tool that will be used in the scenario. Use a descriptive and precise name.
JSON Schema*Define the data structure that the tool will accept as input parameters. Insert the JSON schema function supported by your AI provider. You can review the schema in your AI provider's documentation:
For example, if the scenario you want to use this tool with works with the OpenAI provider, refer to the OpenAI function calling documentation and fill in only the "parameters" field schema.
Note:

Fields marked with "*" are required.

  1. Go to the Implementation 1 tab, then in the text field 2, write the code that the tool will execute when called. The code must comply with the defined input data schema.

  2. In the toolbar, select Save.

2.14.3.2. AI Scenarios

The AI Scenarios feature lets you predefine and configure algorithms for using artificial intelligence to solve specific business tasks. The platform includes a system scenario for each scenario type. These are suitable for most standard documents and require no additional configuration. However, for non-standard cases, you can create your own custom scenario. It is recommended to create a custom scenario based on a duplicate of the system scenario.

For example: AI scenarios for document recognition can include ready-made templates for different document types, enabling you to quickly configure the system for specific needs without building solutions from scratch.

2.14.3.2.1. Create an AI Scenario

  1. In the navigation panel, select the Studio 1 workspace.

  2. Select the AI Center 2 shortcut group, then select the AI Scenarios 3 shortcut.

  3. In the toolbar, select Create 4.

  4. In the General Settings tab, fill in the relevant fields using the hints in the table below:

FieldDescription
Name*Enter a short, clear name that describes the actions the scenario will perform. It will be shown in the scenario registry.
Scenario Type*Select one of the following scenario types from the list:

GeneralDesigned for creating universal scenarios not tied to specific system functionality. Use for custom data processing logic, specific business process configuration, or model experiments.
Example: Automatic analysis of customer feedback or classification of incoming requests.

Document SummarizationUse to create concise descriptions of large documents. (see section Document Summarization).
Example: Automatic generation of a short summary of contracts, reports, or other extensive documentation.

Document RecognitionUse to extract structured information from documents. The system scenario sys_doc_recognize is suitable for most standard documents and requires no additional configuration (see section AI Recognition. For documents with complex or non-standard structure, you can create a copy of the base project, add custom recognition rules, and configure prompt instructions for specific attributes (see section Custom AI Recognition).
Example: To recognize documents with printer information that have a non-uniform structure and different layouts, you can create a specialized project with additional rules. In the prompt instructions, you can specify conditional logic: "If the attribute equals printer, the model field may contain values from different sections of the document".

Document ActionAllows you to configure an AI scenario execution as a separate action in the document interface. The created scenario becomes available as an action button in the document card. This scenario must be activated separately for each document type in the AI Actions tab.
Example: Automatic analysis of a contract's content after uploading a document to extract key terms and risks.
See section Document AI Actions
AI Evaluation Allows you to evaluate the quality of other scenario types. This scenario is used to compare the actual execution result of another scenario with the expected result based on predefined datasets and criteria. See AI Evaluation.
AI ModelSelect one of the following options:
  • Default model (for provider):
    • OpenAI — gpt-5-mini
    • Azure OpenAI — the model will be the one you specified when creating a subscription
    • DeepSeek — deepseek-chat
    • Grok — grok-2
    • Gemini — gemini-2.0-flash
    • Claude — claude-3-5-haiku
    The listed models are used by default if you have not defined a custom default model. If you selected the Default Model checkbox when adding an AI model to the platform, that model will replace the default value for the corresponding provider.
  • Custom model — if you select this option, an additional field will appear where you can choose the AI model that can be configured independently.
AI ToolsFrom the dropdown list, select one or more AI tools to be used in the scenario.
"Default" CheckboxSelect the Default checkbox if you want to make this scenario the default for the entire platform. In that case, if no specific scenario is selected for a file attribute, the system will use the default scenario. Only one default scenario can be assigned per scenario type (for example, General, Summarization, Recognition, Document Action, etc.).
DescriptionEnter a short description of the scenario's purpose.
Note:

Fields marked with "*" are required.

  1. Configure Scenario Variables to add them to steps.

  2. To configure the sequence of actions, go to the Scenario Steps 1 tab and select the Add Step 2 button.

  3. Select the required step type from the list and configure it according to your needs. For detailed explanation of settings within this tab, see the Scenario Steps section.

  4. In the toolbar, select Save.

  5. You can then run the scenario execution to test the scenario before using it.

2.14.3.2.1.1. Scenario Variables

Scenario variables are parameters for passing and storing data during scenario execution. They allow you to pass data into a scenario (for example, document attribute values or other context), store step execution results, and use them in subsequent steps.

Variables can be input — for passing data into the scenario at runtime, or output — for storing results obtained during scenario execution (for example, AI model responses). A single variable can be used in multiple scenario steps, passing the result of one step as input for the next.

Create a Variable
  1. Open the scenario for which you want to create variables.

  2. In the Scenario Variables 1 tab, select Add Variable 2.

  3. Fill in the fields using the hints in the table below.

    FieldDescription
    Variable NameEnter a short name that will be displayed in the general variable list under the Scenario Variables tab. Use clear names, for example: document_content, summary_result, client_name.
    Data TypeSelect the variable data type from the list.
    • String — text data (names, descriptions). Example: document name, client name.
    • Number — numeric values. Example: contract amount, number of pages.
    • Boolean — true / false for scenario conditions. Example: document is signed.
    • JSON — structured data with multiple fields. Example: counterparty data.
    • File — a file or its contents. Example: PDF, contract scan.
    • Reference — a reference to an object or URL. Example: document card.
    Is Output VariableEnable the toggle if the variable should store the scenario execution result. You can write results received from the AI into such variables (in the LLM Request step). If the toggle is disabled, the variable is used as an input — for passing data into the scenario at runtime. Variables marked as output do not support the Reference or File data types.
    DescriptionEnter a short description of the variable's purpose or essence. This will help other users understand what the variable is used for.

    ℹ️ Note: This field supports localization. Select the icon to add values for other languages, fill in the corresponding fields, and select Apply.

  4. Select Save.

  5. In the toolbar, select Save.

Apply a Variable in Steps

After creating a variable, you can use it in scenario steps with mustache syntax using double curly braces: {{ variable_name }}

Example: if you created a variable content to store the document text, use it in the Prompt field of the relevant step:

Analyze the following text and highlight the main points: {{ content }}.

2.14.3.2.1.2. Scenario Steps

Scenario steps define the sequence of actions that the AI performs to process your data. Each step has its own purpose and can be used for different tasks.

To add a step to your scenario:

  1. In the AI Scenario settings form, go to the Scenario Steps 1 tab.

  2. Select the Add Step 2 button.

  3. Select the required step type 3 from the list:

Tip:

For System Message, User Message, and Assistant Message steps, formatting hints are available for Mustache markup or keyboard shortcuts. To open the hints, select the icon in the corner of the prompt field.

System Message

System Message is a step that sets the initial context for the AI, which becomes the foundation for all subsequent interactions in the scenario. These are the top-level instructions that define AI behavior.

Warning:

You can only add one System Message step. If you add this step type, it will always execute first, regardless of the order in which other steps are added.

Use the System Message when you need to:

  • Define the AI role and expertise
  • Set rules and constraints for responses
  • Specify the language and communication style
  • Define the output format

To configure the System Message:

  1. In the Prompt 1 text field, enter instructions that define the AI working context.

  2. If needed, use the prompt formatting hint 2.

    What you can include in the system prompt:

    • AI role and expertise.
      Example: "You are an expert in legal document analysis with 10 years of experience in contract law."
    • Response language.
      Example: "Always respond in English using professional legal terminology."
    • Presentation style.
      Example: "Use a clear, concise style without unnecessary words. Present information in a structured and logical manner."
    • Processing rules.
      Example: "If the required information is missing from the document, state this explicitly. Do not fabricate data."
  3. In the Message Chain field, select one of the chains from the list. See section AI Scenario Chains.

  4. Select Save.


Usage Example

Scenario: Contract analysis for risk identification

You are an experienced legal analyst specializing in reviewing commercial contracts.
Your task is to identify potential risks and unusual conditions in contracts.

Rules:
- Always respond in English
- Use professional legal terminology
- Structure the response by risk categories: high, medium, low
- If information is insufficient, state this explicitly
- Do not provide legal advice, only analyze facts

User Message

User Message is a step that provides the AI with specific instructions about what to do with the data.

Use the User Message to:

  • Formulate a specific task for the AI
  • Pass data for processing (via variables)
  • Specify the desired response format
  • Add specific processing requirements

To configure the User Message:

  1. In the Prompt 1 text field, enter instructions describing:

    • The desired output length
    • Which elements should be included or excluded
    • In what format the result should be presented
    • What data needs to be analyzed
  2. If needed, use the prompt formatting hint 2.

    Note:

    To pass data between steps, use the variables you created, referencing them with the following syntax: {{variable_name}}.

  3. In the Message Chain field, select one of the chains from the list. See section AI Scenario Chains.

  4. In the Include File section, enable the toggle with the name of your variable through which the file will be passed (there can be multiple variable toggles) 1 to control how the file is passed to the LLM model. Then specify the settings 2 according to which the file will be added to the request:

    1. PDF Pages to Process — define which pages of the PDF file to process:

      • Process all pages — LLM receives the entire document.

      • Specify pages — only pages specified manually are processed.

        Tip:

        Hover over the icon to view a hint about the format for entering page numbers.

      • Specify a variable with a page list — the page list is taken from a scenario variable, which you can specify in the field below. This option is convenient if the set of pages is determined dynamically during scenario execution.

        Tip:

        Hover over the icon to view a hint about the format for entering data.

    2. Send PDF in Request — specify when the PDF file should be passed directly to the LLM:

      • If there is no text layer or form data is present — PDF is sent only when the document has no text layer (for example, a scan) or contains AcroForm fields.
      • Only if there is no text layer — PDF is passed only for scanned documents.
      • Always — the PDF file is always added to the request, regardless of its structure.
    3. Add Page Images — define whether to convert PDF pages into images and add them to the request. Using page images allows bypassing limitations of LLM providers (for example Azure OpenAI, DeepSeek, Grok) that do not work with files directly but work with images. Select one of the following options:

      • Do not add, send PDF file — only PDF is used, without images.
      • Add instead of PDF file — selected PDF pages are converted to images and passed to the LLM without the PDF file. Recommended for LLM providers that do not support PDF but work with images.
      • Only for pages containing AcroForm, add alongside the PDF file — the PDF is passed in full, and pages with forms are additionally passed as images.
      Note:

      For the Add instead of PDF file and Only for pages containing AcroForm options, you can configure the resolution of page images. You can use the default value (1200 × 900) or set a custom resolution along the X and Y axes. A higher resolution improves image quality and analysis accuracy, but may increase processing time and the volume of data passed to the LLM.

  5. Select Save.


Usage Example

Scenario: Summarizing a loan agreement

Summarize only the conditions of this loan agreement as a clear list without formatting.

Exclude: introduction, signatures, and general phrases.

Include only specific conditions, such as:
- Amounts
- Rates
- Terms
- Penalties
- Payment methods

Here is the document text: `{{ content }}`

Assistant Message

Assistant Message is a step that allows you to enter text on behalf of the AI to add a response to the scenario that will precede a user request or appear between other steps. This step allows you to simulate assistant behavior or add predefined responses.

Use the Assistant Message to:

  • Simulate a dialogue with prior context
  • Create multi-step scenarios with confirmations
  • Add intermediate summaries
  • Train the model on examples of desired behavior
  • Create interactive scenarios

To configure the Assistant Message:

  1. In the Prompt 1 text field, enter the text that the AI "supposedly" already said earlier.

  2. If needed, use the prompt formatting hint 2.

    Tip:

    To save tokens, use concise and brief formulations.

  3. In the Message Chain field, select one of the chains from the list. See section AI Scenario Chains.

  4. Select Save.


Usage Example

Scenario: Document analysis with confirmation

Step 1 — User Message:

Analyze this contract: `{{ content }}`

Step 2 — Assistant Message:

I have analyzed the document. This is a standard goods supply contract. Ready to provide a detailed analysis.

Step 3 — User Message:

Yes, provide a detailed analysis of the payment terms and delivery deadlines.

This approach helps the model better understand the context and structure of the expected response.


LLM Request

LLM Request (Large Language Model) is a step that sends all previous messages (system, user, assistant) to the language model. This is the stage where the AI processes the input data and generates a response.

Use the LLM Request:

  • After configuring all the required messages
  • When you need to receive a response from the model
  • To complete a logical block of the scenario
  • In multi-step scenarios after each interaction block
Warning:

The LLM Request step is required for scenario execution. Without this step, the AI will not be able to generate a response.


To configure the LLM Request:

  1. Select the expected response format:

  2. Enable the LLM Request Parameters toggle if you want to additionally configure the AI model behavior:

    1. Select Choose Parameters.

    2. Select the checkboxes for the parameters 1 you want to edit, then select Save 2.

      Tip:

      Hover over the icon next to the parameter name to see a hint with its description.

      Note:

      Before configuring additional parameters, make sure your AI model supports the desired parameters. You can review parameter availability for some models in the table below.

      Parameter availability table
      Parameter / ModelOpenAI 5.1 miniOpenAI 4.1 miniAzure OpenAIOpenAI gpt-4oDeepSeek-chatGrok-2-latestGemini-2.0-flashClaude-3.5-haiku-20241022
      temperature🟡 400 Unsupported value: temperature does not support 2 with this model. Only the default (1) is supported.🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      top_p🔴 400 Unsupported parameter: top_p is not supported with this model.🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      frequency_penalty🔴 400 Unsupported parameter: frequency_penalty is not supported with this model.🟢 Supported🔴 400 Unsupported parameter: frequency_penalty🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      presence_penalty🔴 400 Unsupported parameter: presence_penalty is not supported with this model.🟢 Supported🔴 400 Unsupported parameter: presence_penalty🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      max_tokens🔴 400 Unsupported parameter: max_tokens is not supported with this model. Use max_completion_tokens instead.🟢 Supported🔴 400 Unsupported parameter: max_tokens🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      max_completion_tokens🔴 When the token limit is exceeded, an error is displayed: Error during AI provider call: Invalid message format🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      n🟢 Limitation: n <= 8🔴 Responses are returned in parallel and overlap each other🟡 Limitation: n <= 8, responses overlap each other🔴 Responses are returned in parallel and overlap each other🔴 400 Invalid n value (currently only n = 1 is supported)🟢 Supported🟢 Supported🟡 400 n: Input should be less than or equal to 1
      reasoning_effort🟢 Very large difference between medium and high🔴 400 Unrecognized request argument supplied: reasoning_effort🟢 Supported🔴 400 Unrecognized request argument supplied: reasoning_effort🟢 Supported🟢 Supported🔴 400 status code (no body)🟢 Supported
      stop🔴 400 Unsupported parameter: stop is not supported with this model.🟢 Supported🔴 400 Unsupported parameter: stop🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported
      parallel_tool_calls🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🟢 Supported🔴 Gemini implementation doesn’t support tool calling🟢 Supported
      logit_bias🔴 400 Unsupported parameter: logit_bias is not supported with this model.🟢 Supported🔴 HTTP 400: { "error": { "message": "Unsupported parameter: 'logit_bias' is not supported with this model.🟢 Supported🟢 Supported🔴 400 "Argument not supported: logit_bias"🔴 400 status code (no body)🟢 Supported
      logprobs🔴 403 You are not allowed to request logprobs from this model🟢 Supported🔴 HTTP 400: { "error": { "message": "Unsupported parameter: 'logprobs' is not supported with this model.🟢 Supported🟢 Supported🟢 Supported🔴 400 status code (no body)🟢 Supported
      top_logprobs🟣 Blocked🟢 Supported🟣 Blocked🟢 Supported🟢 Supported🟢 Supported🟣 Blocked🟢 Supported
    3. The selected parameters will appear below. Set the required values for them.

    Tip:

    You can also apply a parameter preset. A Preset is a set of parameters with predefined values.
    To use a system preset:

    1. Select Apply Preset.

    2. In the Preset 1 field, select the required preset from the list, then select Save 2.

    The list of available presets depends on the AI scenario type. For example, for the Summarization scenario type, there are presets Short Summary and Detailed Summary, which allow you to adjust the length of LLM model responses.

  3. Enable the Manage Chains toggle if you want to split the AI scenario into multiple chains. You can learn more about chains in the AI Scenario Chains section.

  4. Enable the Save Result to Variable toggle if you want to save this request as a variable for use in subsequent steps.

  5. If in the previous step you enabled the Save Result to Variable toggle, specify the variable name using one of the following methods:

    A Enter the name of the output variable manually in the text field (for example, result). You can use the name of a variable declared earlier in the Variables tab, or enter a new variable name. If you enter a new variable name, its type will be determined automatically based on the received data and the response format set in (step 1 of this instruction). This method is convenient if the result can have different types (for example, number, string, file, etc.).

    або

    B Enable the Select from Declared Variables option and choose a variable from the list. The list shows only output variables — those for which the Is Output Variable toggle was enabled during creation. See Scenario Variables section.

  6. Select Save.


Usage Example

Note:

Typically, the LLM Request step is used as the last step of a scenario, or as the second-to-last — before the Script step, which can perform additional processing of the result.


Typical sequence of steps in a scenario:

ScenarioExplanation
System Message

User Message

LLM Request
  • System Message — sets the role and rules
  • User Message — describes the task with data
  • LLM Request — receives a response from the model

Or for a more complex scenario:

ScenarioExplanation
System Message

User Message

LLM Request

Assistant Message

User Message

LLM Request
  • System Message — establishes context
  • User Message — first question
  • LLM Request — receives the first response
  • Assistant Message — simulates AI response
  • User Message — follow-up question
  • LLM Request — receives the final response

Script

The Script step allows you to execute a server-side JavaScript script directly during AI scenario execution.

Unlike AI scenario tools, which are called and controlled by the AI model (LLM), the Script step executes without the model's involvement. This means the platform runs the script automatically according to the defined sequence of scenario steps. Direct script execution is faster and more cost-effective, as it does not require additional requests to the LLM.


The Script step can be used, for example, to:

  • prepare or transform data before passing it to the LLM.
  • process the model response results.
  • retrieve additional data from the platform.
Note:

The Script step can be used at any stage of the scenario — as the first, intermediate, or last step.


To configure the Script step:


In the Script field, insert the server-side JavaScript code that should execute at this step.


By default, the field contains a commented-out example template that demonstrates the script structure and how to work with scenario variables and execution context. You can edit this template: uncomment the required fragments, replace the example values with your own, and add your business logic.

Tip:

To view additional formatting hints for the script, select the icon in the Script field.

2.14.3.2.1.4. AI Scenario Chains

Chains are a mechanism for grouping messages within a single AI scenario that allows you to logically split a conversation into separate sub-sequences and control which messages are included in a specific request to the LLM. Chains can include steps of any type.


Chains allow you to:

  • speed up scenario execution
  • reduce cost (token count) by limiting the context for certain steps
  • reuse the result of one chain without passing the entire preceding context

Assign a Chain to a Step

For System Message, User Message, and Assistant Message step types, you can choose which chain to assign the step to. To do this:

  1. Select the scenario step you want to assign a chain to 1. The step must be one of the following types: System Message, User Message, Assistant Message.

  2. In the Message Chain 2 field, select one of the chains from the list:

    • Main Chain — the base chain used by default.
    • Chains 1–5 — additional chains that allow you to isolate parts of the conversation and control the context of requests to the LLM.
  3. After assigning scenario steps to chains, you will see the corresponding numbering in the step list (0 is the main chain, 1–5 is the sequential number of the additional chain).


Manage Chains for LLM Request

For LLM Request step types, you can choose which chains' steps to pass to the LLM. You can also select the chain where the LLM will write its response. To do this:

  1. Select the LLM Request 1 step.

  2. Enable the Manage Chains 2 toggle.

  3. In the Response Chain 1 field, select from the list the chain where the LLM will write its response to this request.

  4. In the Include Chains in Request 2 section, select one of the following options:

    • Include all messages — to pass the entire scenario context to the LLM, regardless of which chains the messages belong to. In this case, the LLM sees all previous system, user, and assistant messages.
    • Include messages from selected chains — to limit the request context and pass to the LLM only messages from the selected chains. Below, you can select the checkboxes next to the chains whose messages should be included in the request. Messages from other chains will be ignored.

Usage Example for Chains

Let's walk through an example of the AI system scenario (sys_doc_recognize) for document recognition, which consists of five steps and uses two chains.

The goal of this scenario is to correctly recognize a document using the fewest possible tokens.


Step 1. System Message

Chain: Main

At this step, the scenario passes to the LLM a system instruction with document recognition rules: how to select the document type, how to extract attributes, and in what format to return the result. This message is part of the "heavy" context needed only for the recognition stage.


Step 2. User Message

Chain: Main

At this step, the following is passed to the LLM:

  • a list of all possible document types in the system
  • descriptions of their attributes
  • the document file (PDF) to be recognized.

Together with the previous step, this stage forms the full recognition context, which typically contains the largest number of tokens.


Step 3. LLM Request

Response Chain: Chain 1

Request Context: all messages

Based on everything we "taught" the model in the previous two steps, we ask the LLM to return the recognition result in JSON format.

We ask the response to be written into a new chain: Chain 1. This is the step where the "separation" of the recognition result from the heavy context (original file, system document types, recognition rules) takes place.


Step 4. User Message

Chain: Chain 1

At this step, the scenario passes an instruction on how to reformat the received JSON into the final structure expected by the platform. The model no longer works with the document and does not need knowledge about document types — it operates only on the ready recognition result it received in the "clean chain" in the previous step.


Step 5. LLM Request

Response Chain: Chain 1

Request Context: only messages in Chain 1


At this step, the LLM receives a narrow, minimally necessary context:

  • JSON with the recognition result (step 3)
  • the transformation instruction (step 4)

The model does not see:

  • system rules
  • the list of document types
  • the original file for recognition

As a result, the LLM quickly and reliably performs a simple task — reformatting JSON — and writes the final result to a scenario variable.


What Would Happen Without Chains

If chains were not used, at step 5 the LLM would receive the entire scenario context, including:

  • the original file for recognition
  • descriptions of document types
  • recognition rules

For a simple JSON formatting task, such context is excessive. In this case, the model would:

  • process significantly more tokens (which would increase the request cost)
  • execute the request more slowly

2.14.3.2.2. Apply a Scenario

After creating and configuring an AI scenario, the administrator must apply it in the system to make it available for execution. The platform supports three ways to apply a scenario, which can be used separately or together.

  • At the platform level — the scenario is set as the default for a specific scenario type. In this case, it is automatically used in all parts of the system where the corresponding type of functionality is called.
  • At the file attribute level in a document type — the scenario is linked to a specific file attribute in a document type. This allows you to override the default scenario or apply a specialized scenario only for certain documents. This method applies only to the Document Summarization scenario type.
  • At the document type level — this method applies only to the Document Action scenario type.

Method 1: At the Platform Level

Applying a scenario at the platform level allows you to set it as the default for a specific scenario type. This scenario will automatically be used in all parts of the system where the corresponding type of AI functionality is called.

Note:

Only one default scenario can be set per scenario type in the system. For example, if the Document Summarization scenario type is set as the default, it will be used whenever the summarization action is performed anywhere on the platform. If another scenario of the same type is set as the default, the previous one automatically loses that status.


To apply the scenario at the platform level:

  1. In the navigation panel, select the Studio 1 workspace.

  2. Select the AI Center 2 shortcut group, then select the AI Scenarios 3 shortcut.

  3. Select the scenario you want to set as the default for the entire platform 4.

  4. Select the Default 1 checkbox.

  5. In the toolbar, select Save 2 icon.

Method 2: At the File Attribute Level in a Document Type

This method applies only to the Document Summarization scenario type. Applying a scenario at the document type level allows you to granularly control the use of AI scenarios for specific documents. In this case, the scenario is linked to a file attribute in the document type and is used only within the context of that document.


Result: After activation, users will be able to run the scenario directly from the document card of the corresponding type.


To apply the scenario at the document type level:

  1. In the navigation panel, select the Studio 1 workspace.

  2. Select the Document Types 2 shortcut, then select the required document type 3.

  3. Go to the Constructor tab.

  4. In the document form, select the file attribute 1 whose content you want to summarize.

  5. In the attribute settings, in the AI Scenario 2 field, select the required scenario.

    Tip:

    If you have not created a custom AI scenario, you can select the system scenario named sys_doc_summarize_in_doc_lang. This scenario will summarize the document according to the language of the text in the document.

  6. In the toolbar, select Save.

Method 3: At the Document Type Level

This method applies only to the Document Action scenario type. See section Configure AI Actions for a Document.

Warning:

For Document Action scenario types, activation at the document type level is mandatory. By default, this action is inactive and does not appear in the interface until explicitly activated.

2.14.3.2.3. Run Scenario Execution

After you created an AI scenario, you can run its execution. Below are two methods that users with the Admin or Developer roles can use to test the created scenario.

Method 1: Run from the Scenario Form

After creating and configuring the scenario, you can run its execution directly from its settings form. This method is most suitable for testing or one-time use.


To run scenario execution:

  1. In the navigation panel, select the Studio 1 workspace.

  2. From the AI Center 2 shortcut group, select the AI Scenarios 3 shortcut.

  3. From the scenario registry, select the required scenario 4.

  4. Select Run Execution 2.

  5. In the Business Key field, enter a unique execution identifier. This can be numbers, letters, or a combination. Later, you can use the business key to determine which platform entity initiated the execution.

  6. Enable the Link Scenario Execution to an Object 1 toggle if you need to associate the scenario execution with a specific platform entity object (for example, a process or document).

    Note:

    Linking allows you to display the linked entity object (for example, a document) in the AI Execution registry.

  7. If the Link Scenario Execution to an Object toggle is enabled, in the Entity Name 2 field, select the required entity from the list. For example, select the dfx_Document entity, and in the following steps specify the particular system document to which the scenario execution will be linked.

  8. In the Input Method 1 section, select the method you will use to identify the entity object in the next step:

    • Select from list — allows you to select a specific entity object from the list. Recommended when the entity contains a small number of objects.

    • Enter ID — allows you to manually enter the identifier of the required entity object. Recommended when the entity contains a large number of objects and searching through the list is inconvenient.

  9. In the Object ID 2 field, select a value from the list or enter the identifier manually — depending on the selected input method.

  10. In the Execution Scenario Variables section, fill in the value for each variable. To do this, select the 1 icon and load the data corresponding to the variable type.

    Note:

    Only input variables of the scenario are displayed in this section.

  11. Select Save and Run 2.

Note:

You can view the scenario execution results in the Execution Log.

Method 2: Run from the "AI Execution" Shortcut

This method is used by platform administrators as a debugging and verification tool for scenarios. Similar to Method 1, it is most suitable for testing or one-time runs, rather than for regular use in workflows.


To run scenario execution:

  1. In the navigation panel, select the Studio 1 workspace.

  2. From the AI Center 2 shortcut group, select the AI Execution 3 shortcut.

  3. In the toolbar, select Create 4.

  4. In the AI Scenario 1 field, select the scenario you want to run from the list.

  5. In the Business Key 2 field, enter a unique execution identifier. This can be numbers, letters, or a combination. Later, you can use the business key to determine which platform entity initiated the execution.

  6. Enable the Link Scenario Execution to an Object 1 toggle if you need to associate the scenario execution with a specific platform entity object (for example, a process or document).

    Note:

    Linking allows you to display the linked entity object (for example, a document) in the AI Execution registry.

  7. If the Link Scenario Execution to an Object toggle is enabled, in the Entity Name 2 field, select the required entity from the list. For example, select the dfx_Document entity, and in the following steps specify the particular system document to which the scenario execution will be linked.

  8. In the Input Method 1 section, select the method you will use to identify the entity object in the next step:

    • Select from list — allows you to select a specific entity object from the list. Recommended when the entity contains a small number of objects.

    • Enter ID — allows you to manually enter the identifier of the required entity object. Recommended when the entity contains a large number of objects and searching through the list is inconvenient.

  9. In the Object ID 2 field, select a value from the list or enter the identifier manually — depending on the selected input method.

  10. In the Execution Scenario Variables section, fill in the value for each variable. To do this, select the 1 icon and load the data corresponding to the variable type.

  11. Select Save and Run 2.

2.14.3.2.4. Scenario Usage

The ability to use a scenario depends on its type and the user's role.

Scenario types available to all users by default:

  • Document Summarization
  • Document Recognition
  • Document Action

AI Evaluation scenario types are available only to users with the Admin or Developer roles.


Document Summarization

This scenario can be run from the document form using the Summarize button in the file attribute. For more details, see section Summarize PDF File Content.


Document Recognition

There are two ways to use this scenario:


Document Action

This scenario can be run from the document form using the AI Actions button. For more details, see section Apply AI Actions in a Document.


AI Evaluation

There are two ways to use this scenario:


Run from a Business Process

You can integrate AI scenario interaction into a business process. By configuring variable mapping, you can pass data from process variables to scenario variables, and vice versa — pass scenario execution results back to process variables.


To run an AI scenario from a business process:

  1. In the navigation panel, select the Studio 1 workspace.

  2. Select the Process Library 2 shortcut.

  3. Open the process from which you want to run the scenario 3.

  4. Add a service task to the process (see section Service Task).

  5. Apply the AI Execution template to the task and configure it according to your needs. For detailed instructions, see section AI Execution.

2.14.3.2.5. View Execution Results

You can view the scenario execution details in the AI Execution shortcut. It allows you to track the history of scenario runs, identify and resolve errors, and monitor token usage.


To navigate to the AI Execution shortcut:

  1. In the navigation panel, select the Studio 1 workspace.

  2. From the AI Center 2 shortcut group, select the AI Execution 3 shortcut.

    In the registry, you will see all AI scenario executions that have been run in your system. By default, records are displayed in chronological order, starting with the most recent.

    In the Execution Status column, you can see the current execution status, which can be one of the following:

    • Completed — execution completed successfully.
    • Cancelled — execution was stopped by the user.
    • Error — an error occurred during execution. You can view the error details by selecting the corresponding execution record. Errors most commonly occur due to AI model configuration issues. For example, if the API key for the AI model is not configured or has expired. In such cases, it is recommended to check the error message and restart the scenario execution after resolving the issue.
    • Running — execution is in progress.
    • Hanging — execution has stalled or is not responding.
    • Pending — the execution record has been created but not yet started.
  3. To view more details, select the required execution record.

  4. In the settings form, go to the Log tab. Here you can:

    A View the number of LLM requests that were pre-configured in your scenario (see LLM Request)

    B View the number of tokens used to process the request (the cost depends on the AI model you selected)

    C Open each request as a separate file to see extended information for Administrators (what the request was, what response was received, which variable was used, how many tokens were used and at which stage, etc.)

    Note:

    The Log tab also displays warnings when the actual AI response format differs from the expected one (for example, when the LLM wraps a JSON response in markdown). In such cases, the system attempts to automatically process the response and records a warning if part of the data could not be correctly mapped.

  5. Visualization of requests to and responses from the AI agent is available in the right panel of the settings form in the Streaming A section. You can also specify additional tasks for the AI in the text field B.

2.14.3.2.5.1. Bulk Actions in the "AI Execution" Shortcut

In the AI Execution shortcut, an administrator can view the execution status of AI scenarios and perform actions on multiple execution records at once. For this, the multiple selection mode is used. For example, instead of cancelling several executions one by one, you can select multiple records in the shortcut and apply the required action to all selected records simultaneously.


The following actions are available for bulk processing:

  • Cancel — stop scenario execution. A cancelled execution can be restarted later if needed. This action is available for executions with Pending and Running statuses.

  • Restart — re-run execution for selected records. Typically used after cancellation or in case of an error during the previous execution. This action is available for executions with Error, Cancelled, and Hanging statuses.

  • Delete — permanently delete the execution record. Once deleted, the record cannot be restored.

  • Copy to AI Evaluation Dataset — this action is used within the AI Evaluation functionality. It allows you to create a record in the evaluation dataset based on the results of the selected scenario execution. This makes it possible to use the actual execution result as a reference example for further evaluation of model quality or scenario settings. This action is available for executions with the Completed status.


To perform bulk actions in the AI Execution shortcut:

  1. In the navigation panel, select the Studio 1 workspace.

  2. From the AI Center 2 shortcut group, select the AI Execution 3 shortcut.

  3. Enable the Multiple Selection mode and select the checkboxes next to the required execution records 1.

  4. Right-click and select the required action from the context menu 2.

For the Cancel and Restart actions, a table will open displaying the selected records A and a button to confirm the action B.

Note:

If a selected record does not support the chosen action, it will display the Not Applicable status. This can happen, for example, if you try to cancel an execution that has not yet been started.

2.14.3.2.5.2. Re-run Execution

If a scenario execution was cancelled or completed with an error, you can re-run it after resolving the issue. This avoids creating a new execution from scratch — you can reuse the existing one while preserving the history and context of previous attempts. This action is available to users with the Admin or Developer roles.

  1. In the navigation panel, select the Studio 1 workspace.

  2. From the AI Center 2 shortcut group, select the AI Execution 3 shortcut.

  3. Select the execution record with the Error or Cancelled status 4.

  4. Perform one of the following actions depending on your needs:

    • If you want to re-run execution without adding an additional message: In the text field in the Streaming section, select the icon to re-run the execution.

    • If you want to add an additional message for the LLM before re-running the execution: In the text field in the Streaming section, enter the required message, then select the icon to re-run the execution.

    Note:

    To stop the execution, select the icon.