# Workflows

Trigger and query workflows using the Nexthink API, giving you the flexibility to create and visualize metrics using third-party software.

## Setting up API credentials

To set up an integration with the Nexthink API, you must first create a set of API credentials in your instance that the external application or service uses to access the Workflows API. Refer to the [API Credentials](https://docs.nexthink.com/api/readme) documentation.

## Configuring workflows for API

To configure workflows via API:

1. Select **Workflows** from the main menu.
2. Create a **New** workflow or edit an existing one as described in the [Manage Workflows](https://docs.nexthink.com/platform/latest/manage-workflows) documentation.
3. Under the **General** tab, select the **API** checkbox.
4. Click the **Save workflow** button. The workflow is now available for API calls.

![image.png](https://2357343894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJJ2qSHrtIyc9j4mVppGN%2Fuploads%2Fgit-blob-328042e9a6bcade068baf37123d02277dd935478%2FWF-CreateWF.png?alt=media)

Alternatively, configure workflows by editing an existing one through the the Manage workflows page:

* Select **Manage workflows**.
* Select the relevant workflow and then click on the action menu on the right side of the row to **Edit**.

## Copying workflow NQL ID

1. Select **Workflows** > **Manage workflows** in the navigation panel.
2. Select the relevant workflow and then click on the action menu on the right side of the row to **Copy NQL ID**.
3. Save the workflow NQL ID for later use.

![ManageWorflow](https://2357343894-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJJ2qSHrtIyc9j4mVppGN%2Fuploads%2Fgit-blob-dbaba5fd5dac8ae08d6060dc30b8293b07a22fa8%2FWF-1707493195.png?alt=media)

Extract the workflow NQL ID by querying it from the API.
