Actions23
- Template Actions
- AI Tool Actions
- Form Actions
- Submission Actions
- Submitter Actions
Overview
The node integrates with an AI-powered document generation service to create various types of documents based on user input. Specifically, the "Generate Document" operation under the "AI Tool" resource allows users to generate customized documents such as non-disclosure agreements, employment contracts, invoices, and purchase agreements by providing a detailed description and additional options.
This node is beneficial in scenarios where automated, on-demand document creation is needed without manual drafting. For example:
- Automatically generating NDAs tailored to specific contractors.
- Creating employment contracts with custom clauses for new hires.
- Producing invoices or purchase agreements dynamically based on transaction details.
Properties
| Name | Meaning |
|---|---|
| Document Type | The type of document to generate. Examples include "Non-disclosure agreement", "Employment contract", "Invoice", "Purchase agreement". |
| Document Description | A detailed textual description specifying the content and requirements of the document. This should include party names, specific terms, and any special clauses needed. |
| Additional Options | A collection of optional settings to customize the generated document: - Language: Language of the document (e.g., English, French, German, Japanese, etc.) - Style: Writing style (Formal, Friendly, Simple) - Fields to Include: Comma-separated list of fields to be included in the document such as signature, date, name, address, company, etc. |
Output
The output JSON contains the response from the document generation API call. It typically includes the generated document's metadata and content details as returned by the external service. The exact structure depends on the API but generally includes identifiers, status, and possibly URLs or references to the generated document.
If the node supports binary data output (not explicitly shown here), it would represent the actual document file (e.g., PDF or DOCX). However, for this operation, the output is primarily JSON metadata about the generated document.
Dependencies
- Requires an API key credential for authenticating with the external document generation service.
- The node makes HTTP POST requests to the
/ai/documentsendpoint of the service. - No other external dependencies are indicated.
- Proper configuration of the API authentication within n8n is necessary.
Troubleshooting
Common Issues:
- Missing required properties like Document Type or Document Description will cause errors.
- Invalid or missing API credentials will prevent successful communication with the service.
- Incorrectly formatted "Fields to Include" may lead to unexpected document content.
Error Messages:
"Failed to generate document with AI: <error message>": Indicates the API request failed. Check network connectivity, API key validity, and input parameters.- Validation errors if the document description or type is empty or malformed.
Resolutions:
- Ensure all required fields are filled correctly.
- Verify API credentials and permissions.
- Validate that optional fields like language and style use supported values.
- Confirm that any comma-separated lists are properly formatted without trailing commas or extra spaces.
Links and References
- DocuSeal API Documentation (hypothetical link based on context)
- n8n Documentation on Creating Custom Nodes
- General information on Document Automation