> 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

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

   <figure><img src="/files/GSGC3SJl33yUoUuDNiBQ" 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="/files/Z7Pf0n4zVJ2XC47hv2LR" 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="/files/OcTLuJuBwylRTwK4avHd" 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="/files/ia0cg9sZsj7gdYUt71Tl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/12eo4xPIxuuzXDoENk74" 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="/files/NzYWORFR0pqJ1U5UzHmz" 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="/files/7sgMtfDxcKFnZJ4uj5TD" 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="/files/bvAFWWwO4nXZAfXL2AnR" alt=""><figcaption><p>Testing our chatbot workflow in the preview chat window</p></figcaption></figure>
