Skip to content

Ask User ​

The Ask User node is designed to prompt the user for input during workflow execution. It supports two distinct modes of interaction: a Simple Question directly displayed to the user or a more dynamic AI-driven data collection session that utilizes a language model to gather multiple fields.

Overview ​

This node is typically used when workflow execution requires human input before proceeding. The communication is facilitated via SignalR and displayed through the web-based workflow interface.

Configuration ​

Users configure this node via the standard modal UI. The following fields are presented depending on the selected "Ask Method":

Ask Method ​

  • Label: Ask Method
  • Input Type: picklist
  • Options:
    • Simple Question
    • Use AI
  • Default Value: Simple Question
  • Description: Select the method for asking the user a question.
  • Visible When: * (Always visible)

For Simple Question Method ​

Question ​

  • Label: Question
  • Input Type: text
  • Default Value: What do you need to proceed?
  • Description: Enter the question to present to the user.
  • Visible When: Simple Question

For Use AI Method ​

Description ​

  • Label: Description
  • Input Type: text
  • Default Value: Collecting user details
  • Description: Describes the purpose of collecting the user input. Used in the system prompt sent to the AI.
  • Visible When: Use AI

Required Fields ​

  • Label: Required Fields
  • Input Type: key-value list (dictionary)
  • Description: A dictionary where each key is a required field name and each value describes the expected input type (e.g., "City": "Enter a city name").
  • Visible When: Use AI

Runtime Behavior ​

Simple Question Mode ​

  1. Displays the user-specified Question to the end user.
  2. Waits for a response via SignalR and stores the result in:
    • data["UserAnswer"]

Use AI Mode ​

  1. Sends a system prompt to the AI describing the required fields and context.
  2. Uses the AI to generate a natural-language question.
  3. Displays the AI-generated message to the user.
  4. Parses the response using multiple attempts to extract valid JSON fields.
  5. Re-prompts the user for missing fields if necessary (up to 3 retries).
  6. Final result is stored in:
    • data["RequiredFields"] (as a dictionary of key-value pairs)

Outputs ​

  • The output of the node is written to taskParameters.data:
    • "UserAnswer" (if Simple Question was used)
    • "RequiredFields" (if Use AI was used)

Notes ​

  • This node requires a valid OpenAI service account connection string.
  • If the connection is lost or the user does not respond within 5 minutes, the task will timeout.
  • The system supports ongoing conversations via the ChatWorkflowHub and handles session-based prompts using ConnectionId and SessionId.

Example Use Cases ​

  • Prompting a user to approve a workflow step before continuing.
  • Collecting contact or project details as part of an onboarding flow.
  • Interactively gathering structured input using a conversational AI assistant.

Errors and Troubleshooting ​

IssueCauseResolution
ConnectionId not found in task dataThe session context was not correctly passed to the node.Ensure the node is triggered in a real-time session with proper SignalR setup.
Required AI Service account not foundInvalid or missing service account credentials.Configure the appropriate OpenAI credentials in the service registry.
User did not respond within 1 minuteNo input received during timeout period.Prompt user again or allow retry logic in parent workflow.

Developer Notes ​

  • Node Type: task
  • Task Type: AskUser
  • Hub used: ChatWorkflowHub
  • AI interaction relies on: AISingleReequest, Chat methods
  • Result stored under JobTask.data

Tentech 2024