|
| 1 | +--- |
| 2 | +title: Quick - Creating your first flow |
| 3 | +icon: IconBook2 |
| 4 | +--- |
| 5 | + |
| 6 | +import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; |
| 7 | +import { Callout } from 'fumadocs-ui/components/callout'; |
| 8 | +import { Step, Steps } from 'fumadocs-ui/components/steps'; |
| 9 | +import { Cards, Card } from 'fumadocs-ui/components/card'; |
| 10 | + |
| 11 | +We will build a simple flow that listens for a `GET` request and immediately answers back with a classic `pong`. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +<Steps> |
| 16 | +<Step> |
| 17 | + |
| 18 | +## Kickstart a new flow |
| 19 | + |
| 20 | +Let's begin by creating a fresh canvas. Click the create button to get started. |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +Set the trigger type to **REST Endpoint**, give your flow a memorable name, and hit create to open up your new workspace. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +</Step> |
| 29 | +<Step> |
| 30 | + |
| 31 | +## Access the node settings |
| 32 | + |
| 33 | +Locate and open your newly created flow from the explorer list. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +Click on the **Starting Node** to highlight it. Then, take a look at the right-hand side of your screen and open up the **Node Settings** panel. This is where the magic configuration happens. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +Form here we can start setting up our starting node. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +</Step> |
| 46 | +<Step> |
| 47 | + |
| 48 | +### Configure your endpoint & logic |
| 49 | + |
| 50 | +First, let's define the data type. Click on the variable **(x)** icon and select `text/plain` from the list. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +Next, let's give your flow an address. Type a clean path like `/ping` into the URL endpoint field. |
| 55 | + |
| 56 | +<Callout type="info"> |
| 57 | + 💡 **What is a URL endpoint?** This acts as the unique web path for your flow. When combined with your specific project slug, it forms the full web address you will use to trigger this logic. |
| 58 | +</Callout> |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +Choose the `GET` method from the dropdown menu. We are using `GET` for this project so you can easily test and preview the results right inside your favorite web browser. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +Set the incoming input schema to `Data Value` to keep the format simple and clean. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +</Step> |
| 71 | +<Step> |
| 72 | + |
| 73 | +#### Add a responde node |
| 74 | + |
| 75 | +Now, let's add some action! Open up the **Node Menu** to browse available blocks. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +Type `Respond` into the search bar and select the corresponding node to add it to your workflow canvas. |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +Click on the newly placed **Respond** node to configure. |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +Let's tell the client everything went smoothly. Set the **Status Code** to `200` (the standard HTTP code for "OK"). |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +Just like before, use the **(x)** variable icon to set the response content type to `text/plain`. |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +Type the word `pong` into the content field. This is the exact text payload that will be sent back to the user. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +Don't lose your progress! Click the **Save** button in the toolbar. |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +</Step> |
| 104 | +<Step> |
| 105 | + |
| 106 | +#### Try out your flow |
| 107 | + |
| 108 | +Time to test it out! Click on the **Play** button and copy the resulting HTTP URL to your clipboard. |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +Finally, paste the copied link into a new browser tab. |
| 113 | +If you are developing locally, feel free to adjust the IP address or host if needed. |
| 114 | +Hit enter, and watch your flow instantly reply with `pong`! |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +</Step> |
| 119 | +</Steps> |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +### What are my next steps? |
| 124 | + |
| 125 | +Congratulations on deploying your very first endpoint! |
| 126 | +Now that you know how to receive a request and send a basic response, |
| 127 | +you can try passing dynamic data variables or adding conditional logic nodes to make your flow even smarter. |
0 commit comments