Nodes and API Operations (Reference) – Parameters at a Glance

This section provides a quick overview of all parameters exposed by the DocuWriter.ai n8n nodes. Each option is declared in the node’s properties (node description) and validated during execution in the execute() method .


Common Generate & Optimize Parameters

All generate (and optimize) operations share two essential inputs:

Parameter Type Required Description
sourceCode string ✔️ The snippet of code to process.
filename string ✔️ The name of the file (e.g. code.js).
// Declared in properties for all generate/optimize operations
{
  displayName: 'Source Code',
  name:       'sourceCode',
  type:       'string',
  default:    '',
  required:   true,
  description:'The source code to analyze',
  displayOptions:{
    show:{ resource:['codeDocumentation','codeTests','codeComments','umlDiagram','codeOptimization'], operation:['generate','optimize'] },
  },
},
{
  displayName:'Filename',
  name:       'filename',
  type:       'string',
  default:    'code.js',
  required:   true,
  description:'The filename for the source code',
  displayOptions:{
    show:{ resource:['codeDocumentation','codeTests','codeComments','umlDiagram','codeOptimization'], operation:['generate','optimize'] },
  },
},

📝 Code Documentation (generate)

Adds language and documentation style options:

Parameter Type Required Description
outputLanguage string Language of the generated docs (e.g. English).
documentationType options Style of docs (General, API, Library, etc.).
{
  displayName:'Output Language',
  name:       'outputLanguage',
  type:       'string',
  default:    'English',
  description:'Language for the generated documentation',
  displayOptions:{
    show:{ resource:['codeDocumentation'], operation:['generate'] },
  },
},
{
  displayName:'Documentation Type',
  name:       'documentationType',
  type:       'options',
  options: [
    { name:'General Documentation', value:'General Documentation' },
    { name:'API Documentation',     value:'API Documentation'     },
    /* …other types… */
  ],
  default:    'General Documentation',
  description:'Type of documentation to generate',
  displayOptions:{
    show:{ resource:['codeDocumentation'], operation:['generate'] },
  },
},

🧪 Code Tests (generate)

Configures test generation parameters:

Parameter Type Required Description
testFramework string Testing framework (e.g. Jest, PHPUnit).
testType string Kind of tests (e.g. unit tests, integration).
{
  displayName:'Test Framework',
  name:       'testFramework',
  type:       'string',
  default:    'auto-detect',
  description:'Testing framework to use (e.g. Jest, PHPUnit, JUnit)',
  displayOptions:{
    show:{ resource:['codeTests'], operation:['generate'] },
  },
},
{
  displayName:'Test Type',
  name:       'testType',
  type:       'string',
  default:    'unit tests',
  description:'Type of tests to generate',
  displayOptions:{
    show:{ resource:['codeTests'], operation:['generate'] },
  },
},

📊 UML Diagram (generate)

Chooses diagram style for code visualization:

Parameter Type Required Description
diagramType options ✔️ UML diagram style (Class, Sequence, etc.).
{
  displayName:'Diagram Type',
  name:       'diagramType',
  type:       'options',
  options: [
    { name:'Class Diagrams',    value:'Class Diagrams'    },
    { name:'Sequence Diagrams', value:'Sequence Diagrams' },
    { name:'Use Case Diagrams', value:'Use Case Diagrams' },
    /* …other UML types… */
  ],
  default:    'Class Diagrams',
  required:   true,
  description:'Type of UML diagram to generate',
  displayOptions:{
    show:{ resource:['umlDiagram'], operation:['generate'] },
  },
},

🔄 Generations (get / getAll)

Retrieve previous AI generations:

Parameter Type Required Description Operation
generationId string ✔️ (get) ID of the generation to retrieve. get
limit number – (getAll) Max number of generations to return (1–100). getAll
typeFilter string – (getAll) Filter results by generation type (optional). getAll
// For `generations:get`
{
  displayName:'Generation ID',
  name:       'generationId',
  type:       'string',
  default:    '',
  required:   true,
  description:'ID of the generation to retrieve',
  displayOptions:{ show:{ resource:['generations'], operation:['get'] } },
},
// For `generations:getAll`
{
  displayName:'Limit',
  name:       'limit',
  type:       'number',
  typeOptions:{ minValue:1, maxValue:100 },
  default:    20,
  description:'Number of generations to return',
  displayOptions:{ show:{ resource:['generations'], operation:['getAll'] } },
},
{
  displayName:'Type Filter',
  name:       'typeFilter',
  type:       'string',
  default:    '',
  description:'Filter generations by type (optional)',
  displayOptions:{ show:{ resource:['generations'], operation:['getAll'] } },
},

All parameters above are enforced at runtime by fetching them via this.getNodeParameter(...) in the node’s execute() implementation, ensuring valid inputs before making API requests .