Free cookie consent management tool by TermsFeed

Execute Generative AI Skill Smart Service

On This Page

Overview

The Execute Generative AI Skill smart service lets you integrate your AI skill into your process. This smart service takes input and appends it to the prompt you created in the relevant AI skill. Then, the smart service sends the compiled prompt to a generative AI model, which returns an output. The smart service can be run in two different execution modes.

The smart service takes a document, email, or text as input. Review the list of generative AI skills you can use with this smart service.

Permissions

The user who executes the process model doesn't need to have access to the AI skill being called by the Execute Generative AI Skill smart service. However, without those permissions, some smart service configuration options are masked.

Properties

Configuration options

Setup tab

The Setup tab allows you to select an AI skill and the execution mode.

  • Select AI Skill: Search or browse for an AI skill to use with this smart service.
  • Execution Mode: The execution mode determines how this smart service runs in a process. Review the descriptions below to choose the mode that best fits your use case. See the Execution modes topic for more details.

    Execution Mode Description
    Standard Best for most use cases, especially jobs that complete quickly while the user is waiting for results. Supports activity chaining.

    Timeout: 4.5 minutes (1.5 minutes in autoscaled processes)
    Long Running Best for use cases with complex reasoning, large outputs, or high-volumes. Does not support activity chaining.

    Timeout: 60 minutes

Data tab

Node inputs

Inputs change based on the AI skill you use with this smart service.

Document inputs
Name Data Type Description Required Multiple
Input Document Document Runtime document that will be appended to the prompt configured in the selected AI skill. Y N
Runtime Prompt Text An optional runtime prompt that is used instead of the prompt configured in the AI skill. N N
Email inputs
Name Data Type Description Required Multiple
Input Email Document Runtime email that will be appended to the prompt configured in the selected AI skill. Y N
Runtime Prompt Text An optional runtime prompt that is used instead of the prompt configured in the AI skill. N N
Text inputs

Ensure your input format matches the format specified in the prompt. For example, if the prompt includes instructions for the AI to format a list or map into JSON, ensure the input is in list or map format.

Name Data Type Description Required Multiple
Input Text Text Runtime text that will be appended to the prompt configured in the selected AI skill. Y N
Runtime Prompt Text An optional runtime prompt that is used instead of the prompt configured in the AI skill. N N
Spreadsheet inputs
Name Data Type Description Required Multiple
Input Spreadsheet Document Runtime Excel file (XLS, XLSX, or XLSM) to extract data from using the selected AI skill. Y N
Runtime Prompt Text An optional runtime prompt that is used instead of the prompt configured in the AI skill. Use this to dynamically adjust extraction instructions for different spreadsheet templates at runtime. N N
Model inputs
Name Data Type Description Required Multiple
Runtime Model Text A runtime model that is used instead of the model configured in the AI skill. You can find the model ID in two places: returned by the a!genAiModels() function or in the AI skill settings . N N
Enable Extended Thinking Boolean Determines if the model uses enhanced reasoning to process complicated tasks. When enabled, the model breaks down intricate tasks into logical, sequential steps before generating a final response. This parameter does not apply to spreadsheet extraction AI skills. N N

Node outputs

The smart service returns the model's response as text. If the model encounters an error, details are returned in the Error Message output.

Output Data Type Multiple Description
Success Boolean N Returns true if the execution was successful or false if it was unsuccessful.
Response Text N The model's response.
Model Thinking Text N The reasoning the model used to generate the response. Only populated when extended thinking is enabled. This output does not apply to spreadsheet extraction AI skills.
Error Message Text N When applicable, the error message returned by the model.
Input Tokens Number (Integer) N The number of generative AI tokens used by the smart service input and the prompt from the associated AI skill.
Output Tokens Number (Integer) N The number of generative AI tokens used by the Response field.
model Identifies the specific generative AI model used for the execution.    

Usage considerations

Activity chaining is supported.

The AI model has a maximum limit of 100,000 tokens to analyze per call. If the combined prompt and input text exceed this limit, you may encounter an error.

If any of these guardrails are limiting, please reach out to your Appian contact.

Autoscaled process models and application performance

Using this smart service in a process model with autoscale enabled may result in degraded site or application performance. It should be used with caution and tested thoroughly before deploying it for real-world use. When the application is in production, use the Autoscaled Process Activity tab to monitor how the process performs at scale.

Execution modes

The Execute Generative AI Skill smart service can run in two distinct modes: standard and long running. Choosing the right mode depends on your use case and the complexity of your inputs.

  • Standard (Default): This is the default behavior of the smart service. Standard mode is best for runs that can generally complete quickly or where you need an immediate response to use activity chaining in your process model. When used in a standard process, the AI skill called by the smart service needs to finish in 4.5 minutes; when used in an autoscaled process, the AI skill must finish in 1.5 minutes.
  • Long Running: This mode is designed for processing lengthy or complex jobs that could otherwise fail because of the standard mode timeout limit. When you select this mode, the smart service checks at regular intervals to see if the model has responded, instead of keeping the process node active the entire time. This is the best mode for use cases that require significant processing time; however, activity chaining is not supported.

When to use Long Running mode

Use Long Running mode when you expect the Generative AI Skill smart service to take a long time to generate a response. Long Running mode lets a request finish without requiring the node to stay active the entire time.

For example, consider a financial services application that needs to process a 150-page compliance report. The process uses the generative AI skill to:

  • Read the full document
  • Extract key regulations
  • Generate a plain-language summary of required actions

Because the input is large and the response must be comprehensive, the request may exceed the timeout limit of the Standard mode. Running the smart service in Long Running mode allows the process to continue once the AI output is ready.

Another example is an insurance company that needs to process a large number of claim documents at the same time. The process uses the Generative AI Skill smart service to:

  • Analyze each document for claim details
  • Extract customer and policy information
  • Generate summaries for downstream processing

Because these jobs run in parallel, keeping them in standard mode would hold the process execution open and place unnecessary strain on system resources. Running the smart service in long running mode ensures the workload can complete efficiently in the background without requiring users to wait for results.

Things to know when choosing a mode

Consider the following when choosing a mode:

  • You cannot use activity chaining when the node is running in standard mode.
  • Long running mode does not support activity chaining.
  • The Test button in the AI Skill will always run in standard mode and is still subject to the standard timeout limit, even if you have the long running mode selected in the smart service.

Input requirements

Input requirements correspond to the type of AI skill you're using with the smart service. Refer to the table below to see the requirements for each input type.

Different requirements apply for each input type:

  • Text: Only plain text is supported for text input, so file size, page count, and image limits do not apply.
  • Email: EML files are supported with a maximum file size of 25 MB. Page and image size limits do not apply.
  • Document: See the following table for the Document input type requirements.

Document input type requirements

File Type Mode Max File Size Page Limit Max Image Size
PDF Text only 25 MB 100 pages N/A
Visual elements & text 25 MB 20 pages N/A
JPEG, PNG Text only 10 MB N/A 10k x 10k pixels
Visual elements 3.75 MB N/A 8k x 8k pixels
TIFF (single-page) Text only 10 MB 1 page 10k x 10k pixels
Visual elements & text 3.75 MB 1 page 4k x 4k pixels
TIFF (multi-page) Text only 10 MB 100 pages 4k x 4k pixels
Visual elements & text 18 MB (3.75 MB per page) 20 pages 4k x 4k pixels

Note:  For Amazon Nova 2 Lite, "Visual elements & text" mode supports PDFs up to 100 pages and 18 MB.

Excel input type requirements

The spreadsheet extraction skill has the following requirements for Excel files (XLS, XLSX, XLSM):

Constraint Limit
Maximum file size 10 MB
Maximum number of cells 2 million cells
Maximum rows per sheet 40,000
Maximum columns per sheet 200
Maximum sheets 100
Maximum JSON response size 25 MB

Tip:  The spreadsheet extraction skill accepts Excel files (XLS, XLSX, XLSM) directly, without requiring conversion to PDF or another format. CSV files are not supported by this skill type.

Using the runtime prompt

The Runtime Prompt is an optional prompt that the smart service can use instead of the prompt configured in the AI skill. Use a runtime prompt when the prompt needs to dynamically adjust based on user input, data, or context captured during the process execution.

This approach is helpful when you can't define all of the instructions during design time. For example, you can use a runtime prompt to automatically review and evaluate outputs generated earlier in the process. This approach helps improve straight-through processing and reduces the need for manual review.

The following process model example uses a runtime prompt to automate document evaluation and reduce manual review:

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/automation/ex-runtime-prompt-process.png

Step Description
1 Extract case details: Extracts the customer name and case number from the document.
2 Build runtime prompt: Uses the extracted values to create a runtime prompt dynamically.
3 Verify extracted case details: Uses the runtime prompt to check if the extracted case number is valid.
4 Flag invalid extractions: If the extracted values are not valid, flags them for review.
5 Route based on results:
- If extracted values are not valid, assigns a review task for manual confirmation.
- If extracted values are valid, writes to the database.

Include examples

To get the best results with the runtime prompt, always provide clear instructions in plain text and include a few examples. Including examples in the runtime prompt helps guide the AI model to consistently provide a response in the format you want, which makes the output more predictable. Predictable output is easier to parse and use in later steps of a process.

Note:  When a runtime prompt is configured, the examples you added while designing the AI skill won't be used. To influence the AI model's behavior, add examples directly in the runtime prompt.

In this example runtime prompt, we ask the AI model to verify the customer number and case number are in a valid format.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<Role>
You are an expert at validating customer and case numbers
using defined format rules.
</Role>

<Context>
A valid customer number follows the format: CUST-#####
A valid case number follows the format: CASE-#####
</Context>

<Instructions>
1) Confirm if each number matches its required format.
2) Return in JSON format as:
  {
  customerNumber: valid/not valid
  caseNumber: valid/not valid
   }
</Instructions>

Tip:  See the Generative AI Skills page for more information about writing a good prompt.

Examples

Using spreadsheet extraction

When you use a spreadsheet extraction AI skill, the smart service returns a structured JSON response with extracted values and their cell locations.

In this example, the skill is configured to extract invoice header fields and line items from an uploaded Excel file.

Example prompt (configured in the AI skill):

1
2
3
4
5
6
Extract the following fields from this invoice spreadsheet:
- Vendor name
- Invoice number
- Invoice date
- Total amount due
- Line items table, including description, quantity, unit price, and subtotal for each row

When executed via the smart service, the Response output contains JSON in the following format:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "vendorName": {
    "value": "Acme Corp",
    "location": "Sheet1!B2"
  },
  "invoiceNumber": {
    "value": "INV-3337",
    "location": "Sheet1!B3"
  },
  "invoiceDate": {
    "value": "2026-01-15",
    "location": "Sheet1!B4"
  },
  "totalAmountDue": {
    "value": "4500.00",
    "location": "Sheet1!B10"
  },
  "lineItems": [
    {
      "description": { "value": "Consulting Services", "location": "Sheet1!A6" },
      "quantity": { "value": "10", "location": "Sheet1!B6" },
      "unitPrice": { "value": "400.00", "location": "Sheet1!C6" },
      "subtotal": { "value": "4000.00", "location": "Sheet1!D6" }
    },
    {
      "description": { "value": "Travel Expenses", "location": "Sheet1!A7" },
      "quantity": { "value": "1", "location": "Sheet1!B7" },
      "unitPrice": { "value": "500.00", "location": "Sheet1!C7" },
      "subtotal": { "value": "500.00", "location": "Sheet1!D7" }
    }
  ]
}

Configure the smart service to store the Response output as a process variable such as pv!jsonOutput. You can then use a!fromJson() in a script task to cast the data to an Appian data type for use in later process steps.

Using runtime overrides for spreadsheet extraction

Use the Runtime Prompt and Runtime Model inputs to handle different spreadsheet templates dynamically within the same process.

For example, if your process receives invoices from multiple vendors, each with a different layout, you can build the extraction prompt dynamically based on the vendor type and pass it as the runtime prompt at execution time. This lets you reuse a single AI skill and smart service node across all templates without creating a separate skill for each one.

Similarly, use the Runtime Model input to switch to a more capable model when processing complex or large spreadsheets, while using a faster model for simpler files.

Using JSON

You can pass JSON as input to the smart service, or have JSON returned as output as defined in the prompt. JSON is a common format to create key-value pairs of data that interests you, and it is easily understood by AI models. Therefore, JSON is an easy way to ask the AI skill to return structured data. Once the output is passed to the process model, you can use functions such as a!fromJson to cast the data to Appian data types.

Example prompt

In this example prompt, we ask the AI to find information within an unstructured document, such as a contract.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<role>
You are an expert at sifting through large amounts of information and finding the entities of interest. Find the below entities from the input information. Here are the entities you need to return:
</role>

Use the <input> to fill out all <entities>:
<entities>
{
  "invoiceNumber" (type: text)
  "orderNumber" (type: text)
  "invoiceDate" (type: date)
  "dueDate" (type: date)
  "totalDue" (type: decimal)
  "items" (type: list of objects): 
        "Hours/Qty" (type: decimal)
        "Service" (type: text)
        "Rate/Price" (type: decimal)
        "Adjust" (type: decimal)
        "Subtotal" (type: decimal)
}
</entities>

<instructions>
- Only output <entities> listed above from the <input>.
- For fields of 'date' type, return value using ISO 8601 format yyyy-MM-dd, do not return time if present
</instructions>

When executed via the smart service, the prompt returns the following output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "invoiceNumber": "INV-3337", 
  "orderNumber": "12345",
  "invoiceDate": "2016-01-25", 
  "dueDate": "2016-01-31",
  "totalDue": "93.50",
  "items": [
    {
      "Hours/Qty": "1.00",
      "Service": "Web Design",
      "Rate/Price": "$85.00",
      "Adjust": "0.00%",
      "Subtotal": "$85.00"
      }
  ]
}

Configure the smart service to store the output as a process variable such as pv!jsonOuput, so you can work with it more easily in later nodes.

Using a script task and the a!fromJson function, you can then cast this data to a record type:

1
2
3
4
cast(
  recordType!Orders,
  a!fromJson(pv!jsonOutput)
)

Finally, add and configure a Write Records smart service to save the data to the record type.

Runtime behavior

At run-time, the smart service calls a machine learning model that is associated with the AI skill configured in the Setup tab.

Possible error messages

Consult the following table to learn how to fix common errors when using this smart service:

Error message Reason Remedy
Input is too large for the model. Reduce the prompt or examples. The prompt and input are too large for the AI model to analyze. Reduce the size of either the prompt or the input and try again.
The underlying AI skill object has been deleted or is otherwise unsupported. Confirm the node's configuration and try again. The Execute Generative AI Skill smart service is referring to an AI skill design object that no longer exists. Reconfigure the smart service to use an existing AI skill.
The parameter {0} has an unsupported value or is missing. The smart service input is empty. Reconfigure the smart service to pass a value into the input variable.
The underlying AI skill object has an unsupported prompt or the prompt is empty. The AI skill does not have the prompt defined. Edit the AI skill and add a prompt.
This model doesn't support extended thinking. Choose a different model or disable extended thinking and try again. Extended thinking is enabled but the selected model doesn't support it. Select a model that supports extended thinking or disable extended thinking.
An unexpected error occurred. Try again later or contact your administrator if the problem persists. Unknown issue communicating with the AI model. Try again later.
The AI model took too long to respond and timed out. The AI model takes too long to respond to the request. Try again later.
The AI model is currently processing too many other requests. Try again later. The number of requests to the AI model exceeds the service quota. Reduce the number of calls to the AI model and try again.
This file exceeds the sheet limit. Expected {0} or fewer sheets but received {1}. Combine or remove unnecessary sheets and try again. The workbook contains more sheets than the maximum allowed. Combine or remove unnecessary sheets and try again.
This file exceeds the row limit. Expected {0} or fewer rows but received {1}. Reduce the number of rows or process a smaller data range and try again. The spreadsheet contains more rows than the maximum allowed. Reduce the number of rows or process a smaller data range and try again.
This file exceeds the column limit. Expected {0} or fewer columns but received {1}. Reduce the number of columns or process a smaller data range and try again. The spreadsheet contains more columns than the maximum allowed. Reduce the number of columns or process a smaller data range and try again.
Document corrupted or could not be read. The spreadsheet file is corrupt or cannot be opened. Verify the file is a valid Excel file and try again.
This file is password protected and cannot be opened. Remove the password protection and try again. The spreadsheet file has password protection enabled. Remove the password protection from the file and try again.
The response took longer than the supported time limit for this extraction mode. This can happen with large documents or complex prompts. Try using a smaller document, adjust your prompt to process less data, or using long-running mode. Extraction exceeded the allowed time limit. Use a smaller spreadsheet or simplify the prompt to process less data.
The response reached the processing limit. This may occur when the model needs too many steps to process your file. Try a smaller document or revise the prompt to handle less data. Extraction required more model interactions than allowed. Use a smaller spreadsheet or revise the prompt to reduce the number of steps required.
The AI skill could not process the response structure. Remove any output format guidance and try again. The model response did not match the expected format, likely because the prompt includes output formatting instructions. Remove any output format or JSON structure instructions from the prompt and try again.
This model cannot be used for spreadsheet extraction. Switch to a different model in the Settings panel and try again. The selected model does not support tool calling, which is required for spreadsheet extraction. Select a model that supports tool calling in the AI skill Settings panel.
The service is handling too many requests right now. Try again in a few minutes. The service is temporarily overloaded with requests. Wait a few minutes and try again. If the problem persists, reduce the frequency of requests or contact your administrator.
The extraction result exceeds the {0} size limit. Try updating your prompt to extract fewer fields or use a smaller spreadsheet. The spreadsheet extraction response exceeded the maximum allowed size. Update the prompt to extract fewer fields or use a smaller spreadsheet.

Feedback