Template: customer onboarding (Operations)
Document information
- Canonical URL:
/docs/12_workflows/40_template-customer-onboarding - Version:
2026-10-09 - Tags:
operations,processflow,template,guides
Copyable ProcessFlow pattern for a customer onboarding journey that feeds My Work. This is documentation for tenant admins and Trace — it does not insert demo requests into employee queues. Clone the steps in ProcessFlow, connect real integrations, then run with real or sandbox input you choose.
Outcome
An employee sees a My Work card, understands why they are involved, and Approves or Rejects a real process human gate. That decision is stored on the gate. CRM activation belongs in the continuation branch, not in the next sequential step after openApproval. Create the gate with continuation: {}. The new execution receives process_input.operations_continuation. Approved runs write CRM and call tf.operations.complete. Denied runs call openAction on the same external_id. Timeout runs call openException or complete. Failures before the gate open an Exception card with Retry when input was stored.
Process shape
| Step | Kind | Operations write |
|---|---|---|
| 1. Intake | Automatic | updateProgress — journey_beat: received |
| 2. Enrich from CRM | Automatic | updateProgress — checks + system_refs |
| 3. AI document skim (optional) | AI-assisted | updateProgress with ai_summary |
| 4. Credit / risk decision | Human approval | createApprovalGate with continuation: {}, then openApproval with that human_request_id, owner_user_id, and details. Return. |
| 5. After the decision | Continuation of this process | Branch on process_input.operations_continuation. Approved: CRM write and complete. Denied: openAction. Timeout: openException or complete. |
| 6. Failure handler | Exception | openException |
| 7. Finish | Automatic | complete |
Set process category to business.
Stable identity
const external_id = `crm-onboarding-${customer_id}`;
Reuse the same external_id on every upsert so My Work updates one card.
Step sketches
Progress after enrich
await tf.operations.updateProgress({
external_id,
subject: `Onboard ${customer_name}`,
party: customer_name,
process_name: "Customer onboarding",
status: "open",
attention: "info",
journey_beat: "in_process",
journey_stage_label: "Documents checked",
checks: [
{ label: "Company registration", state: "verified" },
{ label: "Credit pack", state: "pending" }
],
system_refs: [{ system: "CRM", label: "Account", external_ref: customer_id }]
});
Open approval
const gate = await tf.operations.createApprovalGate({
idempotency_key: `onboarding-approval-${external_id}`,
approver_user_id: approverUserId,
prompt: `Approve onboarding for ${customer_name}?`,
continuation: {},
payload: { customer_id, customer_name }
});
if (gate.status !== "pending") {
return { success: true, data: { status: gate.status, decision: gate.decision, human_request_id: gate.human_request_id } };
}
await tf.operations.openApproval({
external_id,
subject: `Approve onboarding for ${customer_name}`,
party: customer_name,
process_name: "Customer onboarding",
human_request_id: gate.human_request_id,
owner_user_id: approverUserId,
details: [
{ label: "Customer", value: customer_name },
{ label: "Customer id", value: customer_id }
],
why_visible: "You own customer activation for this region.",
consequence: "Approving starts the next run, which writes CRM.",
required_action: "Confirm credit pack and approve or reject.",
journey_beat: "in_process",
journey_stage_label: "Activation decision",
actor_hint: "person"
});
return {
success: true,
data: { status: "pending_approval", human_request_id: gate.human_request_id, external_id },
message: "Submitted for approval."
};
Exception
await tf.operations.openException({
external_id,
subject: `Onboarding blocked for ${customer_name}`,
process_name: "Customer onboarding",
required_action: "Fix the CRM write error, then Retry or Pass to Delivery.",
why_visible: "Activation failed in CRM after approval.",
journey_beat: "systems"
});
Complete
await tf.operations.complete({
external_id,
subject: `Onboarded ${customer_name}`,
process_name: "Customer onboarding"
});
Verify before go-live
tf.operations.validate({ … attention: "approval", human_request_id: gate.human_request_id })while that gate is pending →approve_buttons_would_show: true- Run once with a test account; open My Work as
approver_user_id - Confirm Approve sets the gate to
answered/approvedand the continuation run writes CRM - Force a failure path and confirm Exception copy (no raw stack on the primary panel)