Introduction

Getting started

Walkthrough Guides

CafeX Apps

Workflows

Using CafeX Collaborate App

Reporting

Managing CafeX

Integrating CafeX

Security

Workflows

Integrating a Workflow in CafeX App Studio

Modified on Mon, 04 Sep 2023 at 08:01 AM

To make a workflow available as a data set to an application built in the CafeX App Studio it should be exposed as part of the Platform API. To enable the Platform API on a CafeX tenant contact your sales representative at support@cafex.com 


To make a workflow available through the Platform API four components must be configured, a collection of APIs, a client, an access profile and an endpoint. These components can be configured through the workflows section of the tenant administration by clicking “Workflows” from the tenant admin menu.



The workflows configuration overview will be displayed. Selecting “API Platform” from the menu will show the main API platform configuration dashboard from which each of the components can be configured.


Configuring an API Collection

Selecting API Collections at the top of the dashboard will display the list of collections currently configured. Note that only a single collection is required for each application. Clicking on “New Collection” displays the collection creation dialog.



An API collection brings together endpoints (the locations where workflows can be accessed) together with clients (the definition of who/how an endpoint and hence a workflow can be accessed).


Defining a collection requires the following items:


  • A folder where the workflows to be exposed can be found. The folder labelled “version 1” within your application folder should be selected to expose any workflows that are associated with the application.
  • A collection name which is used to identify the collection.
  • A version number which is used to track changes to the collection.


The New Collection wizard requests each of the above items and then create a new collection.

 

Configuring an API Client and Access Profile


An API client describes how the collection of workflows can be accessed. To create an API client go back to the API Platform overview by selecting “API Platform” from the main menu on the left of the screen.


The Clients tab shows any clients that have been created. Only one client should be created per CafeX tenant. 


If the client has already been created, use “Edit Access Profile” to add the new collection to the client.


If there are no clients configured, create a new client for an application click “Add New Client”. Provide a name for the client and click “Add Client” to create the definition of the client that can access the collection.


To define how the client accesses the application workflows a profile must be created. From the newly created client, click “Create New Access Profile”.




The access profile describes how access to the workflows will be authenticated. When using the App Studio the authentication method should be left as the default “Auth Token” as shown below. Note that Allowed IPs do not need to be set. 

Finally ensure that the API collection that was defined for the application is selected in the “API Collections to include” field. The API collection can be identified by the name that was configured against it.




On creating the new access profile an authentication token will be presented as shown below. Copy this token to a safe location. The token will only be shown once and is required to access your workflows.




This authentication token must be configured in the CafeX Tenant Administration settings. To access these settings select “Tenant settings” from the menu in the top right of the CafeX platform.


Select the workflow section from the left hand menu in the tenant settings. This will show the workflow API key setting on the right hand side. Enter the authentication token copies from the workflow API access profile into this field and save the configuration.



The API key/Authentication token here ensures that only your tenant can access the API Collection and the workflows configured inside.


Configuring an API Endpoint

The final step is making a workflow available to the CafeX App studio by adding an endpoint. An API Endpoint represents a location that the application built in CafeX can access to invoke the workflow and get a response. To add an endpoint return to the API collection by accessing Workflows from the menu in the top right of the screen. Select API Platform and then API Collections. Select the API Collection configured for this application.



To add the endpoint click “New Endpoint”. A dialog will appear where the following values must be specified.


  • Name (used to identify this endpoint)
  • Recipe - select the workflow to be invoked.
  • Endpoint Path - enter a URL path segment here. This is how the workflow and endpoint will be addressed (e.g. /appName)

 

Click “Add Endpoint” to create the new API endpoint and expose the workflow to the App Studio. The final step is to activate the endpoint by toggling the Active/Inactive marker on the endpoint tile.



The workflow can now be consumed by the App Studio. 

The API collection holds the client description (which includes the access profile) and the endpoint definition. The HTTP endpoint describes the location at which the workflow can be invoked.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article