Class HttpRequestExecutor
java.lang.Object
ai.nervemind.app.executor.HttpRequestExecutor
- All Implemented Interfaces:
NodeExecutor
Node executor for HTTP Request operations.
This executor makes HTTP calls to external APIs and services. It supports all standard HTTP methods, custom headers, authentication, and template interpolation for dynamic values.
Node Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | String | Yes | The URL to call (supports {{var}} interpolation) |
| method | String | No | HTTP method: GET, POST, PUT, DELETE, etc. (default: GET) |
| headers | Map | No | Custom HTTP headers |
| body | String | No | Request body (supports interpolation) |
| timeout | Integer | No | Timeout in seconds (default from settings) |
Output Data
The executor outputs a Map with the following keys:
- statusCode - HTTP status code (e.g., 200, 404)
- body - Response body as string
- headers - Response headers as Map
- success - Boolean, true if status is 2xx
- json - Response body (if detected as JSON)
Template Interpolation
URL and body support {{variableName}} syntax for dynamic values:
- Variables from input data (previous node output)
- Workflow settings
- Stored credentials (referenced by name)
Authentication
For authenticated requests, either:
- Assign a credential to the node (adds Bearer token header)
- Use
{{credentialName}}in headers/URL for manual auth
Performance
Uses virtual threads (Project Loom) for efficient non-blocking I/O.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHttpRequestExecutor(ai.nervemind.common.service.SettingsServiceInterface settingsService) Creates a new HTTP request executor with configured timeouts. -
Method Summary
Modifier and TypeMethodDescriptionexecute(ai.nervemind.common.domain.Node node, Map<String, Object> input, ExecutionService.ExecutionContext context) Executes the business logic for this node type.Unique identifier for the node type this executor handles.
-
Constructor Details
-
HttpRequestExecutor
public HttpRequestExecutor(ai.nervemind.common.service.SettingsServiceInterface settingsService) Creates a new HTTP request executor with configured timeouts.- Parameters:
settingsService- the settings service for timeout configuration
-
-
Method Details
-
execute
public Map<String,Object> execute(ai.nervemind.common.domain.Node node, Map<String, Object> input, ExecutionService.ExecutionContext context) Description copied from interface:NodeExecutorExecutes the business logic for this node type.- Specified by:
executein interfaceNodeExecutor- Parameters:
node- The node definition containing parameters and configuration. UseNode.parameters()to access user settings.input- Combined output from all upstream nodes that connected to this node. For simple flows, this contains the direct predecessor's output. For merge nodes, it contains combined data.context- Verification context providing access to workflow-scoped services, logger, and execution metadata.- Returns:
- A Map containing the results of this node's execution.
Keys in this map become available variables for downstream nodes.
Note: Returningnullis treated as an empty map.
-
getNodeType
Description copied from interface:NodeExecutorUnique identifier for the node type this executor handles. This must match the 'type' field in the JSON definition of the node.- Specified by:
getNodeTypein interfaceNodeExecutor- Returns:
- The unique type string (e.g., "httpRequest", "llmChat").
-