> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/ai/limio-agents/workflows.md).

# Workflows

Workflows are configured in the Limio admin under **AI → Workflows**. A workflow decides which agent answers on a given domain, and it can choose between agents based on the page the visitor is on, where they are, whether they are signed in, and what they are.

An agent does not know where it runs. Publishing an agent does not put it on your site: until a workflow routes a domain to it, chat on that domain does not start. The chat window still opens, with default chrome and no greeting; the visitor is told chat is not configured when they send their first message.

## The model

A workflow is a list of domains plus a flow. The flow is a small diagram that starts at the Domain node and ends at an agent. When a visitor opens the chat, Limio walks the diagram from the Domain node, following the branch each test resolves to, and the first agent it reaches answers.

The simplest useful flow is the Domain node connected straight to an agent: everyone on those domains gets that agent.

## Domains

Enter the bare host, `shop.example.com`, not `https://shop.example.com/pages`. A scheme or path is trimmed for you. Include the port if there is one, as in `localhost:8003`.

The host has to be the one the chat request arrives on. For chat on your Limio shop that is your shop domain. The [chat embed](/ai/chat-embed/chat-embed.md) sends its requests to your chat API host rather than to the site the visitor is reading, so ask your Limio contact which host to enter.

One workflow can list several domains, and they all get the same flow. Do not list the same domain on two workflows: one of them wins, and which one is not defined.

## Nodes

| Node      | What it does                                                                                                                                      |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Domain    | Where every visit begins. It lists the workflow's domains and has one outgoing connection.                                                        |
| Condition | One test, two branches: match and else.                                                                                                           |
| Router    | One test with several cases, for fanning out without stacking conditions. The first case that matches wins; the no-match branch catches the rest. |
| Agent     | An endpoint. The walk stops here and this agent answers.                                                                                          |

An agent node with nothing connected into it is the workflow's fallback. If the walk ends without reaching an agent, because a test sent the visitor down a branch you left empty, the fallback answers. Without one, chat does not start for that visitor.

## Conditions

| Condition           | Matches on                                                                                                                                                                                          |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page                | The page the visitor is on. A value matches that path and anything below it: `/checkout` matches `/checkout` and `/checkout/payment`, but not `/checkoutxyz`. A trailing slash makes no difference. |
| Country             | The visitor's country.                                                                                                                                                                              |
| Authentication      | Whether the visitor is signed in. Enter `validJwtWithUserId` to match signed-in visitors, `noValidJwt` for signed-out.                                                                              |
| Subscription Status | Whether the visitor is an active subscriber. Enter `activeSub` to match active subscribers, `noActiveSub` for everyone else.                                                                        |
| Segment             | A segment the visitor belongs to.                                                                                                                                                                   |
| Query String        | Text anywhere in the page's query string, so you can route a campaign link.                                                                                                                         |
| Cookie Exists       | Whether a named cookie is present.                                                                                                                                                                  |

Condition values are entered as a comma-separated list; the condition matches when any value does.

{% hint style="warning" %}
The editor also offers Region, City, Device, Subscription Offer Label, Subscription Billing Country and JSON Web Token. Limio does not evaluate these yet. A test on one never matches, so every visitor takes its else branch. The editor marks them, and they are listed here so you do not build a flow that routes everyone the same way without meaning to.
{% endhint %}

{% hint style="warning" %}
Page and Query String tests rely on the address of the page the visitor is reading. On your Limio shop that is always available. For the [chat embed](/ai/chat-embed/chat-embed.md) on another site, the browser sends Limio only the embedding page's origin, not its path — so a Page or Query String test never matches there, and every embed visitor takes its else branch.
{% endhint %}

## Saving

Save publishes the workflow. There is no separate publish step, unlike an agent, where you publish a version. Build the flow before you point a production domain at it.

A change takes up to a minute to reach visitors.

## An example

Sales questions on the pricing pages, support everywhere else, and a specialist for subscribers in checkout:

1. The Domain node into a Condition on Page, value `/checkout`.
2. Its match branch goes to a Condition on Subscription Status, value `activeSub`. Match goes to your renewals agent, else to your sales agent.
3. Its else branch goes to a Router on Page, with a case for `/pricing` to your sales agent and the no-match branch to your support agent.

A visitor reading `/checkout/payment` with an active subscription gets the renewals agent, because `/checkout` matches anything below it.

## When chat does not start

If visitors are told chat is not configured for the domain, one of these is true:

* No published workflow lists that domain. Check the spelling, and that you entered a bare host with no `https://` and no path.
* The walk reached no agent: a branch is empty and there is no fallback agent.
* You saved less than a minute ago.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.limio.com/ai/limio-agents/workflows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
