Introduction

Getting started

Walkthrough Guides

CafeX Apps

Workflows

Using CafeX Collaborate App

Reporting

Managing CafeX

Integrating CafeX

Security

Workflows

Building a Workflow with CafeX

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

Note: To invoke and consume workflows in the CafeX app studio your CafeX tenant must be enabled with the Platform API. To active this feature please contact your sales representation at support@cafex.com


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 an app and trigger event” 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 “API Platform by Workato” application. You can search for this on the right hand side by typing in “api” to the search field.







Selecting the application will also choose the one and only event supported by this application, the API invocation. Next configure the fields that will be passed into this workflow when it is invoked by clicking on “Add Fields Manually” in the Request Schema 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.


Workflows also have an output schema that describes what values the workflow will produce and make available to the app studio. To define the output schema scroll down to the Responses section and click Add Response.






Note that there can be multiple responses for any given workflow. These represent the different outcomes of the workflow, success with content or failure with error messages for instance. Clicking Add response shows response definition dialog. Provide a name and a response code. These response codes are HTTP status codes, however in general 200 - OK is a good selection for a success response. 



As with the input schema, clicking “Add Fields Manually” shows the dialog to add fields that can be made available to the app studio as part of this response, i.e. the output schema.


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. Both the input and output schema of the workflow are defined in the API Platform by Workato trigger.

 

Other Triggers


There are many other triggers that can be used to cause a workflow to execute. Each application integration provided (more than 300) 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 rather than the API Platform. 


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 “Action in an app”. 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 “Log” into the search box to find a simple connector that records a log message when involved. This connector does not need configuration of an account.



Select the “Logger By Workato” as the application. There is only a single action associated with the application/connector and it is automatically selected. The final step is to configure the step settings to perform the operation, in this case to log a message. The message can be typed directly into the “Message” field or can be constructed from data previously defined in the workflow. For example, if a request parameter was defined in this workflow as part of its input schema it can be used in the log message as shown below.




To save the workflow configuration click the save button in the top right of the workflow editor. The final step to make the workflow available to the CafeX Platform is to “start” it. A workflow will only be triggered and executed while it is running. Clicking “Exit” into the top right of the editor will show the workflow overview page. Finally click “Start Recipe” to start the workflow and allow it to execute on its configured trigger.





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