Add a Generative AI activity

Use the following procedure to use the Generative AI functionality within your workflow solution. The Generative AI activity type is also available when configuring a true/false condition and a loop.

Before you begin

Make sure the Generative AI provider is already configured. When adding a Generative AI activity, if a provider is not configured, a message appears.

You can configure the AI provider in either way:

  • In TotalAgility Studio. See Configure the Generative AI provider.

  • In TotalAgility Advanced Studio. Refer to "Integrate with TotalAgility" in the TotalAgility Advanced Studio Help

Procedure

  1. Select below the Start node or any other node

    The Add activity dialog box is displayed.

  2. Change the default Name of the activity as required.
  3. On the Type list, select Generative AI.
  4. By default, "Generative AI" appears as the Title. You can change the title as needed.
  5. Select the Configuration mode.
    • Static (default) : You can manually enter all configuration values directly into the Generative AI activity. These values are fixed and do not change at runtime.

    • Dynamic: You can dynamically configure the Generative AI activity so you can use a single process with different configurations. On the Dynamic configuration (JSON) list, select a process or server variable (String or Data object).

      • The String variable must have a valid JSON configuration. If the JSON is not valid, an error appears at runtime.

      • For a data object variable, you can use the "AIDynamicConfig" data model available in the System category. This data object holds the dynamic configuration JSON for the Generative AI provider.

  6. The Provider list includes the list of providers already configured in the Integration module of TotalAgility Advanced Studio. Select the Generative AI provider to use, such as OpenAI, AI Agent, Custom LLM, or Azure OpenAI.

    When you select a provider, a list of (standard and additionally added) input variables and a list of output variables appear.

    • You can set a static value or dynamic variable (form control, form variable, or global variable) for the input and output variables.

    • The output variable included in the standard variables is used to populate the chat control response.

    Alternatively, select to provide an inline value, or select a process, server, or case variable.

  7. Configure the Model to use for this activity.

    The AI model used by the component depends on the type of provider you select. Providers are listed under the names given when they were configured, so a name such as "ChatGPT" may belong to any type. To check the type of a provider, open it in Integration > Generative AI and look at Type. The name of the property and the options it offers vary by provider type:

    Provider type Model property

    Tungsten

    process

    The property is labelled Model and a list is displayed, set to Default. Do one of the following:

    • Keep Default to use the model configured in System > System settings > System > Tungsten AI > Model.

    • Select a specific model to use for this component only.

    • Select to provide an inline value, a String-compatible variable or a server variable that contains the model name.

    OpenAI Compatible

    The property is labelled Override model and no list is displayed. Leave it empty to use the model configured at the integration level, or enter the model name to override it. Select to provide the value as a String-compatible process or server variable instead.

    Azure OpenAI

    Not available. The model is part of the URL configured for that provider.

    Custom LLM or AI Agent

    Not available.

    • When you provide an inline value for the Provider, the model cannot be selected from a list, so you must provide an inline value for the model as well. If either value is a variable, it is resolved at runtime.

    • A provider is configured with a standard model and a vision model. The model you specify here overrides the vision model when the component sends an image, and the standard model otherwise.

    • If the configured model has been removed or is otherwise unavailable, the error is raised at runtime, not when you design or publish the component. An invalid model name is not validated: the request is sent as entered.

    • On upgrading or importing from an earlier version, the Model of a component using the Tungsten provider is set to Default. For any other provider, the component continues to use the model configured on that provider's integration.

  8. On the Source list, select one of the following options:

    On upgrading TotalAgility from an earlier version, if the Source that was set to Inline image is now set to Image.

    None (default)

    The response from the AI provider is based on the input provided (plain text or variables).

    Image

    The response is generated based on the image provided at runtime.

    Only single-page documents are supported.
    1. On the Document list, select either variable type:

      • Document: At runtime, the variable uses a base64 string to store the content of the document.

      • String: Select either Mapping type.

        • Instance ID (default): The variable uses the instance ID of the document at runtime.

        • Data as base64 string: The variable uses the content of the document as a base64 string at runtime.

    2. On the Mime type list, select a file type. The supported mime types are GIF, JPEG, and PNG (default).

    Text

    If the document layout text is, for example, a semi-structured document (invoice, purchase order, and more) or a fixed form, the text format can provide better results compared to the results returned using a Custom LLM provider.

    The response is generated based on the document passed as input at runtime.

    On the Document list, select either variable type:

    • String: At runtime, the variable uses the instance ID of the document.

    • Document (default): The variable uses the instance ID of the document at runtime.

    The following file types supported in the Transformation Designer are also supported for the text format in TotalAgility at runtime.

    • TIFF (*.tif)

    • JPEG (*.jpg)

    • PNG (*.png)

    • PDF

    When you set the source format as text, the standard model configuration is used.

  9. Optional. You can dynamically set the seed value when searching the knowledge base. The seed value increases the likelihood of obtaining more consistent results from the AI provider across repeated requests, though not guaranteed. Do either of the following:
    • Select the check box for Use seed (default: Clear), or select and select a dynamic value (form variable that is compatible with a boolean value or form control).

    • On the Seed list, select a form variable or form control or select a numeric value. (Default: 0 and Maximum: 32,767)

  10. Optional. To use MCP servers with Generative AI activity, select Use MCP servers. (Default: Clear)

    Making MCP servers available for use is giving consent for them to be executed at runtime.

    1. Select Add to add MCP servers.
      The New MCP server dialog box is displayed.
    2. On the list of preconfigured MCP servers, select the required server. Refer to "Configure MCP server connection" in the TotalAgility Advanced Studio help.

      When MCP servers are added, all tools exposed by the selected servers become available for use in the Generative AI activity.

    3. To dynamically override the MCP tools available, select Override tools and select/deselect the tools as required.

      When this option is enabled, the MCP server configuration is not modified, and only the tools selected for this activity are available for use.

      Optionally, use the Search tools box and the dropdown beside it to find specific tools by name and filter them.

      You can override MCP tools only at design time and not at runtime.

    4. Select Save.

      The MCP server appears in the list.

    5. You can add more MCP servers.
  11. Set the process Temperature for the AI provider. (Default: 0.5, Minimum: 0, and Maximum: 2)

    This parameter controls the level of creativity in the AI-generated text, providing more focused or diverse text. A higher temperature means the model takes more risks, giving you a mixed response.

  12. On the Response list, select a variable, such as String, to hold the response for the provided input.
  13. Specify a State to be set when the workflow reaches this point.
  14. Select Add.

    The Generative AI node is added, and the updated properties are displayed in the properties panel.

  15. When you publish the solution, the corresponding settings are populated in the generated workflow and the system does the following:
    • Passes the correct input to the selected AI provider and populates the mapped variable at runtime.

    • The seed is applied based on the configuration.

    • If MCP servers are configured, executes the appropriate MCP tools based on the activity requirements and user consent.

    • Records an audit entry that the Generative AI activity is executed. The audit entry includes the provider and the actual model used.

    When you export a process and then import it to a target server, the activity is executed correctly if the provider is configured with the same name as the source server.