Class FileTriggerExecutor
java.lang.Object
ai.nervemind.app.executor.FileTriggerExecutor
- All Implemented Interfaces:
NodeExecutor
Executor for the "fileTrigger" node type - initiates workflow execution on
file system events.
Monitors specified directories for file changes and triggers workflow
execution
when matching events occur. The actual file monitoring is performed by
FileWatcherService; this executor handles both automatic
event-triggered
runs and manual test executions.
Node Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| watchPath | String | - | Required. Directory path to monitor |
| filePattern | String | "*" | Glob pattern to filter files (e.g., "*.pdf", "report-*.xlsx") |
| eventTypes | String | "CREATE,MODIFY" | Comma-separated list: CREATE, MODIFY, DELETE |
Execution Modes
This executor operates in two modes:
- File Event Mode: Triggered automatically when a file event occurs. Input contains filePath, fileName, directory, and eventType.
- Manual Mode: Triggered via UI "Run" button for testing. Provides configuration validation but no actual file data.
Output Data
| Key | Type | Description |
|---|---|---|
| watchPath | String | The monitored directory path |
| pathExists | Boolean | Whether the path exists on disk |
| isDirectory | Boolean | Whether the path is a valid directory |
| filePattern | String | The glob pattern being used |
| eventTypes | String | Monitored event types |
| triggeredAt | String | ISO timestamp |
| triggerType | String | Always "file_event" |
| mode | String | "file_event" or "manual" |
File Event Output (when triggered by actual file event)
- filePath - Full path to the affected file
- fileName - Just the file name
- directory - Parent directory
- eventType - CREATE, MODIFY, or DELETE
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFileTriggerExecutor(org.springframework.beans.factory.ObjectProvider<FileWatcherService> fileWatcherServiceProvider) Creates a new file trigger executor. -
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
-
FileTriggerExecutor
public FileTriggerExecutor(org.springframework.beans.factory.ObjectProvider<FileWatcherService> fileWatcherServiceProvider) Creates a new file trigger executor.- Parameters:
fileWatcherServiceProvider- provider for the file watcher service
-
-
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").
-