Skip to main content

Celonis Product Documentation

Execute Action Flows in Skills

In this topic, we are going to show how to execute an Action Flow from a Skill. If you're interested in how to do it the other way around, i.e. execute a Skill from an Action Flow, please refer to this tutorial.

Getting Started
Configuring the Action Flow

1. Navigate to the Action Flow that you want to execute in Skills.

2. Add a new action.

3. Search for 'Celonis'.

4. Select 'Custom Webhook'. It gets triggered anytime data from a Process Automation Skill is received.

5. Configure a Webhook by clicking Add in the Action configuration by naming it and adding any IP restrictions. A URL is created automatically.

celonis-custom-webhook-2.PNG

6. Publish your Action Flow to make it accessible from within skills.

Important

To access an Action Flow from a Skill, the Action Flow needs to be published and not just saved.

Configuring the Skill

7. Go to the Skill from which you want to execute an Action Flow.

8. Add a sensor to your Skill. In the example below, we've used a Manual Sensor, allowing for a manual execution of the skill by copying and inserting the execution URL in the browser.

50725856.png

(optional) 9. You can specify a custom input (called 'Test' with the initial value 'sample input' in the example below) that will be passed on to the Action Flow to be executed.

50726145.png

10. Select the Action Flow by navigating to 'Next Step' → 'Celonis' → 'Execute Action Flows'.

11. Select the Action Flow you want to use from the 'Action Flows' dropdown menu. Here, you get a list of all published Action Flows to which you can connect.

12. In the 'Data' field below, you can specify additional data to pass to the Action Flow in JSON format.

60361219.png

Note

An additional menu called 'Output' opens when you click on the 'Data' field. From this menu you can see all outputs from previous Skills (in our case: the Manual Sensor) that you can reference in the 'Data' field to be forwarded to the Action Flow.

Accessing Parameters in Action Flows

If you now run your Action Flow once by clicking the Run icon in the upper right corner, you will have the parameters available as inputs, allowing you to use them in further Actions.

Important

Your Action Flow will only receive something if your Skill sent something, so make sure to trigger the Sensor to make the Skill send Bundle(s) to the Action Flow.

Using An Output From Action Flows in Skills

1. Configure a Webhook Response Action by adding a new Action → Webhooks → Response Action to send content back to the Skill in which you execute the Action Flow.

50725880.png

2. In the example, a text in JSON format was created to be sent back to the Skill. Add a data structure (1), choose a name (2) and then add an item (3) to it. Choose a name for the item (4) and save it for later (remember it). Add the item (5) and make sure the data structure looks similar to the one in the screenshot. Save the data structure (6). After saving, a new field occurs labeled with the name of the item you just defined (in the screenshots below it's called 'input'). Fill the field with the respective item of the Celonis module (7) and save the set up by confirming it with the OK button (8).

55706450.png

3.1 To send it back to skills, the body of the webhook response needs to include the data created by the Create JSON Module. The status can be set to 200.

50725882.png

3.2 You also have the possibility to let the skill fail by sending back a status code standing for failure (find more about status codes here: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). You could use 400 (Bad Request) or 500 (Internal Server Error) to make sure that the Skill fails. You can look in the Logs of the skill where you can see the status code which caused the failing as an output of the Execute Action Flow Skill.

55706398.png
55706400.png
55706401.png

4. Additionally you have the possibility to use the output data of the Action Flows in Skills. For example you could set up the Execution Output skill adding a Custom Success Message of your choice including the sent data. To access the data which was send to the Execute Action Flow Skill you have to use the following formula:

${bXX["name"]}

  • the two XX have to be replaced by the number of the Execution Action Flow Skill where we want to get the data from (In case of the screenshots the Execute AF Skill was directly after the sensor, so at the second place)

  • the name has to be replaced by the name you were told to save for later (remember it) in step 2. (in the example case the item was named 'input')

After saving, publishing, let the Action Flow run and trigger the sensor with the corresponding link to get the Custom Success Message defined before, in our case including the data we passed to the action flow and sent back (in the example case it was 'sample input').

55706457.png
55706458.png