App Request
Sends a custom request to an application instance. The flow may request something from the Bot's UI Application with this node.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Request - The request to be sent to the application. The request is a custom JSON object specific to the application.
Output
- Response - The response that is received from the application. The response is a custom JSON object specific to the application.
Options
- Timeout - The amount of time (in seconds) until the request times out. The default value is 10 seconds.
How It Works
The App Request node enables bidirectional communication between the automation and the Robomotion App UI. It sends a request to the UI and waits for a response, allowing the automation to ask for user input or additional data. The execution follows these steps:
- Delay Before - Waits for the specified delay before execution (if configured)
- Context Validation - Validates the application context:
- Checks for
$AppID$global variable - Checks for
$AppUserID$global variable - Retrieves the session ID from the message
- Checks for
- Request Processing - Retrieves and serializes the request data to JSON
- Message Creation - Creates a request message with:
- New unique message ID
- Application ID, User ID, Session ID
- Robot ID and version
- Encrypted payload
- Request Transmission - Sends the request through the websocket connection
- Response Waiting - Waits for the response from the UI:
- With timeout if specified (default 10 seconds)
- Blocks until response received or timeout occurs
- Response Processing - Parses the received response and stores it in the output variable
- Delay After - Waits for the specified delay after execution (if configured)
This enables interactive automation where the UI can provide input during execution.
Requirements
- Robomotion Deskbot - This node only works with Robomotion Deskbot
- Application Context - Must be running within a Robomotion App instance
- App In Node - Requires an App In node earlier in the flow to establish context
- Network Connection - Active websocket connection to Robomotion service
- UI Implementation - The App UI must be implemented to handle and respond to requests
Error Handling
| Error Code | Description | Common Cause |
|---|---|---|
Core.Application.AppRequest.ErrOnCreate | Configuration parse error | Invalid node configuration or corrupted flow |
Core.Application.AppRequest.ErrOnConnect | Connection error | Failed to connect to application service |
Core.Application.AppRequest.ErrOnMessage | Message parse error | Invalid input message format |
Core.Application.AppRequest.InvalidAppID | Application ID not found | Running outside of application context |
Core.Application.AppRequest.InvalidUID | User ID not found | Global variable $AppUserID$ not set |
Core.Application.AppRequest.SessionNotFound | Session ID not found | Session expired or invalid |
Core.Application.AppRequest.InvalidBody | Invalid body data | Request data cannot be retrieved from input variable |
Core.Application.AppRequest.PayloadErr | Payload serialization error | Request data cannot be converted to JSON |
Core.Application.AppRequest.ErrRequest | Request error | Request failed (timeout, connection lost, etc.) |
Core.Application.AppRequest.OutputMarshal | Output marshalling error | Failed to serialize the response |
Usage Examples
Example 1: Request User Confirmation
Ask the user to confirm before proceeding:
Request: {
"type": "confirmation",
"message": "Found {{count}} records. Proceed with processing?",
"options": ["Yes", "No"]
}
Response: {
"confirmed": true
}
Use the response to conditionally continue or stop the automation.
Example 2: Request User Input
Ask for additional information from the user:
Request: {
"type": "input",
"prompt": "Enter the customer ID to process:",
"field": "customerId"
}
Response: {
"customerId": "12345"
}
Use the provided customer ID in subsequent automation steps.
Example 3: Request Selection
Ask user to select from options:
Request: {
"type": "select",
"message": "Which report format do you want?",
"options": ["PDF", "Excel", "CSV"]
}
Response: {
"format": "Excel"
}
Generate the report in the selected format.
Example 4: Request File Selection
Ask user to select a file from their system:
Request: {
"type": "file",
"message": "Select the data file to process",
"extensions": [".csv", ".xlsx"]
}
Response: {
"filePath": "C:\\Users\\User\\Documents\\data.csv"
}
Process the user-selected file.
Usage Notes
- Blocking Operation - The automation pauses and waits for the response
- Timeout - Request will fail if no response received within the timeout period
- JSON Format - Both request and response must be valid JSON
- Encryption - All communication is automatically encrypted
- UI Requirements - The App UI must implement request handlers
- Session Context - Request is tied to the specific session
- Single Response - Each request expects exactly one response
Tips
- Set Appropriate Timeout - Adjust timeout based on expected user response time
- Clear Instructions - Provide clear, specific instructions in your requests
- Type Field - Include a "type" field to help UI route requests to appropriate handlers
- Error Handling - Handle timeout errors gracefully with Try-Catch nodes
- Default Values - Consider providing default values in case of timeout
- Progress Updates - Use App Log or App Push before requests to provide context
- Validate Responses - Always validate the response data before using it
- User Experience - Don't overuse requests; too many interruptions frustrate users