Class CsvExecutor

java.lang.Object
ai.nervemind.app.executor.CsvExecutor
All Implemented Interfaces:
NodeExecutor

@Component public class CsvExecutor extends Object implements NodeExecutor
Node executor for reading and writing CSV files.

Supports reading CSV files into structured row data, writing structured data to CSV files, and parsing CSV content from string input. Uses only built-in Java I/O — no external dependencies required.

Node Configuration

CSV node parameters
Parameter Type Required Description
operation String Yes READ or WRITE
filePath String Yes Path to CSV file
delimiter String No Column delimiter (default: comma)
hasHeader Boolean No First row is header (default: true)
content String No CSV string to parse (alternative to filePath for READ)
data String No JSON rows to write (WRITE operation)
columns String No Comma-separated column names for WRITE header

Output Data

  • rows - List of row maps (READ) keyed by column name
  • columns - List of column names
  • rowCount - Number of rows
  • success - Boolean
  • filePath - Written file path (WRITE only)
Since:
1.1.0
See Also:
  • Constructor Details

    • CsvExecutor

      public CsvExecutor()
      Default constructor.
  • 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: NodeExecutor
      Executes the business logic for this node type.
      Specified by:
      execute in interface NodeExecutor
      Parameters:
      node - The node definition containing parameters and configuration. Use Node.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: Returning null is treated as an empty map.
    • getNodeType

      public String getNodeType()
      Description copied from interface: NodeExecutor
      Unique identifier for the node type this executor handles. This must match the 'type' field in the JSON definition of the node.
      Specified by:
      getNodeType in interface NodeExecutor
      Returns:
      The unique type string (e.g., "httpRequest", "llmChat").