Description:
This step fetches responses from the AI step for the questions asked.
Inputs
- aiProvider – AI provider
- actAs - Act as a persona
- prompt - Prompt
- imageFiles - image file attachments
- maxTokens - Max token value
- temperature - Temparature value
- varGlobalStoreResult - variable or global to store the AI response
Returns
- True – expression evaluates to a true result
- False – expression evaluates to a false result
Usage:

Example:
Let’s build and execute the “clsAskAIDef” example. In this example, we shall provide a chess puzzle, and the “AskAI” step shall respond with the puzzle name and the solution to resolve it.
- Create a new definition called “clsAskAIDef" and open the definition in designer mode.
- Drag the “UpdateVariable and AskAI” step to the canvas.
- Connect the dots between the “Start” and “AskAI” steps, as shown above.
- Define a variable or a global to store the result.
- Click the “UpdateVariable ” step to configure its “Required” properties. Provide a name for the step. Select the “Optional” tab. Provide the variable name and the image file path on the application server. Select “Yes” if the variable value has a C# expression to evaluate. Click the Save button.

- The chess puzzle image used in the example is included below.

- Click the “AskAI” step to configure its “Required” properties. Provide a name for the step. Select the AI provider from the drop-down list. Provide the text prompt. Provide a variable or a global to store the AI response. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the “AskAI” step to configure its “Optional” properties. Provide a persona description. Provide the max token value. Set a temperature value between 0 and 2 to control the "creativity" of the generated text. Provide the image file path. Click the Save button.

- Click the button to provide the image file path on the application server. A pop-up window is displayed for configuration. Click the Add Row (+) button to insert an empty row. Provide the variable value. Click the Save button. You can add multiple file lists by using the Add Row button.

- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, and then execute it. The “AskAI” step should fetch the result and store it in the variable or global as configured.

Definition Sample:
You may download and extract the sample definition(s) from the link here and later import them (drag-and-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
Note: Please verify and complete the process steps for any missing configurations, such as file path references and database connections, after import. Then, save the definition to confirm the changes.
Click here to download the sample file.