@cfxlabsinc/b2b-services
    Preparing search index...

    Starts customer onboarding. The only supported entry point into createCustomerWorkflow.

    Callers used to start the workflow on the Temporal client directly and mint the customer id themselves (the admin-dashboard create action did exactly that). Both of those are the workflow's own concerns — the id IS the idempotency key — so they live here instead.

    Index
    instance: (...args: []) => CustomerOnboardingWorkflowService = ...
    • Start provisioning for a new customer. Returns the pre-minted cust_… id immediately — the workflow itself is fire-and-forget, so the caller can deep-link to the customer's provisioning view before any row exists.

      Functional (non-throwing) on a Temporal failure: onboarding is operator initiated and retryable, so a broker outage is a ONBOARDING_START_FAILED the caller can surface and offer to retry, not an exception.

      Refuses, before the workflow starts, a program the workflow would create the customer and then fail on: one that is not RouteFusion's, the only vendor onboarding grants, or one an operator may not grant yet.

      Parameters

      Returns Promise<
          | { ok: true; value: { id: string } }
          | {
              error:
                  | ServiceError<
                      "ONBOARDING_START_FAILED"
                      | "NOT_A_ROUTE_FUSION_PROGRAM",
                  >
                  | RoutedError;
              ok: false;
          },
      >