# Creating your first workflow

The goal of this example is to create a flow with a PDF file and a question as inputs, and to generate the answer to the question as the output. In our case, we are going to use a document that discusses COVID-19 and ask the AI to answer questions related to the document.

Use this guide to create a simple Workflow that summarizes a YouTube video.

In this example, the user pastes a YouTube link, and Diaflow returns a summary.

## Create the Workflow

1. Click **New.**
2. Choose **New flow.**
3. Choose **Continue**.
4. Select how the Workflow should start.

<figure><img src="/files/F7hBt3sKeY4hdXHSkg6O" alt=""><figcaption></figcaption></figure>

Choose the start type that matches your use case:

* The **3 options on top** (On app event, Schedule, Webhook) create an **Automation** Workflow.
* The **2 options on the bottom left** (Click a button, Submit a form) create an **App** Workflow.
* Select **Chat** to create a **Chatbot** Workflow (**Simple** or **Expert**).

<figure><img src="/files/ulxGPnHeKWp8VpRafyck" alt=""><figcaption></figcaption></figure>

For this example, choose **Submit a form**.

## Build the Workflow

1. In **Trigger**, click **Add**.
2. Choose `Short Text`.
3. Name the field `YouTube URL`.

<figure><img src="/files/c1PgKJ2SxOpULhiugoDC" alt=""><figcaption></figcaption></figure>

4. Click or drag from the green dot on the right side of **Trigger**.
5. Search for **YouTube**.
6. Select it as the next step.
7. In the URL field, type **@** to show the node list and select `trigger.youtube_url`.
8. Set **Detect Language** to `Auto Generate`.

<figure><img src="/files/bwjSOJVOQASDVZdmUK0l" alt=""><figcaption></figcaption></figure>

The Pop-up will display the search keyword "YouTube."

9. Add an AI node such as **OpenAI**.
10. Choose the connection and model you want to use.
11. In the prompt, ask the AI to summarize the video.
12. Insert the result from the **YouTube** node.

Use a simple prompt like this:

```
Summarize this YouTube video in 3 to 5 bullet points.
Include the main idea and key takeaways.
```

<figure><img src="/files/mKBFHtFBumKSjOBmTExa" alt=""><figcaption></figcaption></figure>

13. Finally, add an **Output** node at the **end** of the flow.
14. In **Output**, click **Add**.
15. Select the result from the AI node.
16. If needed, also add the result from the **YouTube** node.

<figure><img src="/files/yxjNW9KOOGeSjR4emYJy" alt=""><figcaption></figcaption></figure>

## Run the Workflow

1. Paste a YouTube URL into the **Trigger** Field.
2. Click **Execute**.
3. Review the summary.

<figure><img src="/files/UdYNlR5yu2b3x4elEb2b" alt=""><figcaption></figcaption></figure>

## Publish the Workflow

1. Click **Publish**.
2. Choose how you want to share the Workflow.

You can publish it as:

* **Internal Apps**
* **Public Apps**
* **Run via API**

<figure><img src="/files/3yoUZ6PuBxlLV9SnWYLR" alt=""><figcaption></figcaption></figure>

### Need help?

* Learn the basics in [How a Component works](/getting-started/lets-start-with-the-basics/how-a-node-works.md).
* See the full structure in [How a Workflow works](/getting-started/lets-start-with-the-basics/how-a-workflow-works.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diaflow.io/getting-started/lets-start-with-the-basics/creating-your-first-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
