# How to scaffold a pipeline using an OpenAPI specification

On the Digibee Integration Platform, you can create a scaffolded pipeline using an existing OpenAPI specification file. This automatically pre-configures the routes and sets up part of the flow, allowing you to speed up the creation of pipelines while ensuring that best practices for data flow creation are followed.

## **How to import an OpenAPI specification**

1. On the **Build** page, click **Create new**, then select **Pipeline from OpenAPI**.
2. In the pop-up window, upload a **YAML** or **JSON** file. You can upload the file by dragging and dropping or browsing your computer.
3. On the next page, you will see a preview of the route list. Review the information to ensure it’s correct. If something is incorrect, click **Upload a different file** to select a new file with the correct configuration.
4. Once you’re confident with the configuration, click **Confirm**.

{% hint style="info" %}
After confirming, you cannot upload a new file. However, you can manually edit the routes in the [**API Trigger**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/triggers/web-protocols/api) configuration form within the pipeline.
{% endhint %}

<figure><img src="https://866970526-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjvO5S91EQURCEhbZOuuZ%2Fuploads%2FemxUuRaIaY72N6IM24Ym%2Fcreate-openapi.gif?alt=media&#x26;token=90933884-7137-4e6b-bfac-07cf118d1d16" alt=""><figcaption></figcaption></figure>

## **Scaffolded pipeline**

After importing the OpenAPI specification file, the scaffolded pipeline will include the following elements:

* The [**API Trigger**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/triggers/web-protocols/api), which serves as the entry point for initiating the pipeline.
* A visual representation of the routes, each connected to a **Router** for managing different paths.
* [**Block Execution**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/logic/block-execution) connectors at the end of each route, logically organizing the pipeline into subflows to improve flow management and clarity.
* Response handling within the [**OnProcess**](https://docs.digibee.com/documentation/developer-guide/development-cycle/build-overview/subpipelines#onprocess) and [**OnException**](https://docs.digibee.com/documentation/developer-guide/development-cycle/build-overview/subpipelines#onexception) subflows of each **Block Execution**, facilitating more structured error and process management.

### **Creating the flow from the scaffolded pipeline**

#### **Configuring the trigger**

In the scaffolded pipeline, the trigger is pre-configured with the necessary routes. However, additional configurations must be done manually to ensure the trigger functions as you need. For detailed instructions on configuring the trigger, refer to the [**API Trigger**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/triggers/web-protocols/api) documentation.

#### **Configuring the subflows**

While part of the flow is already scaffolded, you will need to implement the integration logic by configuring the subflows of the [**Block Execution**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/logic/block-execution) connectors at the end of each route. This approach helps ensure that your integration follows best practices and remains manageable.

#### **Editing the routes**

You can edit the routes at any time through the trigger's configuration form. Once you have saved the trigger, any changes will be reflected immediately in the pipeline.

{% hint style="warning" %}
If you change the [**API Trigger**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/triggers/web-protocols/api) to another type of trigger, the **Router** is converted into a [**Choice**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/logic/choice) connector, and the previously configured routes will be connected to the **Choice** instead. You can copy the connectors within each [**Block Execution**](https://app.gitbook.com/s/EKM2LD3uNAckQgy1OUyZ/connectors/logic/block-execution) and paste them elsewhere in the pipeline as needed.
{% endhint %}
