Steadybase
Temporal Workflows

Client Onboarding Workflow

5-step durable workflow for new client onboarding with compliance review and approval gates.

Client Onboarding Workflow

A 5-step Temporal workflow that manages the end-to-end onboarding of new clients — from account setup through compliance review to follow-up communications.

Workflow Definition

interface ClientOnboardingInput {
  accountId: string;
  accountName: string;
  tier: 'enterprise' | 'mid-market' | 'smb';
}

Steps

Fetch Account Data Activity: fetchAccountData

Retrieves account information from the CRM — company profile, contacts, deal history, and engagement data.

Analyze Engagement Activity: analyzeEngagement

AI-powered analysis of the account's profile and use case. Determines the optimal onboarding track (standard, accelerated, or white-glove).

Generate Proposal Activity: generateProposal

Creates a customized onboarding plan with:

  • Milestones and success criteria
  • Timeline with day-by-day tasks
  • Resource assignments
  • Risk factors and mitigation plans

Compliance Review Activity: complianceReview Human-in-the-loop: Yes (approval gate)

Runs compliance checks against company policies. If issues are found, the workflow pauses and waits for human review.

// Workflow pauses here until signal received
const approved = await condition(
  () => stepApprovals['compliance-review'] !== undefined,
  '7 days'
);

On timeout: Escalates to manager with compliance hold.

Send Follow-up Activity: sendFollowup

Sends welcome communications, schedules kickoff calls, and creates follow-up tasks in the CRM.

Signals

SignalParametersPurpose
approveStep{ stepId, approved, notes }Approve or reject at compliance gate
skipStep{ stepId, reason }Skip a step (audit logged)

Queries

QueryReturns
statusCurrent step, completion %, compliance status

Features

Durable Memory Integration

The workflow stores onboarding context in the Memory Store:

  • Account profile and preferences (worker scope)
  • Onboarding template used (team scope)
  • Compliance decisions (org scope, pinned)

Compliance Hold

If compliance review identifies issues:

  1. Workflow status changes to waiting
  2. Assigned worker (Onboarding Bot) shows waiting status
  3. Notification sent via WebSocket and Slack
  4. All progress is preserved — no work is lost
  5. On approval, workflow resumes from Step 5

On this page