Reusable Workflows
Publish versioned execution policies, launch runs, and monitor bulk jobs.
Reusable workflows pin templates, participant roles, signing methods, e-stamping, notifications, and optional internal approval into a versioned execution policy. Use them when callers should supply only recipients and variable field values.
Lifecycle
POST /workflowscreates a definition and version 1 draft.PATCH /workflows/{workflowId}edits the current draft. Editing a workflow after publication creates a new draft version.POST /workflows/{workflowId}/publishvalidates its templates and makes the draft immutable. The previously published version is archived.POST /workflows/{workflowId}/runsalways launches the latest published version and returns the created envelope plus its approval state.
The API key needs workflows:read for list/get and workflows:write for create,
update, publish, and run.
const workflow = await client.workflows.create({
name: "NDA approval",
config: {
documents: [{ templateId: "tpl_123", label: "NDA" }],
participants: [{
key: "signer",
label: "Signer",
order: 1,
signatureMethod: "electronic",
}],
execution: { mode: "sequential", emailNotifications: "all" },
approvalStages: [],
},
});
await client.workflows.publish(workflow.definition.id);
const run = await client.workflows.run(workflow.definition.id, {
title: "NDA — Acme",
recipients: [{
participantKey: "signer",
name: "Asha Rao",
email: "asha@example.com",
}],
idempotencyKey: "nda-acme-2026-07",
});idempotencyKey on a single run is accepted by the public contract. Bulk runs
require one and deduplicate per API-key user.
Bulk runs
Queue structured rows with POST /workflows/{workflowId}/bulk-runs, or send CSV
text with POST /workflows/{workflowId}/bulk-runs/csv. Both require a published
workflowVersionId, bulkSend:write, and enough estimated credits.
CSV validation is all-or-nothing:
202means every row validated and the returned job was queued.422returnsaccepted: false, detected headers, and row/column errors. No job is created and no credits are consumed.
Poll GET /bulk-jobs/{jobId} for counters and row results. A job can be
cancelled only while validating or queued. POST /bulk-jobs/{jobId}/retry-failed
requeues failed rows with fewer than three attempts. Download failures from
GET /bulk-jobs/{jobId}/errors.csv.
const job = await client.workflows.createBulkRun(workflowId, {
workflowVersionId: "wv_123",
idempotencyKey: "july-nda-batch",
rows: [{
rowNumber: 1,
title: "NDA — Acme",
recipients: [{
participantKey: "signer",
name: "Asha Rao",
email: "asha@example.com",
}],
}],
});
const progress = await client.bulkJobs.get(job.id);
if (progress.failedRows > 0) {
const csv = await client.bulkJobs.downloadErrors(job.id);
}See the generated endpoint reference below this guide for every request and response field, including e-stamp policy and CSV validation schemas.