> For the complete documentation index, see [llms.txt](https://docs.wonderchat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wonderchat.io/setup-guides/adding-chatbot-workflows/set-up-chatbot-workflows.md).

# Set-up Chatbot Workflows

In this page, we will show how you can set-up your own workflow for your chatbot. For this example, we will be setting up a simple "Recommend clothes" workflow.

1. To create a Wonderchat workflow, select the chatbot of your choice and click on **Edit Chatbot**\\

   <figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-8208edca6715aa3584cf9596ee62c6bc67948f8a%2Fimage.png?alt=media" alt=""><figcaption><p>Select "edit chatbot" from the dropdown menu</p></figcaption></figure>
2. Within the edit chatbot menu, click on the **Workflows** tab, and click on **Add New Workflow**\\

   <figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-9898ecd766f49424fa82d41e1a5594f8c6dd411d%2Fworkflows-tab.png?alt=media" alt=""><figcaption><p>Click on the <strong>Workflows</strong> tab, and click on <strong>Add New Workflow</strong></p></figcaption></figure>
3. A new workflow will be added. You can first select the type of trigger for your workflow. Here, we will select the **When AI detects a condition** trigger, and set the trigger when **The user asks what clothes he should wear**

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-4572d9cf2e20ebf1572eb82951f7a6038cd3d2ed%2FScreenshot%202025-01-16%20at%2017.36.56.png?alt=media" alt=""><figcaption><p>Define a trigger for your workflow</p></figcaption></figure>

4. Now that we have defined the trigger for the workflow, we can define a series of actions to take. For this workflow, we want to first **Collect the location of the user,** so we can click on **Add your first action** and create a new custom field called **Location**

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fath8RnGVv6wpVrWA7hqP%2Fimage.png?alt=media&amp;token=4ffe2786-67fd-4839-955a-c3e57505aadb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-68809d1cc2db476735234e8f0688b704ff89c59f%2FScreenshot%202025-01-16%20at%2017.43.21.png?alt=media" alt=""><figcaption><p>Create a custom field called <strong>Location</strong></p></figcaption></figure>

5. Now, lets call add an API action to get the weather of the user based on the location that they have given.

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-696f91329b96e500e085e41f40de8b67c42eefba%2FScreenshot%202025-01-16%20at%2017.46.50.png?alt=media" alt=""><figcaption><p>Add a <strong>Get Weather API</strong> call under <strong>Integrations</strong> from <strong>Add Action</strong></p></figcaption></figure>

6. Finally, we can recommend the user some clothes they can wear based on the weather of the location they are in by adding an **AI Chatbot response action**

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-716bdb997fe43f051520db1521ec132f0b1a888c%2FScreenshot%202025-01-16%20at%2017.49.11.png?alt=media" alt=""><figcaption><p>Add a <strong>Chatbot Response</strong> action that is based on an <strong>AI Prompt</strong></p></figcaption></figure>

7. Now that we have created our workflow, we can test it out by clicking **Save** and asking the chatbot a question that will trigger the workflow in the chatbot preview on the right. Alternatively, you can click on the **Play** button of each workflow to preview the workflow without manually typing in something to trigger it

<figure><img src="https://3760420285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0WUvfmkdMPXz3x7NXP8i%2Fuploads%2Fgit-blob-773964cd08821f02ecf7721f39b644094b44c3a6%2FScreenshot%202025-01-16%20at%2017.53.01.png?alt=media" alt=""><figcaption><p>Testing our chatbot workflow in the preview chat window</p></figcaption></figure>
