DocsAutomator icon

DocsAutomator

Create and manage documents with DocsAutomator

Actions9

Document → Create

AI-generated

Overview

This node operation creates a new document using a specified automation in DocsAutomator. It allows users to map placeholder values and define line items (dynamic table rows) for the document. Users can also choose to generate a preview of the document or process the creation asynchronously, receiving a job ID for tracking. This operation is useful for automating document generation based on predefined templates and data sources, such as generating invoices, reports, or contracts with dynamic content.

Use Case Examples

  1. Generate an invoice document by selecting an automation, mapping customer and order details to placeholders, and defining line items for purchased products.
  2. Create a contract document preview to review the content before finalizing, using placeholder values for client information and contract terms.
  3. Asynchronously create a report document and track its processing status using the returned job ID.

Properties

Name Meaning
Automation Name or ID Select the automation to use for document creation. Choose from the list or specify an ID using an expression.
Placeholder Values Map values to the available placeholders in the selected automation to populate the document content.
Line Items Define line items (dynamic table rows) for the document, specifying line item types and providing JSON arrays of objects representing each row with placeholder key-value pairs.
Preview Mode Whether to generate a preview of the document instead of the final version.
Async Processing Whether to process the document creation asynchronously, returning a job ID for tracking.

Output

JSON

  • documentId - The ID of the created document.
  • status - The status of the document creation process.
  • isPreview - Indicates if the document is a preview.
  • async - Indicates if the document creation is processed asynchronously.
    lineItems - Dynamic line item arrays keyed by their line item type names, containing objects with placeholder key-value pairs.

Dependencies

  • DocsAutomator API authentication token

Troubleshooting

  • Ensure the automation ID is selected; otherwise, the node will throw an error requesting the selection of an automation.
  • Validate that the placeholder values and line items JSON are correctly formatted; invalid JSON or non-array line items will cause errors.
  • If asynchronous processing is enabled, track the returned job ID to monitor document creation status.
  • Common error messages include missing required parameters like automation ID or title, invalid JSON format for line items, and unknown operations or resources. Resolving these involves providing the required inputs and correcting JSON syntax.

Discussion