Guided multi-turn conversation flows with NeMo Guardrails

Scripting required steps in customer service and intake chats with NeMo Guardrails dialog rails, collecting values from users, and handing off to the LLM for open-ended answers.

On this page

Guided conversation flows in NeMo Guardrails: when teams need them

A team needs guided conversation flows when its assistant must collect fields in a fixed order before it can act. A customer service or intake assistant might have to confirm an account holder, record a reason for the request and capture a set of required values before a case can be opened. A free-form LLM can skip those steps, reorder them or accept an incomplete answer. NeMo Guardrails addresses this with dialog rails, which are written in Colang and let the owning team script the required steps, decide which intents route to which step and control what happens when a user goes off script. The toolkit is licensed under Apache 2.0, so the scripted flows, configuration files and any custom actions can be kept inside your own repository and infrastructure.

Dialog rails are one of the five rail types the NeMo Guardrails README describes, alongside input rails, retrieval rails, execution rails and output rails. In a guided flow, the Colang script holds the sequence and the LLM is called only where open-ended language is needed, such as answering a general question about a product or explaining a policy. That split is the main design decision: which turns are fixed and which are handed to the model, and how the assistant returns to the script afterward. Teams should map their intake steps on paper before writing any Colang, marking each step as required, optional or open-ended, and listing the values that must be validated before the flow can move on.

Before committing to this pattern, confirm three things with your own engineers. First, check whether the number of scripted turns and the LLM calls they trigger fit your latency and cost limits, because each dialog turn can involve model calls. Second, confirm which Colang version your project will use, since the README lists Colang 1.0 as the default and Colang 2.0 as also supported. Third, decide who owns the flow definitions and how changes are tested before release. Teams that only need a single topic refusal, or a classifier-based check on each message, may not need dialog rails at all, and that comparison belongs to the dialog rails and input rails guidance elsewhere on this site.

Which flow pattern fits which conversation

An intake conversation collects a fixed set of values before the assistant can do anything useful, such as a service request, a account verification step or a consent record. The Colang flow must own the order of questions and must not advance until each required value is present and valid. The LLM should only phrase the questions and explain what is missing; it should not decide whether the intake is complete.

  • Required fields as flow state: Each value is a named variable that the flow checks before moving to the next step.
  • Validation before advancing: A flow step re-asks the user when a value is empty, malformed or outside an allowed list.
  • Correction paths: The flow must let the user change an earlier answer without restarting the whole intake.
  • Completion gate: The final action runs only when every required variable is set, so the LLM cannot skip a step by improvising.
  • Free-text fields: Open fields such as a problem description can still go to the LLM for clarifying questions, but the flow stores the result.

Check that every required field has a test where the user skips it, gives an invalid value and changes an answer halfway through.

Configuration options for collecting values and handing off

This table compares the authoring and handoff options for guided conversations in NeMo Guardrails, including Colang version, value collection and fallback behavior. Read each row for the situation where the option fits and the trade-off it brings, then use the Colang version topic to settle the version choice before building flows.

OptionWhen it fitsTrade-offDecide with
Colang 1.0 flows (default)Teams starting from the README default who want the most published examples and the simplest path to a working intake flowColang 2.0 is the newer language, and conversion to it needs manual review of the outputColang version topic
Colang 2.0 flowsNew projects that need richer flow constructs for multi-step value collection and want to build on the newer languageConfirm the beta status and tooling for your chosen release before committing the designColang version topic
Slot-style collection in flowsShort, fixed sets of values such as account number, date or reference that the bot asks for in a fixed orderLogic for branching, validation and retries grows quickly as the number of fields increasesTest each prompt order with sample users
Custom Python actions for collectionValues that need lookups, format checks against internal systems or conditional validationAdds code to review, test and deploy, and the action must handle errors without exposing dataYour engineering and security review
Fallback to the LLM for handoffOpen-ended questions that fall outside the scripted path and where a general answer is acceptableThe model may answer outside approved scope or invent facts, so output rails and topic checks are neededOutput rail and topic test results
Explicit bot responses for handoffRegulated or customer-facing steps where the reply must be fixed, reviewed and auditableEvery edge case needs a written response, which increases authoring and maintenance workCompliance and content owner sign-off

Setting up a guided flow project step by step

This sequence takes a team from an empty machine to a tested NeMo Guardrails project that asks for required values in order, validates them, and hands open-ended questions to the LLM. Each step ends with a check so problems surface before the flow reaches users.

  1. Confirm the Python version

    Check that the runtime uses Python 3.11, 3.12 or 3.13, the versions the current NeMo Guardrails release requires. Your platform or DevOps team usually owns the interpreter, so confirm it in the same environment where the bot will run. The step is done when python --version reports a supported version inside the virtual environment you will use for the project.

  2. Install nemoguardrails from PyPI

    Create an isolated virtual environment and install the nemoguardrails package from PyPI, pinning the version your team has reviewed. Record the exact version in your dependency file so every developer and build pipeline uses the same release. The step is done when pip show nemoguardrails returns the pinned version and the package imports cleanly in a Python shell.

  3. Create the config and Colang files

    Create a project folder with a config.yml file that names the LLM model and the rails you plan to use, plus a Colang file for the conversation logic. Decide early whether you will write Colang 1.0 (the default) or Colang 2.0, because the two syntaxes differ and migrating later needs manual review. The step is done when the folder loads without configuration errors and the engine starts with the placeholder flow.

  4. Define intents and the required-field flow

    Write user intents with example utterances, then write a flow that asks for each required value in a fixed order, stores the answer, and repeats the question when a value is missing. Keep the list of fields in a single place so the business owner can review it. The step is done when a dialog run through the chat CLI moves from the first question to the summary without skipping a field.

  5. Add custom actions for validation

    Write Python actions that check each captured value, such as format, allowed ranges or lookups against your own systems, and return a result the flow can branch on. Ask the owning team to confirm which systems the actions may call and which credentials they use. The step is done when a deliberately invalid value triggers the correction path and a valid value continues the flow.

  6. Hand off open-ended questions to the LLM

    Add a catch-all path so that questions outside the required fields go to the LLM, and make sure the flow returns to the required-field sequence afterward. Confirm with your compliance owner which topics the LLM may answer in this flow. The step is done when an unrelated question gets an LLM answer and the next turn resumes the intake where it stopped.

  7. Test the full dialog in the chat CLI

    Run the project in the chat CLI and walk through complete conversations, including corrections, interruptions and an invalid value. Confirm that a full run reaches the final step with every value captured and passed to the action or output that consumes it. The step is done when the scripted runs pass consistently, and the transcripts are saved as regression tests for later changes.

How a guided turn moves from user input to LLM handoff

A user message enters the dialog rails first, where Colang flows match its intent to a canonical form. If the intent starts a scripted step, the flow asks for a value and passes it to a custom action that validates it, then either prompts for the next required field or hands the turn to the LLM for an open-ended answer. The trust boundary sits around the custom actions and the LLM, so check what data each one can see and what it returns to the flow.

Routing of one user turn through dialog rails, a validation action and the LLM.

Security risks in scripted conversations

Scripted dialog flows decide what a user can say, in what order, and what data reaches the model and the logs. The risks below connect because each one breaks the assumption that the flow controls the conversation. Each card names the control to design in and the log or test that shows it works.

Users skipping or reordering steps

Users often answer a later question first, repeat a step, or jump ahead to the open-ended LLM answer. A flow that only checks the current turn can accept a case number before identity verification. Design explicit state variables that must be set before a step can complete, and reject out-of-order intents with a fallback message. Test by replaying scripted paths with skipped and reversed steps and confirming that each gated action stays unreachable until its prerequisites are set.

Injected text carried into actions

Values a user types into a collection step can contain instructions aimed at a tool call or at the model. If a collected value flows unchanged into a custom action, an API request or a prompt, the flow inherits the injection. Validate each collected value against a declared type and length, pass values to actions as typed parameters rather than interpolated text, and keep action outputs out of the next prompt unless they are checked. Test with injection strings in every collection step and confirm that the action receives only the validated value.

Personal data in logs and transcripts

Intake flows exist to collect names, dates of birth, account numbers or health details, and those values are easy to write into debug logs, chat transcripts and traces. Decide which collected fields are sensitive before the flow is written, mask them before logging, and keep raw values out of verbose output that teams share. Confirm your retention settings for transcripts with your platform owner, then check a sample of logs for each sensitive field to prove the masking works.

Stale state at LLM handoff

When a flow hands an open-ended question to the LLM, the model may see variables collected earlier that have since been corrected, expired or never validated. A user who changes an address mid-flow can leave the old value in context. Clear or refresh session variables at each handoff, pass only the fields the LLM needs, and mark which values were validated. Prove the control with a test that corrects a value mid-flow and then asks an open question, checking that the prompt sent to the model contains the new value only.

Operating and testing flows after launch

Every change to a dialog flow needs a regression test before it reaches users. A Colang flow that handles a required step, such as confirming an account holder's date of birth, can stop firing after an unrelated edit to a canonical form or a neighboring flow. Keep a suite of recorded conversations that cover each required step, each handoff to the LLM and each refusal path, and run it in your pipeline on every change to config.yml, Colang files or Python actions. Define pass criteria in advance, including which collected values must be stored and which turns must route to the LLM. When a test fails, the debugging topic covers how to find out why a flow did or did not fire, using verbose mode, explain() and structured logs.

Decide early how the flows will be served, because that choice sets how you test and roll them out. NeMo Guardrails can run from the Python API inside your application, or as a guardrails server that loads configurations from a folder and exposes an HTTP API. In server mode, each configuration folder is the unit you promote between environments, so the flows, actions and model settings must travel together. The README describes a Dockerfile for building a server image, which gives you a repeatable artifact to test. Confirm the exact build steps and base image requirements against the current release, since the project is at version 0.25.0 and the README is the authority for those details.

Keep every configuration change in your own version-controlled repository. Store the configuration folders, Colang files, custom actions and the image build definition together, and require a review for changes to required-step flows, since these determine what data a customer must provide. Tag each release so you can match a deployed image to the exact flows that produced a given conversation record. Confirm with your security and compliance team how long conversation logs and version history must be retained, because those records are often what they ask for when they review an assistant's behavior.

Limits to confirm in your environment

The dialog flow design in this guide depends on a few moving parts that change between releases and deployment models. Each card below names one thing to confirm with NVIDIA or your own tests before you commit flows to production.

Colang 2.0 maturity for your use

Colang 2.0 is supported, but Colang 1.0 remains the default. Before choosing 2.0 for a guided intake flow, confirm with NVIDIA which flow constructs, action patterns and integrations your scenario needs are fully supported in the version you will deploy. Build a short spike of your most complex collection step and test it end to end before you commit the whole conversation design to that version.

Colang 2 migration guide

Effect of 0.25.0 changes on flows

The current release is 0.25.0, and the previous release was 0.24.1. Read the release notes for every version between your pilot and your target, then rerun your full dialog test set against the new version. Pay particular attention to how intents are matched, how flows resume after an interruption and how the LLM is called for open-ended turns, since a change in any of these can silently alter a multi-step script.

Guardrails releases

LLMRails deprecation timing

Version 0.25.0 deprecates the LLMRails class in favor of Guardrails, with removal planned no earlier than 0.27.0. Any intake or service application that instantiates LLMRails will need a change at some point. Ask NVIDIA for the planned removal version, and plan the switch within your own release cycle rather than waiting for a forced upgrade that lands during a customer-facing change window.

Colang conversion needs manual review

If your flows began in Colang 1.0 and you move to 2.x, the nemoguardrails convert tool can produce a starting point, but NVIDIA states that converted configurations still need manual review. Budget time for reviewing every converted flow, especially those that collect values, branch on user answers or hand off to the LLM. Treat each converted flow as new code that needs its own regression tests.

Migration guide

Microservice sunset and deployment model

NVIDIA has retired the NeMo Guardrails microservice, and its container is no longer supported. If your design assumed the microservice as the runtime, confirm your path with your NVIDIA account team and decide whether you will run the library as a guardrails server in your own containers. Verify that the dialog flows, action dependencies and configuration folders you build run unchanged in the self-hosted model before you rely on them.

Sunset notice

Questions buyers ask before building guided flows

What drives the cost of a guided conversation flow build?

The main drivers are the number of flows, the number of fields each flow collects, the validation logic behind each field, and how much test coverage the conversations need before go-live. Each flow adds design work with domain experts, Colang authoring, Python actions for lookups or checks, and dialog tests. Costs are mostly one-time build effort, with recurring costs for hosting, model calls and changes after launch. Ask any quote to break out flows, fields, actions and test scope separately so you can see which items move the price. The NeMo Guardrails library itself is Apache 2.0 licensed, so the license is not a cost line in the build.

How long does a pilot of guided flows take?

Pilot length depends on the scope agreed in writing, the number of flows, and how quickly your domain experts can confirm the required steps and answers. The NeMo Guardrails library does not set this timeline, because most of the time goes into conversation design, validation rules and review of sample dialogs rather than installing software. Ask for a plan that lists each flow, the decisions it needs from your team, and the test rounds before a pilot is judged. A pilot limited to two or three flows with clear data rules usually moves faster than one that tries to cover a whole intake process.

What must our team provide before the build starts?

You need to provide four things. Domain experts must define the steps, the required values and what a valid answer looks like for each flow. You should supply real or representative sample dialogs, including the awkward cases your staff already handle. Data rules must state what may be stored, which fields are sensitive, and which systems may be queried during a flow. Hosting decisions must be settled early: where the server runs, which model endpoint answers open-ended questions, and who holds access to logs. Missing any of these usually shows up as rework in the flow design stage.

Can our internal team build guided flows without a partner?

Yes, a team with Python experience and someone who understands Colang can build guided flows in-house. The harder part is usually not the syntax but the testing: deciding which conversations must pass, which must be refused, and how the flow behaves when a user changes their mind mid-conversation. Check whether your team has capacity to maintain the configuration after launch and to review changes with compliance. If you want a partner, ask for a written scope that separates design, build, test and handover so you can compare it directly with an internal estimate.

How do we handle changes to flows after launch?

Treat flow definitions, Python actions and example dialogs as versioned code that goes through the same review as other production changes. Each change should come with updated regression tests so you can see whether an edit affected a different flow. Most changes are small, such as new fields, wording or validation rules, but a change to a shared action can affect several flows. Ask who will own changes after handover, how changes are reviewed, and whether ongoing support, upgrades and continuous testing will be provided under a retainer. NeMo Guardrails releases also change over time, so plan a check of each upgrade against your dialog tests.

Which Colang version should a new guided flow project use?

Colang 1.0 is the default in NeMo Guardrails, and Colang 2.0 is also supported, so the choice must be made explicitly in the configuration. Flows that depend on multi-step state and value collection should be prototyped on the version you plan to run in production, because the two versions differ in syntax and behavior. NVIDIA documents a conversion path with the nemoguardrails convert tool, but the same documentation says converted configurations still need manual review. Budget time for that review if you migrate an existing project.

What should we verify before a flow goes live?

Verify that each flow reaches its end state for every expected path, that refusals and handoffs to the LLM happen at the right moment, and that collected values are validated and stored as your data rules require. Run the sample dialogs from your domain experts as automated tests and keep them in version control. Also test abuse cases, such as a user who skips a step, repeats an answer, or tries to change a value after confirmation. Ask for a written list of test cases and the pass criteria before sign-off, so the acceptance standard is clear to both sides.

Where to read the official NeMo Guardrails documentation

Start with the NeMo Guardrails documentation for the current behavior of dialog rails, flow definitions and the Colang syntax you will write for a guided intake or service conversation. Read the sections on Colang 1.0 and Colang 2.0 side by side before you choose a version, because the flow syntax, the way flows are matched and the tooling differ between them. Keep a copy of the exact version you run in your own environment, since the examples on the documentation site follow the latest release and may not match a pinned library.

Use the NeMo Guardrails GitHub repository to read the source, open issues about flow matching and review example configurations that include collected-value and handoff patterns. The release notes are the place to check version changes before any upgrade, because a flow that works on one release can behave differently after a change to dialog handling or to the Python API. Confirm the minimum Python version for the release you plan to install, which for 0.25.0 is supplied in the release metadata, and compare each release note against your own flows before you change the pinned version.

If you start on Colang 1.0 or plan to move an existing guided flow, read the Colang 2 migration guide before you convert anything. NVIDIA states that the nemoguardrails convert tool produces configurations that still need manual review, so budget review time for every multi-turn flow, especially those that collect values and branch on them. Ask your implementation partner or internal team to record which flows were converted, which were rewritten by hand and which tests confirm each one still asks for the same values in the same order.

How DeployOpen scopes and delivers guided conversation flows

DeployOpen plans, builds, tests and documents guided multi-turn conversation flows in NeMo Guardrails inside the client's own infrastructure. Each engagement starts from a written scope that names the required steps, the values collected from users, and the points where the assistant hands off to the LLM.

How we scope

  • Map each required step in the intake or service conversation and the values the flow must collect from the user.
  • Define which turns stay in scripted Colang flows and which pass to the LLM for open-ended answers.
  • Agree in writing which Colang version, Python actions and server deployment the flows will run on.
  • Set the acceptance tests for refusals, abandoned flows and off-path user messages before the build starts.

How we build

  • Write the Colang flows, intent examples and bot responses for each step in the agreed scope.
  • Implement Python actions that validate collected values and call your internal systems where the scope requires it.
  • Configure the config.yml and dialog rails so flows interrupt and resume predictably when users change direction.
  • Test each flow with scripted conversations, including incomplete inputs, corrections and users who ask unrelated questions.

How we hand over

  • Deliver the Colang files, actions, configuration and deployment artifacts in a version-controlled repository you own.
  • Document each flow with its entry conditions, collected values, exit paths and the LLM handoff points.
  • Provide a regression test set so your team can rerun the conversations after any dialog change.
  • Walk your engineers through the flow design, the debugging approach and the known limits of intent matching.

How we support

  • Review flow changes and new intents against the regression set before they reach production.
  • Confirm the NeMo Guardrails version and Python version in use before planning an upgrade, since Colang and API changes can affect flows.
  • Offer ongoing support, upgrades and continuous testing as a retainer once the initial scope is delivered.
  • Ask for a quote built from the written scope, which lists the flows, integrations and test coverage included.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.