Skip to content
Forward Deployed

Forward Deployed

Configurable Platform for Customer-Specific Workflows

Serve ten customers' different fields, approvals, branding and integrations from one stable workflow core, with customisation that is safe, versioned and supportable instead of ten forks.

Kind
Case study
Level
Core
View
Interview prep
Sections
4
By
Sourav Banerjee
Last updated
21 Nov 2026

Practise this as a worksheet: Configurable Platform for Customer-Specific Workflows

Report an issue

Interview view. The case brief, design walkthrough, technical deep dives and quick review, condensed into bullets, tables and lines to say out loud, with interactive diagrams to step through.

Want to go deep? The full casebook has the complete reasoning in prose, the original diagrams, practice questions with worked answers and the sources.

Case brief

The case in one line: one workflow product, ten customers who each want their own fields, approvals, branding and integrations, and a design that gives them that without ten forks.

30-Second Cheat Sheet

  • The product: a customer employee submits a request, it moves through approvals, and it updates other systems when it finishes.
  • The pressure: ten customers each want their own form fields, approval chain, branding and integrations.
  • The risk: satisfying each one with its own copy of the code, a fork, until nobody can upgrade the ten codebases together.
  • The hard constraint: customisation must be safe, versioned and supportable.
  • The authors are not experts: much of the configuration is written by customer administrators, so the platform can't assume careful authors.
  • The core idea: each configuration becomes a version that never changes, a per-tenant flag decides which version runs, and rollback flips the flag back.
  • Two choices make it work: the control plane is split from the data plane, and published versions are immutable, tracked by an append-only deployment ledger.

1. Ten customers, one workflow product

The product and the risk

  • A vendor sells one workflow product:
    • A customer employee submits a request.
    • The request moves through approvals.
    • It updates other systems when it finishes.
  • Ten customers now want it. Each wants its own form fields, approval chain, branding and integrations.
  • Everyone agrees on the headline, "one platform for similar workflows", and on very little underneath it.
  • The risk: the team satisfies each customer with its own fork and ends up with ten codebases nobody can upgrade together.

The terms that carry the whole case

Term Meaning
Fork A customer's own copy of the code
Tenant One customer's isolated slice of the shared platform
Configuration Data a tenant supplies (field definitions, approval rules) that changes how the shared product behaves for that tenant without changing its code
Control plane Where configurations are written, checked, versioned and promoted
Data plane Where live workflows run for real users
FDE (Forward Deployed Engineer) Sits with the customer, works out the real problem and ships a working system in the customer's environment
Deployment ledger An append-only record of which version is live for each tenant

The hard constraint: safe, versioned and supportable

  • No change may skip authorisation or switch on behaviour nobody reviewed.
  • Every tenant can see which workflow definition is live.
  • Support can trace a fault and roll a bad configuration back.
  • Much of the configuration is written by customer administrators, not engineers, so the platform can't assume its authors are careful or expert.

The core idea in one sentence

  • Each configuration becomes a version that never changes.
  • A per-tenant flag decides which version runs.
  • A rollback flips the flag back.

The figure as a flow: admin edits a configuration → save a draft → validate and authorise → (fails → rejected, nothing written) → (passes → published version) → tenant flag exposes it to one tenant, then a cohort → serves live workflows.

Two choices make that path work

  1. Split the control plane from the data plane.
    • Risky change management stays away from the workflows customers are running.
  2. Make published versions immutable.
    • A tenant flag switches a version on for one tenant, then a cohort.
    • An append-only deployment ledger records which version is live.
    • Because the ledger only grows, a rollback is a new event pointing at an earlier version, not an edit that erases history.

2. Follow one change from edit to live

The tenant: the source's own worked tenant, acme.

  • The request: add a compliance approval after the manager approval on a purchase workflow, and sync completed requests to the CRM.
  • The administrator edits Acme's configuration against the versioned template tpl-9.

CRM = customer relationship management system, the sales and customer system of record (for example Salesforce).

Caveat: the compliance step and the CRM sync are illustrative. The tenant, template and version numbers come from the source's deployment walkthrough.

  1. Save.
    • The draft is stored quickly and durably.
    • Nothing is live yet.
  2. Validate.
    • The validator checks the draft's structure, its approval rules and its adapter mappings.
    • Suppose the new rule sends compliance back to the manager under a condition that never turns false. The approval graph then contains a cycle, and publication fails closed.
  3. Test.
    • The tenant test harness replays Acme's contract tests: a form submission, approval routing, odd inputs and a stubbed CRM call.
  4. Publish.
    • The registry stores configuration version 17 as an immutable artifact with its schema version, author and release metadata.
  5. Expose.
    • An operator creates a deployment for Acme with an idempotency key.
    • A tenant flag exposes version 17 to Acme only.
    • Other tenants keep running their own versions.
  6. Observe, then promote or roll back.
    • Support watches step latency, adapter errors and loop detection.
    • If the release misbehaves, a rollback appends a new ledger event pointing Acme at its previous version.

Idempotency key = a client-chosen identifier that lets the server recognise a retry, so the same request never creates two deployments.

The split of responsibility (the case in miniature)

Who Decides
Acme administrator What the fields and approvals mean for their business
Platform Whether the configuration is well formed, permitted and safe to run
Vendor operator Signs off each change before production (an assumption we state in discovery)

3. What you need to design

The task

  • Design the configurable platform at interview depth, starting from its outcome:
    • One stable product core.
    • Customisation that is safe, versioned and supportable.
  • The dominant constraint: ten customers' differences must never become ten forks.

Be ready for follow-ups on

  • Peak deployment load
  • Validation at publish time
  • Idempotent deployment calls
  • Sandboxed extensions
  • Approval loops
  • Tenant isolation

Who it's for

  • Engineers preparing for Forward Deployed, solutions or applied-AI engineering interviews.
  • Especially a round on multi-tenant SaaS, low-code or workflow products, or any customer request for "configuration" that could turn into a fork.

What it assumes you know

  • Multi-tenant SaaS
  • API design and idempotency
  • Basic release practice: feature flags and rollback

How to use the sections

Section What it holds
Design walkthrough The eight steps, in order. Each answers a question an interviewer will ask.
Technical deep dives The records, API contracts, publish-path code and the source's notes on gaps
Practice (full casebook) Attempt the worksheet before opening the worked answers, then reread the steps where your answer fell short. Its level calibration is worth reviewing the night before.
Quick review The card for the night before
  • The source's separate interactive worksheet isn't connected to the site. Its prompts and model answers are reproduced in Practice in the full casebook.

Quick Recall: Lines to Say in the Interview

  • "Ten customers' differences must never become ten forks."
  • "Keep one stable product core, and allow customisation that is safe, versioned and supportable."
  • "Each configuration is a version that never changes; a tenant flag decides which one runs."
  • "Rollback flips the flag back, and the ledger records it as a new event."
  • "The control plane changes configuration; the data plane runs live workflows."
  • "The customer decides what a field means. The platform decides whether it's safe to run."
  • "A cycle in the approval graph fails closed at publish."

Design walkthrough

The goal: one stable workflow core that ten customers can each tailor through validated, versioned configuration, so the product never splinters into ten forks.

30-Second Cheat Sheet

  • Reframe first: the ask is "configuration"; the outcome is one stable core with customisation that is safe, versioned and supportable.
  • Measure the right thing: variations shipped with no fork, no hotfix and no escalation, not the count of configurable fields.
  • Authorship is architecture: customer admins need validation, previews, narrow building blocks and safe defaults.
  • Size the peak: 1,000 versions/day ≈ 42/hour, but 250/hour in a 2-hour window. One slow tenant blocking the queue is the real problem.
  • Two planes: the control plane writes, checks, versions and promotes; the data plane runs live workflows.
  • Publish is not exposure: an immutable version reaches users through a tenant flag, one tenant then a cohort.
  • Fail closed at publish, contain at runtime: cycle detection before activation, a max-hop guard after.
  • Roll out as proofs: four phases, each with an owner and a go/no-go gate; widen only when customers two and three reuse the mechanism.

Opening line (source's version): "Let me frame it first. One workflow product, ten customers, each wanting its own fields, approval chains, branding and integrations. I want a stable shared core with safe, versioned, supportable customisation, so we never run ten forks. First I'd find out who owns configuration, which variations are really needed, which failures we can't accept, and how we'll measure the first rollout. Then the design rests on validation, rollback and a few controlled extension points, not per-customer code."


1. Reframe the request before drawing anything

Turn "configuration" into a measurable outcome

  • The room agrees on "one platform for similar workflows" and disagrees about fields, approval paths, audit depth and release process.
  • Drawing services now means designing for whichever stakeholder spoke last.
  • The outcome: one configurable workflow platform on which ten customers can each change their fields, approvals, branding and integrations, while the shared core stays stable, versioned and supportable.
  • That sentence separates the feature asked for (configuration) from the result the business needs (each customer gets its own workflow, and the product doesn't splinter into ten forks).
  • Say that split aloud. An implementer skips it; an FDE leads with it.

Each word in the outcome needs a test:

Word Test
Safe No change can skip authorisation or switch on runtime behaviour nobody reviewed
Versioned Every customer can see which workflow definition is live and what changed in it
Supportable Support and release staff can trace a fault, undo a bad configuration and explain behaviour tenant by tenant
  • Success measure: how often a new customer variation ships with no fork, no hotfix and no support escalation.
  • Vanity measure to avoid: the number of configurable fields. It can grow while the product forks.
  • The job the customer hires the platform to do: make custom forks unnecessary while each tenant keeps its own process.
    • That pushes the design towards a stable core with a few controlled extension points, not a codebase that changes shape per account.

Soundbite (memorise it): "Keep one stable product core, and allow customisation that is safe, versioned and supportable."

  • Interviewers listen for those three words because each drives a later decision:
    • Safe → validation and sandboxing.
    • Versioned → the immutable registry and ledger.
    • Supportable → rollback and observability.

Map what the same request means to each group

  • One request means something different to each group. Dropping any group tilts the design.
Group What they ask for
Customer administrators Who may change a workflow, how much they may customise, how fast a change reaches users
FDE teams A real customer use case in production without leaving one-off code behind
Core platform engineers A lasting model for workflow definitions, validation, permissions and how the runtime executes them
Support and release teams Observability, rollback, a clear incident process and a quick answer to "what changed?"
  • The cost of missing a group (source figure):
    • Without support and release teams, we ship flexibility nobody can operate.
    • Without core platform engineers, the customer-specific layer never generalises into a product.

The concrete roles we design for:

Role Who they are
End user A customer employee who starts a workflow, approves it or receives its result
Operator On the support or release team; watches health, reverts a bad configuration, handles incidents
Security owner Answers for permissions, audit and least privilege between tenants
Executive sponsor The business leader paying for one platform rollout instead of a run of forks and long customisation projects

Ask the few questions that remove the most doubt

  • Skip twenty generic questions. Ask the few whose answers change the design. Four branches:
Branch Questions
Workflow shape Which parts are the same for every customer, and which really differ? Is the variation only in fields, routing, branding and integrations, or does it also touch business logic and lifecycle states?
Ownership and control Who may write configuration changes, and who signs them off? Do customer admins change configuration themselves, or does an FDE or platform team handle every change?
Risk and recovery What happens when someone misconfigures a workflow? Can the customer live with a broken approval path, or must a fallback always exist?
Success What counts as done for the first customer: one live workflow, several teams onboarded, or every variation migrated? How will the customer judge it: less manual handling, faster turnaround, fewer errors or simpler audits?
  • The figure: discovery pass → four branches → scope, assumptions, risks, owners and success metrics.
  • If the interviewer holds back, state an assumption aloud and keep going.

Spoken answer: "I'll assume only customer admins can configure, and the vendor approves each change before production."

Leave discovery with an assumption ledger

Item What it records
Scope What is configurable and what stays fixed
Assumptions What we accept for now because the prompt left it open
Risks Where a bad configuration, a permission slip or a failed integration could hurt a customer
Success criteria The measurable change that shows the platform works

Hear the difference between a weak and a strong opening

Opening Example
Weak (leads with features) "Let's build a flexible workflow system: forms, approvals, themes and some API hooks."
Strong (leads with the outcome) "We need a single shared workflow platform. Each customer can tailor its fields, approvals, branding and integrations without a separate codebase, and the core stays stable enough to version, support and roll out safely."
  • Only the strong one names the tension between flexibility and fragmentation.
  • The source's spoken opening (top of this page) works because it names the problem and the people, and holds the architecture back until someone owns the workflow, someone owns the risk and a success metric exists.

2. Turn "we need flexibility" into requirements

Separate requirements from preferences

  • "We need flexibility" is a preference until we know who needs it, under what governance and with what promise about upgrades.
  • Every customer wants a slightly different mix of fields, approvals, branding, integrations and sometimes rules.
  • The first design fork: spot which differences repeat across customers.
  • Skip that (plus who authors configuration and where custom code ends) and the design fails one of two ways:
    • Too thin to cover real variation.
    • A bespoke rules engine nobody can support safely.

Ask six questions that each change a component

# Question Why it matters Component it moves
1 Which differences keep coming back between customers? Separates a shared product pattern from one-offs. Repeated approval-chain differences are a platform capability; a single seasonal override goes down an exception path. Core abstraction: steps, policy rules, form schemas or integration orchestration
2 Who will write the configuration? An architecture question, not a staffing one. Internal engineers can handle expressive power; customer admins and support staff need guardrails (validation, previews, narrow building blocks, safe defaults). Admin UX, validation model, authorisation model
3 Which integrations and extensions can't be dropped? Typical: webhook callbacks, outbound notifications, CRM sync, document generation, ticket creation, authentication hooks. Settles sync vs async calls, and whether a failed call blocks a transition or degrades gracefully. Adapter interface
4 What upgrade promise do customers expect? If configurations must outlive core releases, we need versioning, migration tooling, backward-compatible schema changes and rollback paths. Without them the "product core" becomes an endless services project. Versioning
5 Where does the security boundary for custom code sit? Options: the trusted core, a sandbox, or approved integration points only. Sets tenant isolation and how much supply-chain scrutiny extensions need. Trust boundary
6 How fast must a configuration change go live? Hours → self-service tooling with validation built in. A week → more manual review. Tooling investment: admin UX, reusable templates, automated testing or partner onboarding
  • Expect follow-ups on question 5. Have the default ready: a declarative core, with any arbitrary code kept outside the trust boundary.
  • Connect it to the sandbox in step 4 and the security controls in step 5.

Write the functional requirements

Must-haves:

  • A stable workflow engine that runs one core lifecycle for all customers.
  • Declarative configuration (schemas, rules and UI metadata) for labels, fields, visibility and validation, so no customer needs a code fork.
  • An adapter interface, so external systems plug in while the engine stays untouched.
  • Versioned configuration with validation, so every change can be reviewed, tested and reverted.
  • A small set of controlled extension points for the rare cases declarative configuration can't cover.
  • Migration and rollback tooling, so a version change never strands a customer on an incompatible configuration.

Declarative = the configuration states what should happen and the engine decides how. It can't contain executable code.

How they fit together around the engine:

  • One engine → one release train, one way to operate, one thing to support.
  • Most variation lives in declarative configuration, not code.
  • Integrations pass through the adapter interface instead of each becoming a special case.
  • Versioning and validation make customisation supportable.
  • Extension points stay narrow and explicit, never a blank cheque.

Make the non-functional requirements measurable

Requirement What it means Failure it prevents
One core release train A single product ships, never ten customer branches Forks
Configuration isolation No customer's settings, data or test changes leak into how another customer's workflows run Weak isolation turns customisation into a steady stream of multi-tenant incidents
Backward-compatible upgrades An existing configuration keeps working until a planned migration runs Without it, configuration becomes a liability at every upgrade
Observable customer-specific behaviour Operators can see the configuration version involved and which rule or adapter fired Without observability there is no support

Fence the MVP

MVP = minimum viable product, the smallest version real users actually rely on.

Five things the MVP leaves out:

  1. Code written by customers and run inside the workflow engine.
  2. Endless per-customer UI branches to meet branding requests.
  3. A general-purpose rules language that tries to model any business process.
  4. Bespoke integration behaviour that goes around the adapter contract.
  5. Automatic, unreviewed migration of every legacy configuration shape.
  • These cuts protect the core. The MVP proves one platform can serve ten customers with safe variation, not that it models every workflow on day one.

Give every requirement a home

  • Tracing each requirement to a component checks that nothing is orphaned.
Requirement Likely component
Stable workflow engine Workflow runtime / orchestrator
Declarative schemas, rules, UI metadata Config model, schema registry, admin UI
Adapter interface for integrations Integration gateway / connector layer
Versioned configuration and validation Config service, validator, release pipeline
Controlled extension points Sandbox or plugin boundary
Migration and rollback tooling Deployment and ops tooling
One core release train Shared platform build and release process
Configuration isolation Tenant-aware data and authorisation layer
Backward-compatible upgrades Schema evolution and compatibility checks
Observable customer-specific behaviour Audit logs, metrics, tracing, config-version tags

Keep moving when answers are partial

  • Don't stall. Assume sensibly and guard the riskiest constraint.
  • Example: customers look alike, but nobody says who authors configuration.
    • Assume a mix: customer admins own the safe declarative fields; our operations team signs off any extension or schema change.
    • That guards the most fragile line in the design: safe customisation vs unsafe code.
  • What the interviewer is testing: discovery under ambiguity, prioritisation with gaps, and protecting delivery by narrowing scope.

The strong sequence, in order:

  1. Find the recurring differences.
  2. Settle who owns configuration.
  3. State the integration and upgrade promise.
  4. Draw a firm line for custom code.
  5. Commit to a stable engine backed by declarative configuration, versioning and strict validation.
  • Ask only questions that change the design, then proceed on stated assumptions.

3. Size the peak, not the customer count

Estimate the load shape

  • A tidy first sketch (one shared engine, config store, validator, deployment pipeline) holds at average load and falls over when a deadline arrives.
  • Customer count is the wrong thing to estimate. Ask how many edits, validation runs, activations and approval events land together, and what happens as a release window closes.

Caveat: the source's working assumption was chosen for this case, not taken from a benchmark: 100 tenants and 50 workflow templates producing 1,000 configuration versions per day, a mix of small edits, bulk template updates and bursts around release windows.

Calculation Result
1,000 versions spread over 24 hours ≈ 42 versions/hour
Half the day's changes (500 versions) in a 2-hour business window ≈ 250 versions/hour at peak, roughly six times the average (retries, failed validations and resubmissions on top)
250/hour × the 10-second upper validation cost 250 × 10 = 2,500 worker-seconds/hour, under one busy worker
10,000 versions/day with a 5x peak (≈ 417/hour average, 2,083 at peak) ≈ 20,833 worker-seconds/hour, or six workers
100,000 versions/day About 58 workers: where per-tenant quotas and sharding start to matter
  • Raw throughput is not the baseline problem. One slow tenant blocking the queue is.
  • Size well above the average, often by several times, with a growth factor and a headroom target, so a release-day spike doesn't turn configuration into an outage.

Work through a four-step capacity envelope

Work it in the order that moves the architecture:

  1. Version intake and validation throughput.
    • Validation = schema, policy and dependency checks plus a dry run.
    • The source guesses 2–10 seconds of CPU-bound work, or a few network calls, per validation.
    • At that cost, quick feedback to the editor must split from slower async checks.
    • Near-term SLO: the edit was saved and came back with a clear result quickly.
    • Deeper promise: validation finished and promoted or rejected the version before the deployment window shut.
  2. Deployment throughput.
    • Perhaps only some of the 1,000 daily versions are promoted, but each promotion fans out across tenants, regions or integrations.
    • One template update can reach dozens of workflow instances or queue downstream sync jobs.
    • Fan-out, more than the number of human edits, sets deployment capacity.
  3. Limits for expressive power.
    • Hard caps pin runtime cost early: a moderate number of fields per form, a bounded count of rule clauses per transition, and short plugin runs with memory and network limits.
    • They stop one customer's customisation from consuming the shared budget every other tenant relies on.
  4. State growth and retention.
    • Event history outgrows configuration history, yet configuration history still matters.
    • Record volume is half the question; the other half is what audit, rollback and support require us to keep, and for how long.
    • Keep the version graph small, store deltas where they pay off, and treat rollback metadata as a first-class record.

SLO = service level objective, an internal target the team commits to.

Tie SLOs to customer pain

SLO dimension What customers and operators feel
Availability When needed, can users open the editor, validate a change and activate a version?
Latency How long does the editor wait on a save, a validation preview or an approval routing result?
Freshness Once a configuration is approved, how soon does the runtime start using it?
Quality What share of deployments fail validation, get rolled back or need someone to step in by hand?
Security Are audit trails, plugin and approval permissions, and tenant boundaries enforced at the right control points?
Cost What does each validated version, activated template or thousand workflow executions cost, and how do more rules or plugins change that?
  • Split the latency budget by step, not one figure:
    • A save should feel instant.
    • A validation preview may lag a little.
    • A full deployment may take longer, provided we can trust and watch it.
  • Making every step synchronous "because it's simpler" couples the fast path to the slowest check.

Use leverage to decide what belongs in the core

  • One ratio decides where a capability lives: shared product code, configuration, or an adapter around one customer's integration.

The source's ratio = customers served by the shared capability ÷ engineering effort

Ratio Example (source) Where it lives
High An approval model that 80 tenants use First-class core support
Low One customer's brittle edge-case approval chain Configuration, an adapter or a tightly scoped extension. Don't bend the platform around it.
  • Count support cost in the effort. A feature can look reusable yet bring costly onboarding, hard debugging or painful upgrades, so its real ratio falls below a simpler, narrower design.

Let the estimate change the components

  • The naive plan: validate inside the same API call that saves the configuration.
  • Put the peak on the board and it breaks:
    • Worst-case request time tracks the slowest rule set or plugin call.
    • One slow tenant holds capacity everyone else needs.
    • The control plane becomes brittle.

With peak validation throughput and deployment fan-out written down:

Step Becomes
Save Fast and durable
Validation Queued, bounded and observable
Deployment Idempotent and retryable, kept apart from authoring traffic
  • Tenant count matters less than it first appears. Component choice and partitioning depend mostly on how often validation and deployment run, and what each run costs.

Check sensitivity across growth scenarios

Caveat: the source picked these volumes and peak factors for this case. They are not industry benchmarks, so justify them in an interview rather than cite them.

Scenario Daily config versions Peak factor Operational implication
Baseline 1,000 ~6x (the 2-hour window above) One shared validator can cope if most work runs asynchronously
Moderate growth 10,000 3x–5x Separate queues, pools of workers, tighter caps on plugin run time
Aggressive growth 100,000 (100x baseline) 5x+ Explicit quotas per tenant, sharded queues, firmer tenant isolation
  • 10x growth can demand a new partitioning strategy, not just more spend.
  • Custom fields and rules behave the same way:
    • Deeply branched forms full of computed fields may need cached execution plans, partial evaluation or compile-time checks.
    • Plugins that run often may need a sandbox or adapter boundary instead of running in the engine's process.

Noisy neighbour = one tenant whose load degrades service for others.

Spoken answer (why 10x needs partitioning, not servers): "Noisy-neighbour risk. Past a certain point a shared validator or queue can't contain one misbehaving tenant's blast radius, however many servers sit behind it." That reasoning earns more credit than a precise spreadsheet.

Treat headroom as a product feature

  • Average load shows whether the system makes economic sense.
  • Peak load shows whether customers can rely on it on their worst day.
  • Headroom (the gap between them) stops a release window, a rush of approvals or a large tenant onboarding from becoming the day the platform breaks its promise.
  • Widen unit economics: running cost is one part; the support load the design creates is the other.
    • A cheap design needing constant hands-on work can lose to a slightly dearer one that's simpler to roll back, explain and support.
  • Rule to carry forward: every estimate should act as a design lever.
    • Does the number move a queue, a quota, a latency budget, a support process or a component boundary?
    • If not, it's probably trivia. If it does, record it and be ready to defend it.

4. Split the control plane from the data plane

Why two planes

  • Present it like this: follow one tenant request end to end, then replay it with a dependency in poor health.
  • Start with the danger: a customer's approval logic becomes hazardous the moment it can change how the shared runtime behaves.
Plane What it does
Control plane Configuration is written, checked, versioned and promoted: editing, schema checks, tenant contract tests, promoting releases
Data plane Runs live workflow instances: execution, runtime UI rendering, connector calls, audit events
  • Keeping them apart moves risky change management off the hot path users wait on.
  • "Where's the trust boundary?" → point at this split first.

Read the architecture top to bottom

The source figure, top to bottom:

  1. A tenant's change request enters the control plane through the config editor.
  2. It passes the schema and rule validator and the tenant test harness.
  3. It reaches the configuration registry (the system of record for approved versions): publish an immutable version.
  4. The registry records the release target and rollout state.
  5. The feature flag service gates exposure by tenant or cohort. The migration service sits beside them.
  6. Data plane: workflow runtime, UI renderer, integration adapter SDK and sandboxed approved extensions.
  7. External systems last: customer APIs, the identity provider and notification services (external calls and event delivery).

Two trust boundaries:

Boundary Rule
Tenant-written content ↔ platform-owned execution Tenant configuration never runs as code with full platform trust. Even approved extensions stay untrusted enough to need isolation and quotas.
Platform execution ↔ outside dependencies We don't control external systems, so every adapter call gets a timeout, retries, idempotency where it applies, and a backoff policy that doesn't make a failure worse.

Know each component's job and state

Component Responsibility State ownership Typical boundary
Workflow runtime Runs instances, moves between steps, fires timers and retries Execution history, runtime state Data plane; step decisions sync, long-running work async
Configuration registry Keeps every config and schema version with release metadata Immutable config versions Control plane; system of record once published
Schema and rule validator Verifies syntax, semantic rules, permissions, compatibility Only its check results Control plane; cheap schema checks inline on save, full checks queued, publish blocks until they pass
UI renderer Turns approved config into each tenant's forms, labels, layouts Cache only Mostly data plane; renders sync from cached descriptors
Integration adapter SDK Common contract for webhook, ticketing, ERP and CRM adapters Adapter definitions, credentials references Data plane edge facing external systems
Feature flag service Controls rollout per tenant, cohort or percentage Flag state Spans both planes
Sandbox for approved extensions Executes tightly scoped customer logic or plugins under hard limits Ephemeral execution only Isolated; sync when small, async otherwise
Migration service Upgrades older configs to new schema versions, or moves instances forward Migration jobs, compatibility mappings Control plane; mostly async
Tenant test harness Re-runs each tenant's contract tests ahead of release Test fixtures, expected outcomes Control plane; a sync approval gate or an async batch

ERP = enterprise resource planning, the system that runs finance, orders and inventory (for example SAP).

Three components to explain aloud:

  • Validator: keeps junk out of the registry.
  • Flag service: publishing a version and showing it to every tenant are two different actions.
  • Sandbox: approved extensions are valuable, yet letting arbitrary code run at runtime is how customisation ends in incident response.

Trace the happy path from author to promotion

  1. Author against a versioned schema. A customer admin, implementation engineer or product manager edits the workflow definition, approval graph, field layout and adapter mappings.
  2. Validate syntax and semantic constraints. Structure, permitted field types, whether the approval graph makes sense, reference integrity, permissions, fit with the features switched on.
  3. Run tenant contract tests. Form submission, approval routing, odd edge inputs and integration stubs.
  4. Publish an immutable version. The registry keeps the precise artifact plus version tag, schema version, release metadata and author: exactly what was approved.
  5. Roll out behind a tenant flag. One tenant first, then a cohort, then wider traffic once stable.
  6. Observe behaviour. Step latency, failed validations, adapter errors, approval-loop detection, workflow completion rate.
  7. Promote or roll back. Clears the acceptance gate → active version. Fails → flag switched back, or the tenant stays pinned to the earlier immutable version.
  • Publishing a version and switching it on everywhere are separate steps. That separation stops one bad configuration causing a wide outage.

What blocks and what doesn't:

Work Mode Why
Validation, contract tests Blocking gates, can still run on a queue What blocks is promotion, not the author's save request
Bulk replay, migration, some integration recovery Async The user's request doesn't stay open
Runtime step decisions Inline Quick
External side effects Pushed async when a dependency is slow or flaky Protects the runtime

Place systems of record, caches, queues and backpressure

Kind of state Home
System of record Published versions → configuration registry. Execution history → workflow audit store.
Caches Recent flag decisions, adapter metadata, rendered form layouts, compiled schema descriptors
Queues Test harness batches, migration tasks, event delivery, retries, adapter jobs
Backpressure and flow control As adapter queues grow, the runtime drops or defers non-critical work instead of letting retries stampede external systems
  • Flag service unreachable? The runtime keeps serving each tenant's last cached decision (the version it last ran).
    • It must not fall back to a default that exposes an unreviewed version or switches a tenant off.
  • Partitioning key: normally the tenant ID, sometimes paired with the workflow definition ID or environment.
    • Stops a noisy tenant spoiling latency for the rest.
    • Makes replay easier.
    • Gives quotas an obvious place to be enforced.
    • A surge of approvals from one tenant stays inside its partition.

Keep the MVP small and leave the rest for later

MVP (ruthlessly simple) Later, once the release path is stable
The runtime Configuration templates shared across tenants
A versioned registry More automated migration
The validator A wider plugin marketplace
Feature flags Deeper visibility into tenant behaviour
The tenant test harness
A small adapter SDK
Only as much sandbox as approved extensions strictly need
  • Prefer immutable versions and an obvious rollback over a fancier live-editing system.
  • The source's 90-second spoken summary of this architecture is a worked answer in Practice in the full casebook.

5. Fail closed at publish and contain the rest at runtime

Start from the red-team question

  • The security and operations review decides whether this ships or stays a good demo.
  • Assume the hardest realistic request: deep workflow control for customers, a stable core anyway, per-tenant secrets, and one customer's broken configuration never becoming everyone's outage.

The reviewer's question: "A config goes live and its approvals loop forever. Then what?"

  • The test: does the platform limit the damage, keep the evidence and keep serving every other tenant?

Two layers:

  1. Before activation: the pipeline rejects any cycle it can see.
  2. After publication: some loops only appear through hidden state or a race between events.
    • The engine stops that workflow version and marks the bad revision inactive.
    • Customers keep using the version that last worked.
  • For audit and replay: log who published, when and for which tenant, plus a snapshot of the rule graph.
  • Design goal: loops will happen; make each one dull, bounded and traced to a named change.

Pair four security controls with the failures they stop

Control How Stops
Disallow arbitrary code by default Customers shape workflows through declarations (fields, validation rules, routing, approvals, adapter bindings). Custom code is a last resort; if allowed, it runs in a tightly limited sandbox or a separate, approval-gated extension path. A customer running code inside the platform
Scope adapters and secrets per tenant No tenant sees a neighbour's credentials, tokens or request bodies. Least privilege in the runtime and the control plane: reading a tenant's config doesn't grant calling its external systems. Leaked secrets
Validate rules for denial-of-service risk Deeply nested conditions, unbounded regular expressions, huge lookup tables and recursive approval paths can burn CPU or memory without limit. Publish checks shape, depth and size against fixed caps, and runs cycle detection. Resource abuse
Audit configuration publishers and versions Each change records the publisher, the diff, the review gate it passed and the version it replaced Losing track of who changed what

Soundbite: name each control together with the failure it prevents. A list of controls without failures sounds like a checklist; the pairing shows we designed them for a reason.

Decide each failure's default before it happens

  • Lead with this table in an interview: it shows failure handling was designed up front.

SLA = service level agreement, the promise made to the customer, usually with penalties and looser than the internal SLO.

Event Default behaviour Why
Publish checks can't show the workflow is safe to switch on Fail closed Blocking a doubtful publish costs less than running an unsafe revision
An external adapter hits its timeout mid-run Bounded retries, then a queue or the dead-letter path A brief outage shouldn't fail the customer's work on the spot
The approval graph contains a cycle, or starts looping while running Fail closed for that workflow version The loop does the same harm every time; letting it run only adds more
A downstream integration is offline, but the task isn't urgent Degrade or queue Hold the work rather than lose it, as long as the SLA tolerates the wait
The customer's action can't be undone (a side effect in another system) When in doubt, hand it to a human With no safe way to undo, the system must not guess
Someone asks for custom code that looks suspicious Deny by default Execution rights need a clear trust boundary first

Why the rows differ:

  • A timeout is transient → retrying is worth it.
  • A cycle is deterministic → retrying only repeats the harm.
  • An irreversible side effect has no safe automatic recovery → a person decides.

Contain the blast radius at four levels

Blast radius = how far one failure spreads.

Level Containment
Tenant One customer's broken config leaves every other customer's workflow state, secrets and run queue untouched
Region In multi-region, a faulty deploy or failing dependency stays inside the smallest region slice possible
Workflow Only the faulty workflow definition or version is frozen; the rest of the tenant keeps running, unless its control plane itself is compromised
Dependency A failing adapter is fenced off; the other adapters carry on

Layered defences: validation (1st) → runtime sandbox (2nd) → rate limits (3rd) → observability last, showing the other three still hold.

Run the infinite approval loop drill

The setup:

  • Step A → manager approval → compliance approval.
  • Compliance sends it back to the manager whenever a condition holds, and that condition never turns false.
  • Nothing crashes. The request circulates forever, generating notifications and holding work.

A good answer covers four stages:

  1. Detection.
    • At publish: static analysis finds the cycle where it can.
    • At runtime: the engine notices repeating transitions and trips a max-hop or max-revisit guard.
  2. Containment.
    • Freeze that workflow version.
    • Stop only the execution group it affects.
    • Block any new run from starting on that revision.
  3. Recovery.
    • Fall back to the last known-good version.
    • Requests that already caused side effects → queued for operator review, not replayed automatically.
  4. Prevention.
    • Tighten graph validation and add cyclic-approval test cases.
    • Refuse any configuration whose approval graph has no topological order.
    • The one legitimate loop: sending a request back to the requester for changes. Model it as a declared rework edge with a revisit cap (for example, at most three returns), leave it out of the ordering check, and enforce the cap in the runtime guard. Every other cycle is still refused.

Max-hop / max-revisit guard = a counter that stops an instance after too many steps or too many returns to one state.

Topological order = an ordering in which every step comes after the steps that feed it. Only a graph without cycles has one.

  • Fails closed for the affected version if the loop reaches runtime undetected.
  • Keep the evidence: the exact configuration revision, the trace of transitions and the history of operator actions. A forensic review needs this record; an error message alone isn't enough.

The failure path overlaid on the architecture (source figure):

Component Role in shrinking the blast radius
Schema and rule validator Catches structural errors; may miss a semantic cycle unless loop detection is enabled
Tenant test harness Should catch the loop with a tenant-specific contract test
Configuration registry If both gates fail, publishes an immutable bad version
Feature flag service Limits exposure to one tenant or a small cohort
Workflow runtime The loop guard detects repeated step transitions; the audit log raises alerts
Support Switches the tenant flag back to the previous immutable version
Migration service Preserves or remaps instance state so recovery is safe
  • If one layer misses the defect, a later one still prevents a tenant-wide incident.

Say the reliability story out loud

  • Arbitrary code is off unless explicitly allowed.
  • Each tenant's secrets and adapters live in their own compartment.
  • Risky rules are checked before they go live.
  • Every publish leaves an audit trail.
  • Each external dependency and each irreversible action has a named failure policy.
  • Tie it to supportability: with evidence in hand, the platform can degrade, queue or block, and never has to guess.
  • State the policy at the four levels (tenant, region, workflow, dependency) and back it with a publish-time invariant so unsafe configuration never reaches production.
  • What hiring teams look for: someone who owns safe rollout, support and incident response beyond the happy path, and guards the core while customers still feel their workflows bend to fit them.
  • The remaining named failure cases and the six operational primitives are in the failure-handling deep dive.

6. Roll out as a series of proofs

Replace one go-live with staged proofs

  • Once the prototype works, the customer's question changes from "can it do the job?" to "can we trust it in production", with their data, approval chains and support staff.
  • The FDE stops building demos and turns the architecture into staged delivery with a measurable gate at every stage.

A sequence of proofs, not one big go-live:

  • Start with a workflow several customers already share.
    • Pick its least contested form: one approval path, one integration, one field set, one brand surface.
    • Go deep; show a real customer need fits with no fork.
  • Bring on one willing customer who copes with loose ends and gives feedback quickly.
    • Name an owner on our side, keep a single production gate and know the rollback path before the first publish.
    • Release as a canary first.
    • Keep the first launch small enough that support can trace each event, each rejected configuration and each downstream request.
  • Widen the configuration surface only on repeated evidence that it meets real demand, cuts duplicated work and adds no incident risk.
    • Without that rule, the platform becomes a growing pile of tenant-specific debt.

Canary = a release to a thin slice of traffic or one low-risk group of tenants first.

Gate each of the four phases

# Phase Owner Exit criteria Go/no-go gate
1 Extract one recurring workflow Product engineer, FDE in support Shared primitives express the workflow; no one-off fork needed The pattern is settled enough to build into the platform
2 Onboard a willing customer FDE with the customer admin Customer configures the workflow, finishes a pilot run, raises issues through the support channel Customer signs up to the support model and rollback procedure
3 Measure delivery time and defects Platform lead (telemetry), support lead (incident classification) Baselines for tenant launch speed, defect count and validation failure rate, before any scope is added Data shows configuration cuts custom work, not hiding rework elsewhere
4 Expand configuration only after repeated evidence Product and platform together A second and third customer reuse the mechanism; effort is predictable A new configuration type is approved only if it reduces forks or support load without adding upgrade risk
  • The phases end in a reusable product pattern.
  • Interviewers push on the gates between phases. Know all four:
    • The pattern is stable
    • The customer accepts the support and rollback model
    • Evidence shows configuration cuts custom work
    • Customers two and three reuse it with no fresh build
  • These gates stop a rollout becoming "we shipped because the demo went well."

Name the owners before launch

Owner Responsibility
Product owner Picks the first repeated workflow to turn into a platform path
Platform owner The shared core, the configuration schema and the publish service
FDE Turns the customer's workflow into supported configuration, checks assumptions, runs the rollout
Support lead Customer communication, triage and escalation during the pilot
SRE / operations lead Monitoring, rollback execution and release health
Customer admin / champion Tests the workflow in their environment and signs off that it's ready

SRE = site reliability engineering, the practice and team that keeps production running through on-call, SLOs and incident response.

Define go/no-go and rollback triggers

Publish only when all four hold:

  • Validation passes
  • The adapters it depends on are healthy
  • The team has rehearsed the rollback plan
  • The customer champion agrees their business process and the configured workflow still line up

Roll back on any one of:

  • Validation keeps failing.

  • Integrations throw errors nobody predicted.

  • Incidents climb among the earliest tenants.

  • A new configuration pattern starts to make approvals unstable.

  • Stateful workflows: write the migration plan and the rollback plan separately.

    • Moving running instances' state is a different job from reverting a configuration version.
    • A rollback that ignores in-flight instances can strand them.

The launch package (four documents):

  1. A short guide for admins.
  2. A runbook for support.
  3. A rollback checklist.
  4. A change log: which parts customers may configure, which stay fixed and which go to engineering for review.

7. Measure whether configuration is replacing forks

Track six metrics with owners and alerts

  • The scorecard measures the step 1 outcome: variation without forks.
Metric Definition Data from Owner Alert when
Time to launch customer Approved request → tenant's first successful production workflow Release tracking, ticket timestamps Delivery lead Lead time creeps up across several customers (brittle config, slow approvals or manual steps)
Percentage handled by configuration Share of customer-specific changes delivered as config, not code Tags on releases and change requests Product or platform lead The share stops rising: the team is quietly going back to forks
Config validation failure rate Failed publishes ÷ all publish attempts Config service logs Platform engineering The rate climbs: confusing UX, weak schema or unsafe requests
Fork count Customer-specific code branches, conditionals or exceptions that can't be removed Architecture reviews, repository analysis Engineering manager The count grows: every fork erodes the stable core
Upgrade time Effort to move one customer or tenant onto a new platform version Release records, migration tickets Release manager An upgrade needs one-off scripts or a long freeze window
Tenant incident rate Rolling count of each tenant's incidents, separate from platform-wide outages Incident management system Support and SRE together Incidents bunch around one config type or one adapter

Keep four layers of metrics apart

Layer What it covers
Technical health Publish success rate, validation failures, rollback frequency, latency, incident rate
Model and configuration quality Do the workflow primitives fit how customers really work? Clue: how often customers ask for exceptions
Adoption How many customers use the configured workflow, how often each returns, what share of each customer's process it handles
Business outcome Faster launches, less custom engineering, fewer support escalations, quicker growth into new tenants
  • Keep them separate in an interview:
    • A platform can pass every technical check and still fail commercially because nobody adopts it.
    • It can be widely adopted and still fail operationally because support can't keep it stable.

Write the dashboard in the user's language

  • Lead with the customer's story, then drill into the machinery.
  • The source's headline (illustrative numbers): "Onboarding for this customer took under two days. It needed zero manual config edits and one validation retry, and there was no incident after launch."
  • Under it, by tenant: rollout status, publish latency, adapter errors, blocked approval loops, failed schema validations.
  • This answers "what do we watch after launch?" CPU, logs and queue depth aren't enough alone; connect what the customer sees as success to the failure modes inside.

8. Decide where each exception lives

Test every exception against four homes

  • Sooner or later a customer asks for "just one exception". Four possible homes:
Home What belongs there
Configuration Fields, routing choices, branding, approver lists and threshold values that differ per customer
Adapter Integrations that vary by customer behind one common interface: CRM, ticketing, email, identity, document systems
Shared service Capabilities every tenant reuses under one uniform policy: validation, audit logging, workflow execution, publish orchestration
Core product The building blocks the business model rests on. They stay put; no new tenant reopens them.

The decision tree (ask in order, every time):

  1. Does it change the stable business model? → Core product, promoted only if proven reusable.
  2. Else, is it a customer-specific integration behind a common interface? → Adapter.
  3. Else, is it reused across tenants and needs uniform policy? → Shared service.
  4. Anything left → Configuration.
  • Asking these every time keeps the platform from sliding into per-customer branches nobody can maintain.

Defend four trade-offs

  • Each pair has a fair case on both sides. Explain each side before choosing.
Trade-off Case for each side The verdict
Configuration vs code Config when tenants vary only in fields, labels, approvals, routing or connector choice: visible, versioned, easy to support. Code once variation changes what the workflow means, adds a new invariant, or would twist the config language into an unreadable programming language. Weak: "make everything configurable". Better: "Put the common variations in declarative config. When a rule becomes bespoke business behaviour, promote it to reviewed, isolated code."
Generic engine vs domain product A generic engine hosts many tenants but becomes too abstract if it models every process. A domain product does less but is simpler and cheaper to support. Combine: a stable core of primitives the company knows it can support, with a constrained domain model on top. Aim at the workflow family the business intends to own.
Plugin flexibility vs security Plugins wire in unusual systems without touching the core, so customers go live faster. The price is a larger attack surface. Sandbox extensions, minimal permissions, fixed interfaces, every plugin a reviewed, versioned, observable artifact. A plugin that reads lots of data or runs any code is a trusted service boundary.
Backward compatibility vs simplification Compatibility shields existing tenants and keeps running workflows intact. Simplification keeps the platform easy to understand and maintain. A clear deprecation policy: versioned schemas, migration windows, compatibility tests, a short list of supported generations. "Support everything forever" turns support into archaeology.

Keep a risk register as part of running the platform

  • Treat it as part of operating the platform, not an appendix.
Risk Owner Mitigation Trigger
Infinite approval loop Platform engineer Detect cycles and validate at publish time The same approval state is entered again and again
Adapter mismatch Integration engineer Contract tests plus explicit adapter versions Calls fail after a publish, or the schema drifts
Customer confusion during rollout FDE Training, playbooks and guided setup High support volume, or validation errors keep repeating
Unsupported fork pressure Product manager Clear grounds for refusing bespoke code, plus a review board for exceptions A request can't be expressed in configuration

Know when the platform is finished

  • Forward-deployed teams want people who carry work past the prototype until customers adopt it, then distil feedback into a pattern the product can reuse.
  • The source's definition of finished (three parts):
    1. Customers rely on the platform.
    2. The workflow keeps improving.
    3. Operations can run it with no heroics.
  • This is the conversation an FDE holds whenever one customer's problem becomes a product feature that is safe to ship.

Quick Recall: Lines to Say in the Interview

  • "Keep one stable product core, and allow customisation that is safe, versioned and supportable."
  • "Success is variations shipped with no fork, hotfix or escalation, not the number of configurable fields."
  • "Who writes the configuration is an architecture question, not a staffing one."
  • "A thousand versions a day is 42 an hour, but 250 an hour in the release window. The problem is one slow tenant blocking the queue."
  • "Save is fast and durable, validation is queued and bounded, deployment is idempotent and retryable."
  • "Publishing a version and exposing it are two different actions."
  • "A timeout gets retried, a cycle fails closed, an irreversible side effect goes to a human."
  • "Customers two and three reuse it with no fresh build, or we don't widen the surface."
  • "Configuration, adapter, shared service or core: asked in that order, every time."

Technical deep dives

The goal: back the design with concrete state: four records, four API contracts, a publish path that fails closed, named failure cases, and honest answers on cost, build or buy, regulation and AI.

30-Second Cheat Sheet

  • Four records, four owners: WorkflowTemplate (product and platform), TenantConfig (customer values), AdapterDefinition (integrations), ConfigDeployment (ops).
  • What's live? ConfigDeployment, the append-only ledger, not TenantConfig. A rollback is a new event.
  • Ledger and flags must not drift: derive flag state from ledger events, or write the ledger first and replay the flag change until it succeeds.
  • Idempotent deploys: same key + same body → same dep-555; same key + changed body → 422; retry still in flight → 409.
  • Publish order: parse → validate → authorise-by-policy → persist. Cheap checks fail fast; nothing is written until all pass.
  • Caps are illustrative: 50 fields, 10 approvals, 20 integrations, SLA 1–168 hours.
  • Six primitives: timeouts, retries, idempotency, circuit breakers, dead-letter handling, human escalation.
  • Gaps the source closed: a four-line cost model, build the engine and buy the commodity, residency and audit, and no AI in the design (say so plainly).

1. Four records and who owns them

  • Interviewers trust concrete state more than abstractions.
  • Say what is durable and what can change, what carries a version, what gets deployed, and what happens when an identical request arrives twice.

WorkflowTemplate: the shared blueprint

  • WorkflowTemplate(id, engine_version, schema), owned by product and platform.
    • id: primary key.
    • engine_version: names the evaluator and renderer that can read this template.
    • schema: the permitted shape of fields, approvals and integrations.
  • Lifecycle: draft → published. Once published, the artifact never changes; new behaviour needs a new template version.
  • Retention:
    • Published templates are kept for the product or contract window, because older tenant configurations must still resolve against the precise template they were validated with.
    • Drafts can be garbage-collected after sitting idle for a safe period.

TenantConfig: one customer's overlay

  • TenantConfig(tenant_id, template_id, version, values): the overlay one customer applies on a template.
    • Key in practice: (tenant_id, version).
    • values carries only the tenant parameters the template schema permits.
  • Lifecycle: draft → validated → deployed or rolled_back.
    • Failed validation → back to draft/needs_fix, keeping its version number.
  • Retention: every published and rolled-back version is kept, so audit and rollback both work. Drafts follow platform policy and are dropped once abandoned or superseded.
  • Split: what the values mean for the business is the tenant's decision; validating and storing them is the platform's job.

AdapterDefinition: the contract with one downstream system

  • AdapterDefinition(name, contract_version, permissions): the contract for one downstream system (CRM, ticketing, storage, messaging).
    • Key: name + contract_version.
    • permissions: the scopes and capabilities the adapter needs, so the platform can reject a configuration requesting an adapter it has no safe way to call.
  • Run by the platform or integrations team.
  • Contracts ship as versions and retire only when no active tenant configuration relies on them.
  • Retired definitions stay available for past deployments and debugging, flagged inactive so a new configuration can't select them.

ConfigDeployment: the deployment ledger

  • ConfigDeployment(tenant_id, version, state): the only record that decides which of draft, validated, deployed, rolled_back or failed applies.
  • Ops and support read it to see which version is live right now.
  • Drift risk: the feature flag service also holds "what is live" state. Keep them aligned:
    • Either derive flag state from ledger events,
    • or write the ledger event first and replay the flag change from it until it succeeds.
    • Otherwise a rollback can be recorded while the old flag still serves the bad version.
  • Each state change is appended; nothing is rewritten in place.
  • A rollback adds a fresh deployment event pointing at an earlier good version.
  • Retention: the whole history, for the full support and audit window (incident reviews, customer support and change tracking depend on it).

The four records at a glance

Record Key Owner Lifecycle Retention
WorkflowTemplate id Product and platform draft → published; immutable once published Published: product or contract window. Idle drafts: garbage-collected
TenantConfig (tenant_id, version) The customer (values); the platform validates and stores draft → validated → deployed or rolled_back; failed validation returns to draft/needs_fix All published and rolled-back versions
AdapterDefinition name + contract_version Integrations team Versioned; retired when no active config uses it Retired versions kept, flagged inactive
ConfigDeployment (tenant_id, version) events Ops Append-only state transitions Full support and audit window
  • Separate owners stop the records tangling. Blur those lines and per-customer forks return.

Spoken answer ("what tells you which version is live?"): "ConfigDeployment, not TenantConfig. A tenant can have many configuration versions, validated and waiting; only the ledger records which one is deployed. Its transitions are append-only, so support sees what's running and how it got there, and a rollback is a new event, not an edit in place."


2. API contracts and idempotent deployment

Four API contracts

  • At interview scale, show one bounded declarative contract plus a write path that stops unsafe input before the registry sees it.
  • That proves the platform accepts limited configuration, checks it and publishes it as an immutable version.
POST /v1/configurations/validate
  • Takes a draft tenant configuration; returns validation errors plus a normalised preview. Never publishes.
  • Auth: bearer token or session scoped to the caller's tenant; validation only for tenants the caller may administer.
  • Body: template_id, version, values, optional idempotency_key (so validation traces can be replayed). No write effects, so retrying is safe anyway.
  • Responses: 200 OK good preview · 400 Bad Request wrong structure · 403 Forbidden tenant mismatch or missing rights · 422 Unprocessable Content schema or policy rules fail.
POST /v1/tenants/{id}/deployments
  • Starts a deployment, usually from a version that already passed validation. Returns the deployment ID and state.
  • Auth: caller belongs to tenant {id} or holds a delegated ops role. Deploying into another tenant is refused.
  • Idempotency (required, because it creates something):
    • Same key + identical body → same result.
    • Same key + different body → 422 Unprocessable Content (as the IETF Idempotency-Key draft recommends).
    • Retry while the first request is still in progress → 409 Conflict.
  • Errors: 401 Unauthorized absent or expired credentials · 403 Forbidden missing tenant permission · 404 Not Found version doesn't exist · 409 Conflict stale optimistic-concurrency token or key still in flight · 422 Unprocessable Content syntax passes but policy fails, or key reused with a different payload.
POST /v1/adapters/{name}/test
  • Runs an adapter mapping against a harmless test payload or a sandbox endpoint.
  • Auth: integration maintainers or tenant admins only.
  • Body: adapter name, test payload, mapping, optional sandbox selector. An idempotency key is accepted, so a retry doesn't produce a second test run or a second audit entry.
  • Errors: 404 Not Found unknown adapter · 403 Forbidden lacking permission · 422 Unprocessable Content mapping can't be applied · 502 Bad Gateway (or similar) sandbox dependency fails.
POST /v1/deployments/{id}/rollback
  • Records a new rollback state for the tenant; the old deployment is untouched.
  • Auth: tenant scope plus either raised ops rights or an explicit sign-off route.
  • Body: the target deployment or earlier good version, plus an idempotency key (rollback writes state and may be retried). Success returns the new deployment record; the previous one is never overwritten.
  • Errors: 404 Not Found no such deployment · 409 Conflict live state changed so much that rollback is unsafe · 422 Unprocessable Content target version no longer fits the current template or adapter contract.
Endpoint Writes state? Idempotency key Distinctive errors
POST /v1/configurations/validate No; never publishes Optional, for replaying traces 400 structure, 403 tenant, 422 schema or policy
POST /v1/tenants/{id}/deployments Yes; creates a deployment Required 401, 403, 404 version, 409 stale token or in flight, 422 policy or changed payload
POST /v1/adapters/{name}/test Audit entry only Accepted 404 adapter, 403, 422 mapping, 502 sandbox
POST /v1/deployments/{id}/rollback Yes; appends a rollback state Required 404, 409 unsafe live state, 422 target no longer fits

Rules shared by all four:

  • Authentication and authorisation are tenant-aware; writes across tenants are refused.
  • Create-style calls demand an idempotency key.
  • Same key and body → same answer. Reused key with a new body → rejected, never a quiet update.

Walk through an idempotent deployment

The call: an ops client sends POST /v1/tenants/acme/deployments with body {configVersion: 17, templateId: "tpl-9"} and key deploy-2024-11-18-001.

  1. First call.
    • The server creates dep-555 and replies 201 Created with deployment_id=dep-555 and state=deployed.
    • The write log stores the key, the result and a fingerprint of the request body.
    • Scoped to tenant and caller, so one tenant's key can never replay another tenant's deployment.
    • Keys are kept for a published retention window; after it, the same key starts a new request.
  2. Timeout, retry with the same key and body.
    • No dep-556 may appear. The reply is identical and still refers to dep-555.
  3. Retry with the same key but configVersion: 18.
    • The payload no longer matches → 422 Unprocessable Content.
  • Step 2 protects against duplicate side effects.
  • Step 3 protects against a client reusing a key for a different intent. Without it, a retry with changed data could silently deploy the wrong version under an old key.

What a production service adds

The whiteboard version omits four things on purpose:

Addition What it does
Optimistic concurrency Each write states the template or config version it expects to replace, so two operators can't race and silently overwrite. Expected version in the body → 409 Conflict; in an If-Match header → HTTP semantics call for 412 Precondition Failed.
Idempotency Retrying after a timeout never yields a second deployment or version
Bounded, safe retries Retry only failure types safe to repeat. Never replay a rejected validation or authorisation; that rejection isn't transient.
Observability Each validation, deployment, adapter test and rollback carries the request ID, tenant ID, idempotency key and configuration version, so support can rebuild what happened without combing application logs

Optimistic concurrency = each write names the version it expects; if someone else changed it first, the write is refused instead of overwriting.


3. The publish path in code

The smallest safe publication path

  • Publication carries the most risk: bad structure, broken mappings or faulty versioning here can take production down.
  • The source's TypeScript sketch is small but contains every control point. It's an illustration; the page doesn't run it.

The pieces and the control each teaches:

Piece Control
WorkflowConfig Limits the shape to a declarative contract with a version (version: 1; fields typed as text, number or date; approvals with when, role, slaHours; integrations with adapter, mapping)
JsonValue, JsonLogic Approval conditions as data: no route for arbitrary code
ValidationError A fixed vocabulary of error codes (path, code, message)
validateWorkflowConfig Type checks at the boundary: malformed payloads stop before any business logic (invalid_type, unsupported_version, required)
validatePolicy Keeps authorisation and workflow rules apart from structure; rejects an approval without a role or a positive numeric SLA (invalid_approval) and a duplicate approval role (duplicate_role)
validateAdapterMappings Compares integrations with an allowlist instead of trusting the author (unknown_adapter); rejects empty mapping keys (invalid_mapping)
Registry.putImmutable Appends each write as a new version; never edits or replaces an earlier one
Registry.versions Reads versions back without exposing the store for writing
publish Runs the checks in the one order that holds up; expected failures return structured errors, anything unexpected returns a generic internal_error, never a partial write
  • The JavaScript trap: the SLA test is !(slaHours > 0) with a type check, because undefined <= 0 is false in JavaScript. A missing SLA would otherwise pass.
function publish(configId: string, raw: unknown, allowedAdapters: Set<string>, registry: Registry): PublishResult {
  try {
    const config = validateWorkflowConfig(raw);          // parse
    validatePolicy(config);                              // validate
    validateAdapterMappings(config, allowedAdapters);    // authorise-by-policy
    const result = registry.putImmutable(configId, config); // persist
    return { ok: true, configId, version: result.version };
  } catch (error) {
    if (error instanceof ConfigValidationError) return { ok: false, errors: error.errors };
    return { ok: false, errors: [{ path: "$", code: "internal_error", message: "Unexpected failure during publish" }] };
  }
}

The order: raw input → validateWorkflowConfig (parse) → validatePolicy (validate) → validateAdapterMappings (authorise) → registry.putImmutable (persist). Each stage has a failure exit returning ok: false; only the last returns ok: true with configId and version.

Spoken answer ("why that order?"): "Cheap structural checks come first and fail fast, so the costlier policy and adapter checks only run on sound input. Nothing is written until every earlier step passes, so the path fails closed: an error leaves the registry exactly as it was."

  • The registry keeps every version. Each publish appends to the configuration's version list; snapshot holds the config exactly as published, so any earlier version can be read back or redeployed.
  • The in-memory list stands in for durable storage. A production registry stores each artifact under (configId, version), usually with a content digest beside it.

Pin the contract and inject a failure

  • A strong answer brings two tests: one pins the contract, the other injects a failure.
Test Input Expected
Contract test cfg-1: one requester text field; two approvals for manager, each slaHours: 24; no integrations; allowlist crm result.ok is false; errors[0].code is duplicate_role
Failure-injection test cfg-2: one approval (manager, slaHours: 24); integration with adapter unknown, mapping { a: "b" }; allowlist crm result.ok is false and registry.versions("cfg-2") has length 0: nothing was written
  • The contract test shows the API rejecting a config that is structurally sound but breaks policy.
  • The failure-injection test confirms publish fails closed.
  • A real service would add: tests for duplicate idempotency keys, deployment rollback, and a concurrency test proving stale versions are refused.
  • Teams hire FDEs who can go from a customer's workflow pain → state model → API semantics → validation code fit for production.

An interview-sized production sketch with caps

  • Deliberately narrow. It shows one publish-path invariant: a configuration naming an unknown adapter is refused before it can go live.

Caveat: the source chose these caps as stand-ins, not platform standards.

const ALLOWED_FIELD_TYPES = new Set(["text", "number", "date", "boolean", "email"]);
const MAX_FIELDS = 50;
const MAX_APPROVALS = 10;
const MAX_INTEGRATIONS = 20;
// approval.slaHours, if present: an integer from 1 to 168 (one week)

What it adds over the first sketch:

  • The expressive-power caps from step 3 of the walkthrough: field, approval and integration counts.
  • An allowlist of five field types.
  • Duplicate field key rejection.
  • An SLA bounded to 1–168 hours.
  • Checks for tenantId, an integer version of at least 1, plain-object when conditions and mapping.

What it does differently:

  • Returns a single error string rather than structured errors.
  • Only validates; doesn't persist.

Its tests:

Test Fixture (configWithAdapter) Expected
Rejects an unknown adapter tenant-acme, version 1, manager approval with slaHours: 24, adapter arbitrary-shell; registry knows only crm Throws /unknown adapter/: fails closed long before runtime
Accepts a known adapter Same, with adapter crm result.ok is true
  • What a real companion repository would still need: tested dependencies, fuller schema validation, structured logging and a link to a real persistence layer.
  • The test makes the invariant plain without claiming the code is finished.

4. Failure cases, primitives and runbooks

Four more named failure cases

  • The loop drill (walkthrough step 5) is the headline. Four others need a named mitigation:
Failure What happens Mitigation
Adapter contract changes A downstream service renames a relied-on field or changes its response shape; every tenant on that adapter breaks at once Version adapters, pin the schema each expects, add compatibility checks, and quarantine any mismatch rather than letting it pass as a quiet partial success
A tenant upgrade breaks an old field mapping After upgrading from version 1 to version 2, earlier integrations may still rely on the replaced mapping Versioned field maps and a validated migration. Keep the old mapping running until every execution using it has drained.
An untested feature-flag combination Two toggles each safe alone create a bad path together A matrix of known-safe combinations for high-risk flags; ban unsupported combinations in production. At launch, any unreviewed combination fails closed.
Custom code escapes the sandbox Once customer logic runs anywhere, a breakout is a high-severity event Arbitrary code off by default. A sandbox gets least privilege, resource caps, outbound network limits and its own approval gates. A breakout shuts the extension path and starts incident response.

Six operational primitives

  • At each failure, the system picks the least dangerous next state.
Primitive Rule
Timeouts Each adapter gets its own explicit timeout, so one hung dependency can't stall the whole workflow
Retries Only transient and idempotent operations; cap the attempts and back off between them
Idempotency Any write the outside world can see carries an idempotency key (or another dedupe method), so a retry never repeats a side effect
Circuit breakers When a dependency is plainly unhealthy, open the breaker: shed traffic at once instead of letting doomed requests pile up
Dead-letter handling Once safe retries are used up, repeat failures go to a dead-letter queue or failure inbox a person can inspect
Human escalation When the action can't be undone, the configuration is unclear, or the evidence points to a policy breach rather than a passing outage

Write evidence and runbooks before launch

They must cover:

  • Who may publish configuration
  • How versions get approved
  • How to switch off a bad workflow
  • How to rotate adapters
  • How to revoke secrets
  • How to replay one tenant's incident without exposing another tenant's data

Soundbite: "A team that can't write these answers down in calm conditions won't find them in the middle of an outage."


5. Cost, build or buy, regulation and AI authoring

How the source graded itself

  • The source reviewed its guide once against a 20-point checklist for design case studies.
  • Sixteen met; four fell short as deliberate scope choices: unit cost by driver, build or buy, regulation and governance, responsible AI.
  • It counted eight stakeholder groups by including the four roles beneath the four groups.
Phase Item Source verdict Where it's covered
Problem framing and discovery 1. Feature request turned into a business outcome Met Walkthrough step 1
2. Who the stakeholders are Met; eight groups and roles Walkthrough step 1
3. Questions whose answers reshape the design Met; six-question tree Walkthrough step 2
4. Splitting and ranking requirements Met Walkthrough step 2
5. What is out of scope Met; five MVP non-goals Walkthrough step 2
Estimation and architecture 6. Rough sizing and capacity arithmetic Met; worked estimate, envelope, sensitivity table Walkthrough step 3
7. Cost per unit, split by driver Partly met; no table separates cost drivers Cost model below
8. Whole architecture and data flow Met Walkthrough step 4
9. Records and API contracts Met; four records, four contracts Deep dives 1 and 2
10. Build or buy, vendor or model Not met Build or buy below
Trade-offs, security and reliability 11. Named trade-offs with fair verdicts Met; four pairs Walkthrough step 8
12. Threats and controls Met; four controls Walkthrough step 5
13. Failure drills Met; loop drill, four more cases, six-row policy table Walkthrough step 5, deep dive 4
14. How the system is tested Met; contract, failure-injection and invariant tests Deep dive 3
Delivery, governance and communication 15. Layered metrics and observability Met; six metrics in four layers Walkthrough step 7
16. Staged rollout, risk register, rollback gates Met Walkthrough steps 6 and 8
17. Regulation and governance depth Not met; no data residency or industry audit regimes Regulation below
18. Responsible AI and non-obvious risks Not met; no AI component AI authoring below
19. How people adopt the change Met Walkthrough step 6
20. Talk plan and self-scoring rubric Met Practice (full casebook)
  • The source's author added a perspective on each gap. Use these if an interviewer presses on one.

A four-line cost model

  • Built on the four-step capacity envelope (walkthrough step 3).
Line What it prices Driver
1 Each validated version CPU and network for schema, policy, dependency and dry-run checks
2 Each deployment Fan-out to tenant instances and downstream sync jobs; raw edit volume barely matters
3 Each second a plugin runs in the sandbox Plugin run time
4 Storage The version graph and the append-only ConfigDeployment ledger

Soundbite: "Tenants, not the platform design, set validation cost."

  • Deep branching forms or many-clause rules make validation dearer even when nothing on the platform changes.
  • So the expressive-power limits (max fields, max rule clauses, bounded plugin windows) control cost as much as safety.
  • Report cost per tenant, line by line. A noisy tenant then shows up clearly, and "config or adapter?" becomes a debate about real figures.

Build the engine, buy the commodity

  • The obvious question: the workflow and rules engine. Build the declarative engine, or buy a BPM or workflow-orchestration product (a commercial rules engine, workflow-as-a-service) and keep the same control-plane/data-plane split around it.

BPM = business process management. SSO = single sign-on, one company login for every app. IdP = identity provider.

Part Verdict Why
Identity and SSO federation Buy Solved and commoditised; the vendor owns its security record and competes on it. Fits if customer admins log in through an enterprise IdP.
Workflow engine Build The differentiator is the constrained, tenant-safe configuration model (validation, versioning, sandboxing). No vendor can take responsibility for it, and it's what the interviewer wants designed.
Adapter SDK In between Reuse or buy a connector framework for common systems (CRM, ticketing). Keep the adapter contract and permission model in-house: the step 5 security controls depend on that trust boundary.

Regulation, residency and audit

  • Already there: control/data plane split, data partitioned by tenant ID, each adapter scoped to one tenant.
  • Data residency extends that:
    • Customers under different jurisdictions may need region-fixed storage for the configuration registry and workflow audit store.
    • TenantConfig and ConfigDeployment each gain a region field.
    • The ledger can then show where each tenant's data was held and where its workflows ran.
Regime How the publish audit log fits
SOC 2, change-management criterion CC8.1 Answers most of what an auditor asks: who signed off, what was tested, what shipped
SOX IT general controls Same evidence
HIPAA Does less: its audit-control rule targets activity on any system storing health data, beyond configuration changes alone

SOX = the Sarbanes-Oxley Act, the US law on financial-reporting controls. HIPAA = the Health Insurance Portability and Accountability Act, the US law protecting health data.

  • The remaining gap is modest: an explicit retention period per regulation, added to the retention rules on the four records.
  • Raise it before anyone asks. Pick one regulation matching the customer's industry. Good example: SOX-style segregation of duties for approval workflows in financial services, satisfied by the existing approval roles and audit trail with no new infrastructure.

Responsible AI, and AI-assisted authoring

  • Nothing in this design is AI. Its "intelligence" is deterministic validation, policy checks and rule evaluation.
  • Bolting on a responsible-AI story would sound hollow. Tell the interviewer that directly.
  • If a later release adds an AI authoring helper (for example, drafting an approval graph from a plain-language description):
    • Whatever it proposes is untrusted input.
    • It passes the same schema, policy and cycle-detection gates as human-written config.
    • It never gets a route around them.

Spoken answer (the trade-off): "AI-assisted authoring adds risk at the boundary this design already treats as hostile, the path from config editor to validator. It raises the volume of untrusted input reaching the validator; the trust model stays the same."


6. References

The source checked these on 27 September 2026. Each supports a specific claim.

Reference Supports Used in
The Idempotency-Key HTTP Header Field (IETF draft -07) 422 for a reused key with a different body, 409 for a retry while the first request runs, replay returns the original result Deployment contract
RFC 9110: HTTP Semantics Meanings of 409 Conflict, 412 Precondition Failed for a failed If-Match, and the 422 Unprocessable Content name Optimistic concurrency
AICPA 2017 Trust Services Criteria (revised points of focus, 2022) SOC 2 change-management criterion CC8.1 Regulation
PCAOB AS 2201: An Audit of Internal Control Over Financial Reporting SOX audits test IT controls, including program changes and segregation of duties Regulation
45 CFR 164.312(b), HIPAA audit controls HIPAA's audit rule covers activity on systems holding health data Regulation

Quick Recall: Lines to Say in the Interview

  • "Product owns the template, the customer owns the values, integrations owns the adapter, ops owns the ledger."
  • "The ledger says what's live, not the config record. Rollback is a new event."
  • "Same key and body returns dep-555 again; same key with version 18 gets a 422."
  • "Never replay a rejected validation or authorisation; that rejection isn't transient."
  • "Parse, validate, authorise-by-policy, persist. Nothing is written until every check passes."
  • "The failure test proves the registry is still empty after a rejected publish."
  • "Tenants set validation cost, so expressive-power caps control cost as much as safety."
  • "Build the engine, buy the commodity, keep the adapter contract in-house."
  • "Nothing here is AI. If we add AI authoring, its output is untrusted input through the same gates."

Quick review

One sentence: keep one small, stable workflow core; put tenant differences into validated, immutable, flag-exposed configuration with an append-only ledger; deny arbitrary code; fail closed on loops; widen only on reuse.

30-Second Cheat Sheet

  • Outcome: one stable core, customisation safe, versioned and supportable, so ten customers never become ten forks.
  • Authorship is architecture: customer admins need validation, previews, narrow building blocks and safe defaults.
  • Publish is not exposure: an immutable version goes live through a tenant flag; rollback flips it back.
  • The ledger says what's live: ConfigDeployment, not TenantConfig.
  • Publish order: parse → validate → authorise-by-policy → persist.
  • Idempotency: same key and body → same deployment; changed body → 422; still in flight → 409.
  • Numbers: 1,000/day ≈ 42/hour; 250/hour in the 2-hour window; validation 2–10 s.
  • Exceptions have four homes: configuration, adapter, shared service or core.

1. Recall the decisions

Decision What to say
Outcome One stable product core with customisation that is safe, versioned and supportable, so ten customers never become ten forks. Measure variations shipped with no fork, hotfix or escalation, not configurable fields.
Authorship is architecture Customer admins need validation, previews, narrow building blocks and safe defaults
Two planes The control plane writes, checks, versions and promotes; the data plane runs live workflows. Risky change stays off the hot path.
Publish is not exposure An immutable version goes live through a tenant flag, one tenant then a cohort; rollback flips the flag back
The ledger says what is live The append-only ConfigDeployment, not TenantConfig, so rollback is a new event
Publish order parse → validate → authorise-by-policy → persist; cheap checks fail fast and nothing is written until all pass
Idempotency Same key and body returns the same deployment; a changed body gets 422; a retry still in flight gets 409
Code is off by default Approved extensions run sandboxed with least privilege, resource caps and outbound limits
Loops fail closed Cycle detection at publish or a max-hop guard at runtime; the tenant falls back to the last known-good version
Exceptions have four homes Configuration, adapter, shared service or core, tested in that decision order

2. Recall the numbers and gates

Numbers

Item Value
Average rate 1,000 versions a day ≈ 42 an hour
Peak Half of them in a 2-hour window ≈ 250 an hour, roughly 6x, before retries
Validation cost An assumed 2–10 seconds → save is fast and durable, validation is queued and bounded, deployment is idempotent and retryable
Deployment capacity Set by fan-out across tenants, regions and integrations, not by human edits
Partition key Tenant ID
At 10,000 versions/day Separate queues, worker pools, tighter plugin caps
At 100,000 versions/day Per-tenant quotas, sharded queues, firmer isolation
Sketch caps (illustrative) 50 fields, 10 approvals, 20 integrations, SLA of 1–168 hours

Rollout gates

  • The pattern is stable
  • The customer accepts support and rollback
  • Config cuts custom work
  • Customers two and three reuse it
  • Widen only while fork count stays at zero.

Publish only when

  • Validation passes
  • Adapters are healthy
  • Rollback is rehearsed
  • The champion agrees

Roll back on

  • Repeated validation failures
  • Unexpected integration errors
  • Rising early-tenant incidents
  • Unstable approvals

3. Close in one answer

Sixty-second close (source's version): "Keep one small, stable workflow core and put tenant differences into declarative configuration that is validated, published as immutable versions and exposed one tenant at a time behind a flag, with an append-only ledger that makes every rollback a new event; deny arbitrary code by default, fail closed on loops, and widen the configuration surface only when a second and third customer reuse it without a fork."


Flashcard Drill


Quick Recall: Lines to Say in the Interview

  • "Ten customers must never become ten forks."
  • "Measure variations shipped with no fork, hotfix or escalation."
  • "Publishing a version is not exposing it; a tenant flag does that."
  • "ConfigDeployment says what's live, so a rollback is a new event."
  • "Parse, validate, authorise-by-policy, persist."
  • "Same key, changed body: 422. Still in flight: 409."
  • "42 an hour on average, 250 an hour in the window, 2 to 10 seconds a validation."
  • "Configuration, adapter, shared service or core, in that order."

Where next