> For the complete documentation index, see [llms.txt](https://docs.diaflow.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.diaflow.io/getting-started/lets-start-with-the-basics/creating-your-first-workflow.md).

# 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FR9vQDeFG8b6SMixFSzs2%2FCreateAFlow.gif?alt=media&amp;token=6b3119eb-919b-4525-99a8-57975ea68b5e" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FYPIpPNY34CpX6TAGlXHW%2Frounded-image%20(3).png?alt=media&amp;token=8a9aa8c8-b0f5-4c34-b12b-e550f137641b" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FtuzTzeafVNjJW8nNdO34%2FAddTriggerField.gif?alt=media&amp;token=e9746b3a-0f3e-4261-bcb8-95f9c133cec9" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FnL9FtrHAOXx8WFiEWLl2%2FAddComponent.gif?alt=media&amp;token=07d5c9c3-4436-4ddc-afde-4fed48119c7a" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FDsp68fbeOROLurZorutg%2FAddLLM.gif?alt=media&amp;token=4acc0af0-1e3f-4afb-9678-ff7036e32839" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2Fk1h5le9LZNzq82XpJZwu%2FAddOutput.gif?alt=media&amp;token=bad35cd0-7bc0-41e6-9b05-1a8b3e0beca7" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FSMNgYhlfKtZndM7Hytsv%2FExecuteFLow.gif?alt=media&amp;token=e2bbcb6a-0ce4-4944-8d15-a3c65e9bbcdb" 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="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FB1U7C4eqZXJqSOScrBNc%2FPublishFlow.gif?alt=media&amp;token=3b904322-2bf7-4a78-8415-d40e805576e7" 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).
