---
title: "Build your first workflow | Lansweeper Platform"
slug: "build-your-first-workflow"
description: "Learn to create workflows in Lansweeper, fetch asset data, and send location updates to Slack with this comprehensive tutorial."
updated: 2026-06-12T15:21:18Z
published: 2026-06-12T15:21:18Z
canonical: "docs.lansweeper.com/build-your-first-workflow"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lansweeper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build your first workflow

This tutorial will walk you through some basic concepts of workflow creation. You will:

- Fetch data from the Lansweeper connector
- Learn how data flows between steps of a workflow
- Use a loop to iterate over the records you fetch
- Use logical branches to determine what to do with each record
- Send certain records to another system (this example uses Slack)

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/first-workflow.png)

The workflow you build will fetch data (a list of assets) from your Lansweeper Site, loop over the list, determine which assets have a location, and notify you via Slack of the corresponding assets and their location.

## Add location to assets

If you do not have any assets with a location in your inventory, you can edit a few assets in your Lansweeper Site to test this workflow.

1. In your Lansweeper Site, go to **Inventory**.
2. Select a few assets, then select **Bulk edit**.
3. Select **Location** from the dropdown.
4. Enter a location, then select **Save and apply**.

## Create a Slack app and have access to a Slack workspace

You must create a Slack app before creating a workflow to connect Lansweeper and Slack.

1. To create a free Slack app, follow the instructions under [Slack OAuth 2.0](/docs/slack-connector#slack-oauth-20).
2. While creating the app, ensure to assign your Slack app the `chat:write`, `chat:write.public`, and `channels:read` scopes.

## Create a new workflow

1. In your Lansweeper Site, go to **Flow Builder > Add new WorkFlow**.
2. Select **Quickstart** to create a new workflow from scratch.
3. Enter a name for your workflow, such as “My First Workflow.”
4. Select **Universal webhook** as your trigger, then **Create trigger**.

![universal webhook](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/universal-webhook(5).png)

## Fetch assets’ data from Lansweeper

1. Add a new step to your workflow by selecting the **+** icon below your trigger.
2. Enter **Lansweeper** in the search.
3. Select **List of assets** from the list to add it as a step.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/lansweeper-list-of-assets(6).png)
4. Select **Add a string input**.
5. From the dropdown, select **asset.location.location**.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/lansweeper-list-of-assets(1)(4).png)

## Test the Lansweeper connector

1. Select **Run**.
2. Under **Steps**, select **List of assets**.
3. In the Output tab, you can view the data fetched from the Lansweeper connector.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/test-run(5).png)

> **Important notes regarding execution and visualization**
> 
> 
> - In the Items list, there is a maximum number of 250 elements shown. This is just a visual limitation.
> - If you get a message like `&lt;data (123456 bytes)&gt;`, it’s a known visualization constraint. Temporarily reduce the number of records via Max Records to preview data.

## Create a Loop over items

Now that we're fetching a list of assets, we need to loop over each asset to determine if they have a location.

1. Under the **List of assets** step, select the **+** button.
2. Enter **Loop** in the search.
3. Select the **Loop > Repeat for each** action.
4. Select the Reference icon in the Items textbox.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/reference-icon.png)
5. Select the **Items** property, then **Save**.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/loop-items(5).png)
6. Select **Run**.
7. Under **Steps**, select **Repeat for each**.

The loop step will have a `currentItem` property which we'll use next.

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/loop-items-run(5).png)

## Identify assets with a location

Now that we're looping over each item, we need to determine whether the current item has a location.

1. Under the **Repeat for each** step, select the **+** button.
2. Enter **Branch** in the search.
3. Select **Branch > IF condition is met**.
4. Under **Condition**, enter **Has a location?**
5. Under **Field**, select **Reference**.
6. In Reference path, use: `currentItem.asset.location.location` and select **Save**.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/loop-item-current-item(5).png)
7. Under **Operator**, select **Exists**.

Steps with `asset.location.location` set will follow the *Has a location?* branch.

---

## Send assets with location to Slack

Next, we want to send a message to Slack for each asset with a location.

> **Ensure you have a Slack app created** You’ll need credentials setup now for Slack (Client ID, Secret, etc.). See [Create a Slack app and have access to a Slack workspace](/docs/build-your-first-workflow#create-a-slack-app-and-have-access-to-a-slack-workspace)

1. In the **Has a location?** branch, select the **+**.
2. Enter **Slack** in the search.
3. Select **Post message**.
4. Select **Add connection**.
5. Enter your **Client ID**, **Client Secret**, and **Signing Secret**.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/slack-connection(5).png)
6. Select **Connect** to allow access to your Slack application.

Now configure the Slack step:

1. For the **Message** input, you can format it like:  

`The asset &quot;currentItem.asset.general.name&quot; is located in &quot;currentItem.asset.location.location&quot;.`  

To reference previous steps, you need to click on the **Reference** icon, select **Repeat for each**, and add the corresponding path in the reference path field.  

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/slack-message(6).png)
2. Select **Run** to test.
3. Under **Channel Name or ID**, select the channel you want to post the message to.

![](https://cdn.document360.io/21d5935c-1b73-44fa-bf5a-a8b0f5c67f25/Images/Documentation/slack-message(1)(1).png)

## Next steps

Congratulations! You created your first workflow! Here are a few things you should try next:

- Send your message to a different system, like [Microsoft Teams](/docs/microsoft-teams-connector).
- Swap out the **List of Assets** action for something else like Software or Vulnerability list.
- Write your messages out to a file in [Dropbox](/docs/dropbox-connector) or [Amazon S3](/docs/amazon-s3-connector).
