First-party app
DocuMerge

DocuMerge

Generate documents from DocuMerge templates and routes, manage their fields and delivery methods, and run its PDF tools from a workflow.

stable Documents & Files

About

DocuMerge ships in the w6w first-party pack. It declares 36 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.documerge
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Documents & Files

Overview

DocuMerge generates documents (PDF, Word, Excel, HTML, images, email) by merging data into templates. This app lets a workflow drive it end to end.

It manages documents (templates) and routes (packs that merge several documents into one): list, fetch, create, update, copy and delete them, and manage each one’s merge fields and delivery methods (webhook, email and so on). A merge is queued by the document’s or route’s key with the field values to merge in, and DocuMerge delivers the result through the configured delivery methods.

It also exposes the PDF tools: combine several files into one PDF or Word file, compress, convert, password-protect and split PDFs. Tool results come back as base64 so a later step can store or send them.

Build with DocuMerge

Three routes to the same 36 actions. The Workflow tab is generated from DocuMerge's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Copy Document

document-copy

Duplicate a document under a new name.

Create Document

document-create

Create a document (merge template). Name, template type and output format are required.

Delete Document

document-delete

Delete a document and its merge key.

Create Document Delivery Method

document-delivery-method-create

Add a delivery method (webhook, email, …) to a document.

Delete Document Delivery Method

document-delivery-method-delete

Remove a delivery method from a document.

List Document Delivery Methods

document-delivery-method-list

List where a document's merge results are delivered.

Update Document Delivery Method

document-delivery-method-update

Change a document delivery method's type or settings.

Create Document Field

document-field-create

Add a merge field to a document.

Delete Document Field

document-field-delete

Remove a merge field from a document.

List Document Fields

document-field-list

List the merge fields of a document.

Update Document Field

document-field-update

Rename a document merge field or change its map.

Get Document File

document-file-get

Fetch the file record (including a temporary download URL) of a document.

Get Document

document-get

Fetch one document, including its HTML and latest generated file.

List Documents

document-list

List the documents (merge templates) in the account.

Merge Document

document-merge

Queue a merge of a document by its merge key. The merge runs asynchronously; results go to the document's delivery methods.

Update Document

document-update

Replace a document's settings. The vendor requires name, type and output on every update.

Create Route

route-create

Create a route.

Delete Route

route-delete

Delete a route.

Create Route Delivery Method

route-delivery-method-create

Add a delivery method to a route.

Delete Route Delivery Method

route-delivery-method-delete

Remove a delivery method from a route.

List Route Delivery Methods

route-delivery-method-list

List where a route's merge results are delivered.

Update Route Delivery Method

route-delivery-method-update

Change a route delivery method's type or settings.

Create Route Field

route-field-create

Add a merge field to a route.

Delete Route Field

route-field-delete

Remove a merge field from a route.

List Route Fields

route-field-list

List the merge fields of a route.

Update Route Field

route-field-update

Rename a route merge field or change its map.

Get Route

route-get

Fetch one route with its rules.

List Routes

route-list

List routes (a route merges several documents into one pack).

Merge Route

route-merge

Queue a merge of a route by its key. Asynchronous; results go to the route's delivery methods.

List Route Rules

route-rule-list

List the rules of a route.

Update Route

route-update

Replace a route's settings. The vendor requires the name on every update.

Combine Files

tool-combine

Combine several files into one PDF or Word file.

Compress PDF

tool-pdf-compress

Compress a PDF.

Convert PDF

tool-pdf-convert

Convert a PDF (DocuMerge's PDF convert tool).

Encrypt PDF

tool-pdf-encrypt

Password-protect a PDF.

Split PDF

tool-pdf-split

Extract, or remove, page ranges of a PDF.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying DocuMerge's real ids.

{
  "manifestVersion": "2",
  "name": "documerge-example",
  "steps": [
    {
      "id": "document-copy",
      "uses": {
        "app": "io.w6w.documerge",
        "action": "document-copy",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "documentId": "<documentId>",
        "name": "<name>"
      }
    }
  ]
}

Here are some of the things you can do

  • Copy Document

    perform
    document-copy
  • Create Document

    perform
    document-create
  • Create Document Delivery Method

    perform
    document-delivery-method-create
  • List Document Delivery Methods

    search
    document-delivery-method-list
  • Update Document Delivery Method

    perform
    document-delivery-method-update

+31 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for DocuMerge, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to DocuMerge. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "document-copy",
  payload: {
    documentId: "<value>",
    name: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action document-copy --payload '{"documentId":"<value>","name":"<value>"}'

Give an AI agent DocuMerge — without giving it DocuMerge's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.documerge#document-copy",
    "input": {
      "documentId": "<documentId>",
      "name": "<name>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's DocuMerge connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

DocuMerge's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. DocuMerge itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

DocuMerge declares its own checks, so its health is a property of the app rather than something the host guesses at.

dependency

DocuMerge API reachable

Calls GET /api/documents without a token and reads DocuMerge's own answer. The documented 401 "Unauthenticated." body proves the API is serving.

service

DocuMerge platform status