Multi Actions
  • 9 Minutes to read
  • Dark
    Light
  • PDF

Multi Actions

  • Dark
    Light
  • PDF

What Are Multi Actions?

Multi-Actions are rivers that consist of multiple Actions.

The Multi-Action runs the actions in the order they appear in the flow and can pass variables between actions.

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

Click on Create New River from any screen in Rivery and select the Action option.
image.png

An action in Rivery can be Multi-Action or REST Action .
image.png

Multi-action is an action which is composed of multiple actions and allows to run a process of actions in Rivery.

Click on Rest Action in order to proceed to the REST Action screen.

Multi-Action Screen

image.png

  • The steps of the multi-action - each step is an action that will be executed during the multi-action process. It is possible to select an existed action in the step or create a new action inside that step.

  • Custom Connection is the place to define the connection of the action. This connection can be reused over time and crossed rivers. All the details of the selected custom connection will be added to the variables of the action. Click here to read more about custom connection.

  • Variables section is the place to define the variables of the Action. Those variables can be used in any action inputs of the steps in the multi-action. Click here to read more about variables.

  • Time Period is the place to define the time range of the rest action. Select the type of the dates (datetime or date ), and select the time format which is required for this request.

Rest Action custom connection

Create or select an existed custom connection.  It is possible to leave the connection empty in case it is not required.

Multi-Action Variables

The variables of the Rest action are available in the button on the right side of the river:
image.png

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:

  1. All the variables that were manually added to the list,

  2. Any variables that are returned from Actions inside that Multi-action. Those variables

  3. The start date and end date that were selected in the Time Period of the Multi-Action

  4. 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.

image.png

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:
    image.png

  • 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 :

image.png

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:
image.png

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 :
Multi Actions-mceclip6

  • 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:

Multi Actions-mceclip10

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.

Multi Actions-mceclip10

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:
Multi Actions-mceclip12

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:

Multi Actions-mceclip13

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:

Multi Actions-mceclip14

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:

Multi Actions-mceclip16

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”:

Multi Actions-mceclip18

The summary of the results of this multi-action will be:

Multi Actions-mceclip19

  • 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).


Was this article helpful?