Introduction

Getting started

Walkthrough Guides

CafeX Apps

Workflows

Using CafeX Collaborate App

Reporting

Managing CafeX

Integrating CafeX

Security

App Studio

Workflows

Building a Workflow with CafeX

Modified on Tue, 2 Apr at 7:31 AM

Note: To invoke and consume workflows in the CafeX app studio your CafeX tenant must be enabled with the workflow feature. To active this feature please contact your sales representation at [email protected]


To design and build a workflow with CafeX you must first define an application. Once you have an application enter the App Studio and select the workflows option on the left as shown below.



Click the “Add New Workflow” option will prompt you for a name. Entering a name and clicking “Add” will take you to the built-in workflow editor. In this editor you define the trigger of your workflow, the steps to take and finally the results to be recorded.


Triggers


Click on “Select Trigger” to define when this workflow will execute. This is called the workflow’s trigger. There are many possible triggers provided from the different integrations. However, if your workflow is being consumed in the App Studio it is advisable to use the “Workflow Invoked” trigger. You can search for this on the right hand side by typing in “invoked” to the search field.




Next configure the fields that will be passed into this workflow when it is invoked. These can either be specified in JSON through the “Advanced” option or can be added through interacting with the interface with the “Basic” option by clicking on “Add Item” in the Input data section of the configuration as shown below.



Multiple fields can be defined to describe the input to your workflow. Each of these fields will be made available in the CafeX App Studio as inputs that can be configured by the user’s actions in your application. The definition of fields describes the input schema for your workflow.


Once the input schema has been defined, click the “Load data” button to generate sample data that you can reference in the actions later in the workflow



Workflows that are invoked from the App Studio can also have an output schema that describes what values the workflow will produce and make available to the App Studio. The schema that is available inside the App Studio is determined automatically based on the configuration of a Return response action. To add a Return response action click on the plus icon to add a new action to the flow and search "return response" in the right hand panel. 




The input and output schemas describe how the App Studio will interact with the workflow by defining fields that will be used to pass information into the workflow and retrieve the result.

 

Other Triggers


There are many other triggers that can be used to cause a workflow to execute. Each application integration provided (more than 150) can define one or more events to be used as triggers of workflows. When declaring the trigger of a workflow the various trigger events can be seen by selecting one of the application integrations in the right hand panel. 


These triggers can be used to update tables, add assets and a series of other operations on the CafeX platform by using the CafeX Connector (see below).


However, while these other triggers can be utilized to provide workflow execution they provide a limited configuration of input schema and no definition of output schema. While these workflows can be executed from the CafeX App Studio the outputs can not be used as direct data sets.


Actions

Workflows contact a series of steps that are executed when the trigger condition is met. These steps are called Actions. Clicking the sign beneath the trigger will display the types of actions that can be added.





Actions are generally either application specific or flow control. Flow control actions support forking the workflow based on conditions or looping over sets of data. Application actions invoke integrations that either perform tasks and/or retrieve sets of data. More details on flow control actions can be found in steps article.


To add an application action click “App Actions”. The right side of the designer will then display a search box to find an application to be invoked. There are hundreds of applications to choose from from integration to AWS services to simple tasks like CSV processing. Each one of these applications is implemented by a Connector. A connector is a wrapper containing the triggers and actions for a given application or service. Most connectors need configuration to provide account details for accessing the integration. 


Enter “return response” into the search box to find the action that records a response to the app that invoked the workflow. This connector does not need configuration of an account.



Select the “Return Response” action. The final step is to configure the response to return to the invoking app. The response should be a structured JSON message that can be typed directly into the “Response” field or can be constructed from data previously defined in the workflow. For example, the following response will return a single body field with the static value Hello world.


Values from the trigger or previous actions can be inserted by selecting the value from the popup when clicking inside the field




To workflow will automatically save a draft version as you edit it. To activate the current draft workflow click the Publish button in the top right of the workflow editor. The workflow is now available to use from the App Studio.





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 at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article