# Multiple AI agents assigned to different pages or websites

Force the Tiledesk widget to start from a specific AI Agent using a Department ID.

By default, the widget loads using only the `projectid`. If your project contains multiple AI Agents, you can force the widget to start from a specific one by setting the `departmentID` of the Department linked to that AI Agent.

<figure><img src="/files/rHyYtcy3d0wSYcskNL1Q" alt=""><figcaption></figcaption></figure>

* Same website: use different AI Agents on different landing pages (same Project ID, different Department IDs).
* Different websites: use different AI Agents and different Projects (different Project IDs and Department IDs).

## Steps

{% stepper %}
{% step %}

### Create a Department for the AI Agent

* Go to **Settings → Routing and Departments**.
* Create a new Department and connect it to the AI Agent you want as the default experience.
* Copy the **Department ID** generated by Tiledesk.

<figure><img src="/files/aHV7udLgOta4QhDmjYZC" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Hide the Department (optional)

If you want the AI Agent to start in the background without showing that Department in the widget selector:

* In the Departments list, click the blue button **Make invisible**.
* The Department will be hidden from the widget menu, but it will still work when used in the installation snippet.
  {% endstep %}

{% step %}

### Install the widget with projectid and departmentID

Add this snippet on the pages where you want a specific AI Agent to be the default. Replace `YOUR_PROJECT_ID` and `YOUR_DEPARTMENT_ID` with your values.

{% code title="widget snippet" %}

```html
<script type="application/javascript">
  window.tiledeskSettings = {
    projectid: "YOUR_PROJECT_ID",
    departmentID: "YOUR_DEPARTMENT_ID"
  };
  (function(d, s, id) {
    var w = window;
    var d = document;
    var i = function() { i.c(arguments); };
    i.q = [];
    i.c = function(args) { i.q.push(args); };
    w.Tiledesk = i;
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s);
    js.id = id;
    js.async = true;
    js.src = "https://widget.tiledesk.com/v6/launch.js";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, "script", "tiledesk-jssdk"));
</script>
```

{% endcode %}

Important: On a single page, load only one Tiledesk widget snippet to avoid conflicts.
{% endstep %}
{% endstepper %}

## Common scenarios

### Scenario A: Different AI Agents on different landing pages (same website)

* Keep the same `YOUR_PROJECT_ID`.
* Use a different `YOUR_DEPARTMENT_ID` on each landing page.
* Result: each page opens a different AI Agent journey.

### Scenario B: Different AI Agents on different websites

* Use the correct `YOUR_PROJECT_ID` for each website (each website can have its own Project).
* Set the related `YOUR_DEPARTMENT_ID` for the AI Agent you want as default on that website.
* Result: each website can have its own default AI Agent and configuration.

## Alternative approaches

### Option 1: Enable disabled Departments

If the Departments linked to your AI Agents are currently disabled, the widget may not be able to start the chat from a `departmentID`. In this case, enable the Departments you want to use and then keep using the `departmentID` in the snippet.

Note: If you enable more than one Department, on pages where you do not specify `departmentID` the widget can show a Department selection step, because multiple active Departments are available.

### Option 2: Use `participants` instead of `departmentID`

If you prefer not to use `departmentID`, you can start the chat with a specific bot using the `participants` parameter. Set it to `bot_<BOT_ID>`.

{% code title="participants example" %}

```javascript
window.tiledeskSettings = {
  projectid: "YOUR_PROJECT_ID",
  participants: "bot_YOUR_BOT_ID"
};
```

{% endcode %}

Crucial note for Option 2: With `participants`, the conversation is still assigned to the default Department, but it is managed directly by the selected bot.

## Notes and limitations

* Widget design (colors, logo, launcher style) is shared inside the same Project. If you need different widget designs, use different Projects.
* If you hide a Department using **Make invisible**, users will not see it in the widget menu, but the widget can still start from it via `departmentID`.

Need help? [Contact the Tiledesk team](mailto:support@tiledesk.com).


---

# Agent Instructions: 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:

```
GET https://guide.tiledesk.com/ai-chatbots-and-automation/visual-builder-101/multiple-ai-agents-assigned-to-different-pages-or-websites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
