AskAI Step
Description:
The Ask AI workflow step sends a prompt to the configured AI provider and returns the generated response.
The step supports:
- Natural language questions
- Prompt engineering using system personas ("Act as")
- Image attachments
- Word document text extraction
- PDF image conversion for vision-capable AI models
- Configurable AI generation settings
- Storage of both processed and raw AI responses
This step can be used for:
- Question answering
- Document analysis
- Image understanding
- Report generation
- Content creation
- Business process automation
- AI-assisted decision making
Inputs
- aiProvider – Select the AI Provider configured in FlowWright.
- actAs - Optional persona or system instruction describing how the AI should behave.
- prompt - The question or instruction sent to the AI model.
- imageFiles - Optional image or document attachments provided to the AI.
- extractWordFileText - When enabled, it extracts text from attached Microsoft Word documents before sending them to the AI.
- convertPdfPagesToImages - When enabled, it converts each PDF page into images for AI vision models.
- maxTokens - Maximum number of tokens generated by the AI response.
- temperature - Controls the randomness of the AI response. Lower values are more deterministic, while higher values generate more creative responses.
- varGlobalStoreResult - Variable or Global variable used to store the processed AI response.
- varGlobalRawResult - Optional Variable or Global variable used to store the complete raw AI provider response.
Returns
- True – Step executed successfully.
- False – Step execution failed.
Usage:
The Ask AI step is typically placed after data has been collected within a workflow.

The workflow can dynamically build prompts using variables, form values, previous workflow outputs, or data retrieved from external systems.
The generated response can then be used by later workflow steps to:
- Update variables
- Populate forms
- Generate documents
- Send emails
- Make workflow decisions
- Invoke additional AI processing
Example:
Let’s build and execute the “clsAskAIDef” example. In this example, we present a chess puzzle, and the “AskAI” step responds with the puzzle's name and solution.
- 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. Enter the variable name and the image file path on the application server. Select “Yes” if the variable value contains a C# expression to evaluate. Click the Save button.

- The chess puzzle image from 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. Enter the text prompt. Specify 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. Set the maximum token value. Set a temperature 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 specify the image file path on the application server. A configuration pop-up window appears. Click the Add Row (+) button to insert an empty row. Enter the variable value. Click the Save button. You can add multiple file lists by using the Add Row button.

- The “Logging” configuration is necessary for documentation and also measures workflow progress and 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 Process Instance and execute it. When the workflow reaches the Ask AI step, the configured AI provider processes the prompt together with any supplied attachments. The generated response is stored in the configured workflow variable or global variable. If configured, the complete provider response—including metadata and usage information—is stored in the raw result variable.

Tips:
- Use Act As to improve response quality.
- Keep prompts specific and concise.
- Use workflow variables in prompts to enable dynamic AI interactions.
- Lower Temperature values produce consistent outputs.
- Higher Temperature values encourage creative responses.
- Store the raw response when troubleshooting AI interactions or capturing provider metadata.
- Vision-enabled AI providers can analyze attached images and converted PDF pages.
Notes:
- An AI Provider must be configured before using this step.
- Some AI providers may impose limits on attachment size, token count, or supported file formats.
- The maximum response length depends on the configured AI provider.
- Processing large documents or multiple images may increase execution time and AI usage costs.
Definition Sample:
You may download the sample definition(s) from the link provided and later import them into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
Note: Verify and complete any missing configuration after importing the sample, including:
- AI Provider selection
- Variable mappings
- Prompt content
- File attachment references
- Environment-specific settings
After verifying the configuration, save the Process Definition before execution.
Click here to download the sample file.