Automations
Automate document work, your way.
Build automations in the dashboard or run the same work from the API, SDKs, CLI, MCP, webhooks and embeds. Start from events or schedules, and add branches, waits, approvals and agent steps.
Automations
Build automations in the dashboard or run the same work from the API, SDKs, CLI, MCP, webhooks and embeds. Start from events or schedules, and add branches, waits, approvals and agent steps.
Overview
Every option works on the same documents. Your server calls the API, an SDK or the CLI with one key. An MCP client can run the same operations for you. Signed webhooks tell your service when something changes, a single request can run several tools on one document, and embeds put a tool or the viewer inside your own app. For work that should run by itself, build an automation in the dashboard.
An automation starts when something happens: a document is uploaded or ready, a secure link is created or opened, a page is viewed, a file is downloaded or printed, a form is submitted, an annotation is added or resolved, a room event occurs, an agent run ends, or a signed request reaches a Generic HTTP connection. It can also start when you press Run now, or on a schedule: once, at an interval, or on a calendar in your time zone.
Steps can process a document with any tool, create, share or revoke a secure link, send an email or in-app notification, generate an export or ask one of your agents. Branches choose a path from earlier values, waits pause the run, and approval steps hold it until the named people approve. Every run and step is saved, so you can follow it, retry a step, cancel it or run it again.
Step by step
Pick an event, Run now or a schedule. Filters limit it to the documents, links or rooms you care about.
Process, share, notify, export or ask an agent. Add a branch, a wait or an approval wherever you need one.
Publishing saves a fixed version. Later edits never change runs that have already started.
Watch every step, approve from the dashboard or the API, and get a signed webhook when a run ends.
Built in
Each run and step keeps its state, so a dropped connection never loses work.
A retried step never repeats its effect, and you choose how each step retries.
Approval steps record who decided, what they chose, why and when.
Ways to use it
Example
import { Wellfriend } from "wellfriend-document-sdk";
const wf = new Wellfriend(); // reads WELLFRIEND_API_KEY
// Needs the workflows.execute scope. The SDK sends an idempotency key, so a retried call starts one run, not two.
const run = await wf.workflowRuns.create("<workflowId>", { input: { documentId: "<documentId>" } });
console.log(run);
// Needs the workflows.approve scope. The run continues once the approval is decided.
await wf.workflowApprovals.decide("<approvalId>", { decision: "approve", reason: "Checked the totals" });More examples in every language on the Snippets page.