# Integrating chatbots with Nexthink workflows

Without integration, chatbots cannot orchestrate complex multi-step IT resolutions. This leads to incomplete remediations, fragmented employee experience, and escalations to the service desk.

By integrating chatbots with the Nexthink Workflows API, your chatbot can:

* Trigger full workflow executions directly from the chatbot conversation.
* Offload orchestration to Nexthink workflows instead of programming it into the chatbot.
* Use workflow thinklets—Connector, Service API or API Listener—to manage bidirectional communication with chatbot during automations
* Deliver consistent, reusable remediation logic maintained inside Nexthink.

## How does chatbot integration work with Nexthink Workflows?

Nexthink workflow–based chatbot integrations follow this structure:

* The chatbot triggers the Workflow API to start execution.
* Nexthink workflow executes orchestration: diagnostic and branching logic, API calls and remediations.
* Nexthink workflow can communicate to the chatbot during automation and wait for the response to continue
* The chatbot receives the workflow outputs and communicates them to the employee.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-27ce47ff760eb6f5d63c0765064ea5a07ce0ea21%2Fimage%20(920).png?alt=media" alt=""><figcaption></figcaption></figure>

### Chatbot flow using Nexthink Workflows API

Below is the typical flow for using the Workflows API in a chatbot-powered remediation scenario:

| Required step or task – Chatbot                 | Workflow API integration approach                                                                              |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| 1. Authenticate communication                   | Workflow API credentials: token collection via Nexthink platform.                                              |
| 2. Trigger workflow execution                   | Chatbot calls Workflow API (`/executions` endpoint).                                                           |
| 3. Pass input parameters                        | Chatbot provides user/device context as input variables.                                                       |
| 4.Call chatbot API to ask questions to the user | Workflow calls chatbot to ask additional questions to the user if needed                                       |
| 5. Pause/resume logic                           | Workflow uses **API Listener** to wait for chatbot/user input mid-conversation.                                |
| 6. Orchestration and remediation                | Workflow handles branching, Connector and Service API thinklets, and triggers Remote Actions or notifications. |
| 7. Return results to chatbot                    | Workflow outputs remediation results/status. Chatbot sends confirmation back to the employee.                  |

***

## Configuring Nexthink workflows to support chatbot integrations

Before implementing Workflow API calls within the chatbot’s logic, configure the following in Nexthink:

{% stepper %}
{% step %}

#### **Set up Workflow API credentials**

Configure API credentials to secure calls from the chatbot to your Nexthink workflow. Ensure that you have the **Workflow API** permissions activated in your [API credentials](https://docs.nexthink.com/api).

Refer to the [Workflows API](https://docs.nexthink.com/api/workflows) documentation to confirm access to the Workflow execution endpoints.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-6ea6cc0fee965f422ff722d8bdc20b34ba77490d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### **Create a workflow with chatbot integrations in mind**

In Nexthink, from the [workflow designer](https://docs.nexthink.com/platform/user-guide/workflows/creating-workflows#design-workflow-logic):

* Use **Service API** thinklets to define communication to chatbot.
* Use **API Listener** thinklets for asynchronous chatbot input.
* Define **input/output variables** that map cleanly to chatbot requests/responses.

{% hint style="info" %}
Refer to the [use-case-moveworks-service-automation-with-nexthink-workflows](https://docs.nexthink.com/platform/solutions/chatbots/integrating-chatbots-with-nexthink-workflows/use-case-moveworks-service-automation-with-nexthink-workflows "mention") documentation for a detailed example of how to set up a workflow-chatbot integration.
{% endhint %}
{% endstep %}
{% endstepper %}

***

## Using pre-built content to accelerate setup of chatbot-workflow integrations

Nexthink Library provides preconfigured workflows you can adapt for chatbot use cases. These allow you to:

* Quickly enable common diagnostics and remediations.
* Standardize orchestration across chatbot integrations.
* Reduce development effort on the workflow design logic.

From the Nexthink Library, search for content by name. Writing "*Assisted*" lists the preconfigured workflows that address common and applicable use cases for chatbot requests.

For example, you can install the *Assisted Outlook troubleshooting* workflow and add the chatbot integration to its logic

{% hint style="info" %}
Refer to the [nexthink-library](https://docs.nexthink.com/platform/user-guide/nexthink-library "mention") documentation for more information.
{% endhint %}

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-e5fc3895ced8f7ae8346e6b71b993e287851942a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

***

RELATED TOPIC

* [use-case-moveworks-service-automation-with-nexthink-workflows](https://docs.nexthink.com/platform/solutions/chatbots/integrating-chatbots-with-nexthink-workflows/use-case-moveworks-service-automation-with-nexthink-workflows "mention")
* [#optionally-make-the-workflow-available-in-nexthink-spark](https://docs.nexthink.com/platform/user-guide/workflows/creating-workflows#optionally-make-the-workflow-available-in-nexthink-spark "mention")
