Document Generation

This guide explains how to set up a Document Generator AI Employee that uses GWE workflows to generate high-quality documents section by section, with collaboration, versioning, and governed downloads.

You will learn how to configure the AI Employee, design the workflow, and hand off to end users who create documents with an outline and runtime inputs, then review, regenerate, and download from Doc Writer.

Key Terms

  • GWE (workflows and agents) -- Ema's workflow system where you connect agents (file search, web search, charting, research) and define triggers/inputs. In document generation, the workflow runs once per document section.
  • Document instructions -- End-user guidance collected at creation, used for AI outline generation and applied to every section's content (topic, tone, format).
  • Section instructions -- Per-section content guidance extracted from the file used to generate the outline.
  • Outline -- List of section titles. Can be uploaded by the admin and enforced, or generated/uploaded by end users.
  • Style guide -- Visual formatting (headers, footers, font sizes/colors) extracted and applied at download. Can be enforced by the admin or added by the end user.
  • Config-time inputs -- Items provided during AI Employee configuration (admin-uploaded outline, style guide, data sources).
  • Runtime inputs -- Default trigger inputs (Document Instructions, Section Title, Section Instructions) plus any builder-added fields that end users supply at creation, shared across all sections.

Key Features

  • Modular, section-level generation -- The workflow triggers for each section, letting you source content from files, the web, research agents, or charts as needed. This enables mixed strategies within the same document.
  • Shared configuration with governance -- Admins can provide a default outline and style guide, enforce their use, configure EmaFusion™ models, enable copyright checking, and enable the AI Employee.
  • End-user authoring in Doc Writer -- Users create documents, generate or modify content per section, leave comments, tag peers, provide feedback, view or restore versions, and download in DOCX or PDF.
  • Runtime inputs at creation time -- Builders expose dynamic inputs in the workflow trigger; end users fill them during document creation (for example, competitor name or extra context files).
  • Show Work from GWE -- Using a GWE workflow for section generation lets Doc Writer surface "Show Work" without re-building that capability.
  • Multimodal responses -- You can upload images in DOCX, PDFs, HTMLs, or native image files, and they will be used as part of the responses based on relevance. You can also add or replace images inline on the Document Generator page.

How to Use

1. Create the Document Generator AI Employee

  1. Go to AI Employees and click + New AI Employee.
  2. Choose Create a Custom AI Employee and select Document Generator.
  3. A new AI Employee is created and you are redirected to the workflow builder.

This creates the AI Employee with a pre-built workflow that has a trigger and a Document Synthesis Agent (DSA). The inputs and outputs are already configured. If you want to rely completely on LLMs to generate content, you are all set. To improve focus:

  • Update the search-and-respond instructions to fit your needs.
  • Update the LLM and choose what works best for you.

If you want content generation to be more nuanced (for example, needing file search or web search for different user queries), design the workflow by adding the right nodes.

2. Design the Workflow

  1. Understand the per-section trigger. The workflow runs once per section and includes default inputs: Document instructions, Section title, Section instructions. You can add more runtime inputs as needed.
  2. Add a categorizer. Use combinations of section title and instructions to choose paths (file search vs. web search vs. charting).
  3. Connect agents and author instructions. Wire up file search, web search, market research, and charting. Provide clear prompts to each node and ensure the categorizer selects the correct branch.
  4. Prepare data source folders. Create the folders you will bind later in configuration.

Example workflow: Consider a scenario where a user is creating a comparison document with a competitor. Some sections about the user's company are generated using provided file sources. Sections about the competitor are generated using web search. A few sections need charts. The categorizer should route to the correct path based on section title and instructions.

3. Configure the AI Employee

  1. Data sources -- Link the folders created in the workflow's search nodes. The admin can update sources at any time.
  2. Style guide (optional or enforced) -- Upload a default style guide and optionally enforce its usage. Visual elements (headers, footers, font sizes/colors) apply at download.
  3. Outline (optional or enforced) -- Upload a default outline and optionally enforce its usage. If enforced, end-user options are disabled and a guidance banner appears.
  4. EmaFusion models -- Select models to be used in the AI Employee.
  5. Copyright checker -- Choose whether Ema-generated documents must pass a copyright check before download.
  6. Enable the AI Employee for usage.

4. Document Creation

Step 1 -- Basic Details: Enter the document name and document instructions (global tone/format guidance).

Step 2 -- Outline Setup: If not enforced by the admin, choose one of:

  • Generate with AI from your document instructions
  • Use admin-uploaded outline
  • Upload a file to extract the outline

Click Generate Outline and move to the next step.

Step 3 -- Additional Details: Provide an optional style guide and any workflow dynamic inputs (fields originating from your GWE workflow trigger). Click Finish Setup.

5. Authoring and Collaboration in Doc Writer

On the Doc Writer page, users can:

  • View each section's content
  • Regenerate a section by editing instructions
  • View or restore versions
  • Comment and tag teammates
  • Provide feedback
  • Download in DOCX or PDF (style guide formatting applied)

Section generation uses the GWE path, including Show Work.

Regeneration

Regeneration allows you to refine or rewrite parts of your generated document without starting from scratch.

Regenerate a Selected Portion

Highlight a specific part of a generated section to regenerate only that portion. This is faster and avoids unintended updates to surrounding content.

Regenerate Using Selected Files

Open the file selector dropdown and choose files. The regenerated content will reference only those selected files. Use this when you need content based on a particular dataset.

Include a phrase like "use web search to find..." in your regeneration query. Web search is used only when explicitly requested.

Regenerate with Images

Request images in your regeneration query (for example, "insert the product diagram here"). Images must exist within your uploaded documents. Images from web search are not supported for regeneration.

Approving or Rejecting Changes

Regenerated content does not apply automatically. After regeneration, review the updated text and click Approve to apply changes or Reject to discard them and regenerate again.

Document Generation AI Employee as an Agent

A Document Generation AI Employee can be embedded as an agent inside any GWE canvas, enabling it to both consume instructions from other agents and produce document outputs that flow downstream through the workflow.

Enabling as an Embedded Agent

  1. Navigate to the Permissions tab of a configured DocGen AI Employee.
  2. Enable the toggle that allows this AI Employee to be embedded as an agent.
  3. Provide a clear description so other builders understand its purpose.

Once enabled, the DocGen AI Employee appears in the AI Employees section of the agent list inside the GWE canvas.

Input and Output Behavior

  • The default input is document instructions, used to generate an initial outline and provide contextual guidance.
  • The output is always a Document, which can be consumed by downstream agents or published as the final workflow output.

Human-in-the-Loop (HITL) Flow

DocGen AI Employees have HITL enabled by default. Once document generation begins:

  1. The workflow triggers HITL and routes the user to the doc-writer page.
  2. The user can regenerate sections, manage versions, and collaborate.
  3. After all sections are approved, control returns to the parent GWE workflow.

Style Guide Notes

Supported

  • DOCX style guides are supported and applied during download.
  • Common Google Docs and Microsoft fonts work reliably. Fonts are embedded in downloaded files.
  • DOCX-to-PDF conversion preserves formatting via LibreOffice.
  • Headers, footers, logos, page numbers, and basic graphics are preserved.

Known Limitations

  • PDF style guides are not supported.
  • Only a fixed set of fonts is supported. Custom or rare fonts may fall back to defaults.
  • Text alignment (center/right) defined in the style guide is currently ignored.
  • Title styles are often treated as Heading 1. Avoid defining a separate "Title" style.
  • Heading levels may shift in some cases.

Practical Guidance

  • Use DOCX style guides only.
  • Prefer standard Google Docs or common Microsoft fonts.
  • Expect high-quality but not pixel-perfect fidelity between the editor and the downloaded document.

Last updated: Jul 3, 2026