Linking a Process to API Endpoint
Adding functionality to the created API.
In order to have functionality with your API, a Process needs to be linked into each of its endpoints. This can be achieved by adding an API Trigger to your existing Process and choosing which API endpoint the Process will be linked to, or by creating a new Process from the API Management view, which will automatically set up the Trigger and Return shapes for you.
You can check the reference for API Trigger to learn more how to use it in your Processes. In this guide, we will take a look at how to create a new Process from the API Management for each API endpoint.
Step by Step Tutorial Available
If you prefer more visual or interactive guidance on how to link a Process to your API with Frends, you can find a step-by-step walkthrough from your own environment's home page, under Onboarding by selecting "Tutorial 5, Step 2: Create an API process" tutorial.
Creating an API Process
When you have selected your API from the API Management page, each unlinked endpoint will have a Create new Process button next to it.

Click on it to open the Process Editor with predefined name, Trigger and Return shapes that match the API specification for that endpoint. API Trigger is set to link to the chosen API endpoint, and one or more Return shapes will already have been added and configured to return HTTP responses that were specified in the API specification.

All that is now needed is to add your integration logic between the shapes and save the Process. In order to make it truly functional, you may also need to replace the default content in the Return shape to match any values handled or created in your Process.

Once the first version of Process is complete and valid, click on Create new Process to save it and connect it to your API.
You will be taken back to API Management view for your API, and you can check that the endpoint now has a Process linked to it, running the Process for any incoming requests to the endpoint.

Linking an existing Process to API endpoint
If you have an existing Process that you want to connect to an API endpoint, you can add an API Trigger to that Process and choose the API and endpoint the Trigger links to.
This method can also be used if you need to link or update a Process back to an API that was edited. In this case the existing API Trigger should be removed from the Process and added back as new Trigger.

Once the API endpoint is selected, the Process becomes linked to the API and it cannot be changed unless the Trigger is removed. Process also cannot have more than one API Trigger at any time, meaning a single Process cannot fulfill multiple separate endpoints. If same functionality is needed in multiple endpoints, a Subprocess could be created and used in separate Processes instead.
Once the Trigger is added, make sure the Process utilises the Trigger's reference values if they are necessary, and that the Process returns the expected payload back to the caller as HTTP Response instead of standard return value.
What's next?
With a Process linked to our API, you will still need to define the API Policies for it, in order to provide and secure access to the API.
The API Processes need to be activated before they can be executed in the Development Environment the Process was created in.
Deploying the API will also perform the activation if we choose, along with moving the API and linked Processes to separate Testing or Production Environment, which is the preferred method to running the APIs.
Last updated
Was this helpful?