- 8 Minutes to read
- Print
- DarkLight
- PDF
Multi Actions
- 8 Minutes to read
- Print
- DarkLight
- PDF
Introduction
Multi-Actions in Rivery are a way to orchestrate complex processes by combining multiple actions in a sequential order. This document provides an overview of Multi-Actions, including their creation, configuration, and execution within Rivery.
Cases Using Multi-Actions
Many REST APIs require multiple steps in order to connect to the service, and GET/POST requests.
Such a process can be: first, submit a request to generate a token and then send a request to the service using that token. In this example, the first action will a REST Action to generate the token and the second action will be the request to the service to make a GET or POST call.
Create a Multi-Action
To create a Multi-Action in Rivery, follow these steps:
Click on Create River from any screen in Rivery.
Select Multi-Action as the type of action to create.
Multi-action is an action which is composed of multiple actions and allows to run a process of actions in Rivery.
if you wish use Rest Action, please refer to our REST Action documentation.
Multi-Action Screen
The Multi-Action screen in Rivery allows you to configure the steps and variables for your Multi-Action. Key components of the Multi-Action screen include:
- Steps: Each step represents an action to be executed within the Multi-Action.
- Custom Connection: Defines the connection for the actions within the Multi-Action.
- Variables: Defines variables for the Multi-Action and its actions.
- Time Period: Configures the time range for the Multi-Action.
Multi-Action Variables
The variables of the Rest action are available in the button on the right side of the river:
Insert as many variables as required to the variables of the Rest action.
The multi-action variables can be used in order to pass values to the variables of the actions inside the multi-action.
The Multi-action variables list includes the following:
All the variables that were manually added to the list,
Any variables that are returned from Actions inside that Multi-action. Those variables
The start date and end date that were selected in the Time Period of the Multi-Action
The connection details of the selected connection in the Multi-Action.
Use the Variables in the inputs variables of the actions inside the multi-action by entering “{“. Then, a list of all available variables will be presented.
Click here to read more about variables in Actions.
Time period
The time period is the place to configure the start date and end date of the Multi-action and is available on the right side button of the time period.
Those two parameters will be automatically added to the variables list of the multi-action and can be used anywhere in the multi-action.
Usually, the dates of the multi-action will overwrite the dates of the REST Action that is being run in the multi-action.
Add An Action to the Multi-Action Process
The multi-action is composed of multiple REST Actions - each action runs inside a step in the multi-action. It is possible to add as many as required actions to the multi-action, and each action can be added following the next instructions:
When creating a new multi-action, the first step will be already shown up on the screen:
In case the action you’d like to run in the multi-action has already existed in Rivery, it is possible to select it in the list of actions in the step.
Click on theinput to open the list of all available action in your Rivery account.
It is possible to search inside that list.
In case you’d like to create a new action, it is possible to do so inside that multi-action.
It is also possible to do it outside the multi-action and then select it as described above.
Click on the button New Action to open the configuration of the new REST Action . (this configuration is exactly the same as creating the REST Action outside the multi-action)
Create the REST Action following thedocumentation of REST Action .
When the REST Action is ready Click on Save in order to save it like any other Action River in Rivery. That new REST Action will be selected in that step of the multi-action and also will be available in the Rivers screen in Rivery and will be possible to be selected in other Multi actions as well.
If needed, update the name of the step by entering a new name at the top of the step.
When the step contains some action it will be possible to pass values to its public variables (only if there are configured variables in this action).
All the variables of this action will be visible under the input variables :
Insert any value in those variables. It can be hard coded values or variables of the multi-action or variables of other action in the multi-action (seePass variables between actions in a Multi-Action ).
Insert variables by entering {} in the input.
Leave any value empty in order to run the action with its original variables values.
Click on the Add Action step at the bottom of the screen to add a new step in the Multi-action.
Pass variables between actions in a Multi-Action
The most common usage of Multi actions in Rivery is passing variables between actions that are being run in the Multi-Action.
In order to pass variables between actions the Multi-action has to include:
An action that returns variables. Such an action should be a REST Action with results type that is variables.
- Any variable that is being returned from a REST Action inside a Multi-action will be added automatically to the variables list of the Multi actions
An Action that is using variables. Such action should have variables which are not private , so those variables will be visible in the Multi-Action.
Follow the next instructions in order to pass a variable between actions in a multi-action:
Select or create an action in a step in the Multi-action.
That action must have results type variables and configured variables to return.
After selecting that Action, the step that contains that action will have output variables:
In that example, we created an action that connects to Facebook API and creates a report.
That action returns a variable called “report_id”, to be used in the next actions of the multi-action.
- This output variable “report_id” is being automatically added to the variables list of the multi-action. That variable has a prefix of the name of the step of its action in that multi-action. In the example above, the name of the variable will be “Action_Step_1.report_id” .
- Select or create another action in the multi-action that need to use that report_id variable. In order to be able to pass a variable to action, this action needs to have a configured variable in its variables list, which is not private.
When an action inside a multi-action has public variables, the step that contains that action will have input variables :
- In our example, we added a new step of an action that sends requests to Facebook API and checks the status of the given report_id that was created in the previous step.
That action needs to receive that report_id from the first step of the multi-action.
The action has a variable called “report_id” that was configured inside that Action. When clicking on the “input variables” of the step, all the public variables of that action will be visible:
Any variable that has a value in that action will present its value (unless it’s a password).
In that example, we didn’t insert a value to the report_id variable in the action, so it shows an empty value.
In order to pass a value to the variable, all we have to do is simply insert any value in the value input of that variable. That value can be a hardcoded value or a variable. In that example we passed the variable {action_step_1.report_id} to the report_id variable of the action.
When the multi action will run, it will populate the variable Action_Step_1.report_id with a value during the run of the first action, and then will pass this value to this action.
Test the Multi-Action
When the Multi-action is ready, it is recommended to test it before saving it and using it in other rivers in Rivery.
In order to test the Multi-action, click on the Test Multi-Action on the right side of the multi-action:
When testing the multi-action, it will run the multi-action in the same way it will run when executing it using the button “save and run” or from outside the multi-action (from a REST River).
When the Multi-Action runs, each step that is currently running will have a moving green light.
If the step succeeded its color will turn to green.
If the step failed its color will turn to red.
The multi action stops running in case that any of its steps failed.
In both cases, it is possible to see the results/error of the action by clicking on the button in the top-left corner of the step in the multi-action.
In the next example, the first step did succeed and the second step failed:
When we click on the button in the top-right corne r of Action_Step_1 we see the results of this step. The results contain the variable that this action returns:
When we click on the button in the top-right corner of Action_Step_2 (Failed) we see the error that this action received when trying to run:
This error indicates that the Action runs without a valid value in the report_id variable, and it was sent empty to the Facebook API.
Running Multi-Action
After successful testing, the multi-action is ready to be executed.
The multi-action can be executed by itself- using the Run button or using the scheduling , or by a REST River.
When running the Multi-Action using the Run button, it will run exactly like in the testing.
Every successful step will turn to green and if some step failed, the process will stop and this step will turn to red.
After the Multi-action runs it is possible the results of each step by clicking on the top-right button of the step. In addition, the summary of the results of the actions in the multi-action can be presented by clicking on the button “show action results”:
The summary of the results of this multi-action will be:
In Action step 1 we see the returned variable of the action.
In Action step 2 we see the response of the action.
In Action step 4 we see the sample of the data of the action (as this action returns data. When running inside a multi-action this kind of action returns the only sample).
Video
Here's a video demonstrating the concept of Multi Action along with an explanation of how it works in Rivery.