Guide: Audit a product before publishing

A pre-publish pass over one product: see the whole flow at a glance, find every configuration
warning and every blocking error, fix each one where it lives, confirm what the draft changes
against the live version, and only then publish and choose when it goes live.

Steps 1 to 3 and 5 only read. Step 4 fixes the draft with the Product Studio tools
(products_pages_*), and Step 6 publishes with products_publish and makes the version live with
products_set_live_version. Page and routing fixes are written to the draft, so nothing an
applicant sees changes until Step 6.

Before you start

  • The product id. Ask for the product list (products_list) if you do not have it; the
    reply also shows each product's referral code, which is what Product Studio URLs use.
  • Product Studio access on your connection: view access for the reads, edit access to fix and
    publish. Without it every call returns Token does not have access to this resource.

Five ground rules

RuleWhat it means for you
version omitted = the live draftThe tools default to what Product Studio is editing, not what applicants see.
Applicants run the live versionA draft with has_unpublished_changes differs from it. Fixes to pages and routing reach applicants only after a publish and a set-live.
Decision-tree contents always reflect each tree's default versionWhatever product version you look at, a tree's nodes and outcomes come from that tree's own default version. Manage those with decision_trees_set_default_version.
Warnings are configuration audits, not runtime errorsA product with warnings still runs and still publishes. Validation errors block publishing.
Stop on requires_confirmationPublishing or setting a version live over in-flight applications asks first; show the impact to the product owner before you say yes.

The prompts below are what you type. The tool noted underneath each is what your assistant runs.


Step 1 — Know what you are looking at

Which versions does LendAPI product <product-id> have, and does the draft have unpublished
changes?

Tool: products_list_versions

You get every published version, newest first, with is_default and is_current flags, and the
template's has_unpublished_changes, is_launchable and default_version. Three things to read
off it:

  • is_launchable: false — applicants cannot start this product yet (nothing has ever been
    published). Everything below still applies; it is just a first publish rather than an update.
  • has_unpublished_changes: true — the draft differs from the default version. This is the case
    the rest of the guide is for.
  • default_version — remember it; Step 5 compares the draft against it, and it is the version to
    go back to if you need to roll back after Step 6.

Step 2 — Get the bird's-eye view

Show me the whole flow for this product: every step, what it collects, which providers run,
and how each outcome is wired.

Tool: products_get_overview

One call returns the flow map of the draft: settings, webhooks (host only), event email
triggers, and each step with its widgets, providers, decision tree, and, for every outcome, the
pricing tables, contracts and emails it triggers, plus the step's next step. Use it to narrate the
product back to yourself: "basic info, bureau pull, prime tree, offers, documents". If the
narration has a hole, Step 3 will usually name it.

warning_count at the top tells you whether Step 3 has anything to do. For one page in detail,
with its fields, controls and routing in the shape the fix tools take, ask for it by name:

Show me the "Income" page of this product.

Tool: products_pages_get (after products_pages_list for its tab_id)

Step 3 — Run the audit

Audit this product's draft. List every warning and where to fix it, and tell me whether the
draft can be published.

Tools: products_get_warnings, products_validate

Two lists, two meanings:

FromWhat it isBlocks publishing?
products_get_warningsConfiguration warnings: one row per warning with code, scope, the step (tab_label) and, where relevant, the provider or the outcomes (assignment_ids), plus a fix_paths entry per codeNo
products_validateerrors [{code, tab_id, message}] and warnings, with validYes, every error

When both are clean, skip to Step 5.

scope on a warning says where the fix lives:

scopeFix it on
productThe flow as a whole (an event email with no email captured anywhere)
stepThe named step
outcomeThe listed outcomes of that step's decision tree

Step 4 — Fix each problem where it lives

Work through the rows. Each fix below writes the draft (takes_effect: on_publish), so applicants
see none of it until Step 6.

ProblemWhat is wrongHow to fix it
missing_input_variablesA provider on the step (provider) needs input fields the flow never collects before that step; they are listed in missing_fields.Add a field for each missing variable on this step or an earlier one: read the page with products_pages_get, add the fields, and send the whole page back with products_pages_update. Create a variable that does not exist yet with variables_create_simple.
no_email_collectedAn email trigger fires (on the step, or on the outcomes in assignment_ids) but no page captures an email address.Add the tenant's email variable as a field on a page before the trigger fires (products_pages_get, then products_pages_update). If the email should not fire at all, detach it with the communication tools (comms_get_template, comms_update_template).
dead_next_stepThe step's next step, or the destination of the outcomes in assignment_ids, points to a page that does not exist.Point it at a page that does: products_pages_set_routing with next_step ({"type": "tab", "tab_id": ...}, {"type": "complete"}) or, for outcomes, the by_outcome map. A tab id may be written "page:<title>".
A validation errorproducts_validate names the page (tab_id) and the rule.Fix that page's content with products_pages_update or its routing with products_pages_set_routing, then validate again.

Every fix is checked before it is sent: a page that breaks a layout rule, names an unknown
variable, or routes a decision tree's outcomes to the wrong place is refused with the reason, and
nothing is written. See the Product Studio ground rules.

Removing a page instead? products_pages_remove deactivates it; if other pages route to it, pass
reroute_to, or the call asks for confirmation and lists routed_from.

Outcome wiring in general (which pricing table, contract or email an outcome triggers) is shown
under each outcome in products_get_overview, and is set in the pricing, contract and
communication tools, not on pages. When something is missing there rather than flagged as a
warning (an approve outcome with no pricing table, say), the audit will not catch it; read the
overview's outcome links yourself before you publish.

After each round of fixes:

Audit the draft again.

Tools: products_get_warnings, products_validate

Repeat until warning_count is 0 and valid is true.

Step 5 — Confirm what publishing would change

Compare the draft against version <default_version> and tell me what publishing will change.

Tool: products_compare_versions (with version_a = the default version, version_b omitted)

The reply is a structured diff, computed the same way every time: steps added, removed and
changed (matched by step id, so a renamed step shows as a change, not as a removal plus an
addition), widget, provider and email-trigger changes per step, decision-tree and outcome-link
changes (pricing tables, contracts, emails), warnings added and resolved, webhook, event-email
and settings changes. Read the summary first; if identical is true there is nothing to
publish.

Two things to check before you move on:

  • warnings.added should be empty. If it is not, you fixed one thing and broke another; go
    back to Step 4.
  • decision_tree changes name a workflow swap when the step now runs a different tree.
    That is a bigger change than a rule edit; make sure it is intended.

Step 6 — Publish, then choose when it goes live

Publish this product's draft as "<what changed>", but do not make it live yet.

Tool: products_publish with is_default=false

The tool validates first and publishes nothing if there are errors. On success it returns
version_published, with version_live_before and version_live_after both still the old
version: publishing alone is not live. Look at the new version before anyone runs it:

Compare version <version_published> with version <default_version>.

Tool: products_compare_versions

Then:

Make version <version_published> live.

Tool: products_set_live_version

If applications are in flight on the current version, or the draft has changed since the publish,
the first answer is requires_confirmation with an impact (in_flight_applications,
draft_has_changes) and nothing changes. In-flight applications are applicants part-way through
the product; show the numbers to the product owner and confirm only if they agree. Unpublished
draft changes are kept as a stale version, not lost.

Finally run Step 1 again: default_version should be the new version and is_launchable true.
If something is wrong, set the previous version live again; that is the rollback.


What these tools will not do

  • Publish without validating. products_publish refuses a draft with errors.
  • Change what applicants run by accident. Page and routing fixes wait for a publish and a
    set-live; setting a version live over in-flight applications asks first.
  • Hard-delete a page, unmask a variable or rewrite a list variable's options.
  • Look across products. Each call is one product. For a tenant-wide picture, ask for
    products_list and audit the products you care about one at a time.
  • See applicants. The overview is configuration only; no application data is involved, and
    application review has its own guide.

See also


Did this page help you?