Skip to content

Toro Cloud Dev Center


Setting inputs for your Event Based Workflow

Event Based Workflow inputs are set through the Input side of the Input/Output view. To add an input property to your Event Based Workflow service:

Setting Event Based Workflow service inputs

Setting Event Based Workflow service inputs

  1. Go to the Input/Output view.
  2. While on the Input side, click the add button and select the type of input you want to add.
  3. Set input name to anything you like.

To use the input in one of your Event Based Workflow states, select a state. Under the Mapper view, create a mapping from the service input to a state input or create a set expression for the state input and use the service input in the expression.

Mapping service input to state input

Mapping service input to state input

To test, run the workflow. By default, you will be asked to provide values for the input of your service. Type anything you like and then proceed to running the service.

Running Event Based Workflow with inputs

Running Event Based Workflow with inputs

With that, you could provide data to kick off your workflow. These inputs could be anything from simple strings to data models. The data here becomes available to all states. But most times however, your states will be doing something more useful than just printing out a message to the console. Each state would have inputs to work with and outputs to pass around and make decisions from.

Injectable input properties

When a service is made invokable via HTTP or used in a Martini endpoint, additional input variables can be injected for further use. All you need to do is declare the input variables needed by your service and ensure they are named accordingly. Martini won't inject arguments for parameters which do not follow expected parameter names.

Example injectable input variables are:

There are multiple other injectable input properties. In Event Based Workflow, they include arguments that can be injected to services called by Martini endpoints, listed and described in every endpoint type's respective page.

Injecting input properties

To inject an argument in Event Based Workflow, you must declare the variable under the Input/Output view. You can use the designated hotkeys or do a right click, pick a type, and then rename the variable. In Gloop and Event Based Workflow, the names of injectable arguments must be prepended by the $ character. From there, you can use the parameter by passing data between states.