Custom AI Task

The Custom AI activity lets you define your own prompts to perform AI-powered tasks such as extracting key information, summarizing content, and performing sentiment analysis, within a workflow. The results from supported LLMs can be used as tokens to perform automatic routing, generate regular expressions, populate metadata, and more.

Custom AI activity icon

To add this activity to a workflow definition

To configure this activity

Server

The Server property box specifies which web service endpoint to use for the custom AI task.

Prompt

Choose between Basic or Advanced in the Type drop-down menu.

Basic Prompt

The Basic option provides a single user prompt to the connected LLM, which can include token references or files. Sample prompts can help you get started.

To access the sample prompts, click the sample prompts icon .

  • Improve your writing: Refine selected text to improve clarity, grammar, and tone while keeping the original meaning.
    Note: Replace [text] in the input field with the text you want improved. Click the Token button (right arrow) to use tokens.
  • Understand the main points: Extract and summarize the key ideas from a block of text or document.
    Note: Replace [article text] in the input field with the text you want the main points to be generated from. Click the Token button (right arrow) to use tokens.
  • Summarize article: Generate a short summary highlighting the most important information from a longer article or document.
    Note: Replace [text to summarize] in the input field with the text you want summarized. Click the Token button (right arrow) to use tokens.
  • Analyze feedback sentiment: Identify whether customer or user feedback expresses a positive, negative, or neutral tone.
    Note: Replace [text] in the input field with the text you want feedback sentiment analysis to be generated from. Click the Token button (right arrow) to use tokens.
  • Describe an image: Create a concise, accessible description of an uploaded image or document preview.
    Note: Replace [image file token] in the input field with the image token you want described. Click the Token button (right arrow) to use tokens.

Advanced Prompt

The Advanced option lets you assign roles to messages sent to the AI service, allowing for more dynamic prompts.

  1. Click the Add Message button.
  2. In the Add New Message dialog window, choose a Role.
    1. User: Represents the input you provide to the AI. Use this for questions, instructions, or requests you want the AI to process.
    2. System: Defines how the AI should behave or respond. Use this to set the tone, context, or purpose for the conversation.
    3. Assistant: Represents the AI’s response. Use this to include or simulate previous responses from the AI when continuing a conversation.
  3. Input a message.
  4. (Optional) Use the token selector to select a token.
  5. Click OK when finished.

Settings

Timeout: Increase the timeout value if the server or model responds slowly. This setting allows workflows to complete successfully even when using lower performance or local models. Click the Token button (right arrow) to use tokens.

Test Action: Preview results before running the workflow. The test option verifies server connectivity, token mapping, and quality.

Example Advanced Prompt

Advanced Settings

In the Advanced settings , you can link the AI prompt with an existing conversation to provide context to enhance the AI results.

Conversation Management

Start a new AI conversation: Begins a new AI session without any previous context. Use this option when you want each workflow instance to generate responses independently.

Join AI conversation with ID: Connects the activity to an existing conversation by specifying a conversation ID. You can manually enter an ID, generate a new one, or use the token picker  .

  • Reduce previous conversation

    • Summarize: Creates a concise summary of previous conversation messages before continuing. This maintains essential context while reducing token usage and improving processing efficiency.

    • Truncate: Removes the oldest messages in the conversation once a specified limit is reached. This ensures that only recent exchanges are included in future prompts.

    • Message retention count: Sets the number of prior messages to keep in memory for context. A higher value improves continuity, while a lower value reduces processing time and resource usage.

AI Settings

Temperature: Controls the variability of the responses. Lower values (closer to 0) produce more precise, repeatable responses, while higher values (closer to 1) generate more variable responses, which may be more creative but has a higher risk of false information.

Tokens for Custom AI Task

The Custom AI Task activity produces the following tokens.

Name Description Sample Syntax
Result The result that AI model returns. %(CustomAITask_Result)
ConversationID The conversation ID of AI conversation. %(CustomAITask_Conversation ID)