Runnerty provides a bunch of different values that can be used in the whole plan of our chains by using the
@GV/@GETVALUE function. They can be global or local values. Runnerty will automatically replace this variables with it's value. They are very useful to store params, save output values from the processes, making processes evaluations, etc...
These values are called
global because they are automatically provided by Runnerty or defined in the config. Thereby, they can be used in the plan.
These values allows you to get environment variables.
config.json file it is possible to define our owns values to use them in our chains. This is an example of the
config.json file with some values definitions:
They are called local because these values come from different parts of the plan. They take their values from different Runnerty changeable sources such as the processes or chains information.
Theses values are formed with the process information and configuration. For example, these two values takes it's value from the metadata of the process:
|CHAIN_ID||Contains the process chain id|
|CHAIN_NAME||Contains the process chain name|
|CHAIN_STARTED_AT||Contains the date and time when the process chain started|
|PROCESS_ID||Contains the process id|
|PROCESS_NAME||Contains the process name|
This is an example of a process using the time and process values to write in a log file:
These are the rest of the values that takes information from the process execution. Once again, they can be used in the whole plan:
|PROCESS_EXEC_ID||Contains the execution id|
|PROCESS_EXEC_COMMAND||Contains the command that is going to be executed by the executor|
|PROCESS_EXEC_COMMAND_EXECUTED||Contains the command executed by the executor (once all the values have been translated)|
|PROCESS_EXEC_MSG_OUTPUT||Contains the output message of the executor|
|PROCESS_EXEC_DATA_OUTPUT||Contains the data output of the executor|
|PROCESS_EXEC_ERR_OUTPUT||Contains the error returned by the executor|
|PROCESS_STARTED_AT||Contains the date and time when the process started|
|PROCESS_ENDED_AT||Contains the date and time when the process ended|
|PROCESS_DURATION_SECONDS||Contains the duration in seconds (when is end).|
|PROCESS_DURATION_HUMANIZED||Contains the humanized duration (when is end).|
|PROCESS_RETRIES_COUNT||Contains the times that the process have been retried|
In this example we can see a process that in the notification use some of the process values to send useful information:
The output_share is a property of the process. This feature allows to share information returned by the process so it is available in the rest of the chain.
In this example we are getting the email of an user from the database using the
@runnerty/executor_mysql and assigning it to a value. This way we can use the
@GV(USER_EMAIL) value anywhere of the chain.
Notice that in this example we are are using the value
@GV(PROCESS_EXEC_DB_FIRSTROW_EMAIL) This is an extra value returned by this executor that contains the field selected by the query.
Just like the process values, there are also some values formed with the chain information:
|CHAIN_ID||Contains the ID of the chain|
|CHAIN_NAME||Contains the name of the chain|
|CHAIN_QUEUE||Contains the queue of the chain|
|CHAIN_STARTED_AT||Contains the date and time when the chain started|
|CHAIN_DURATION_SECONDS||Contains the duration in seconds (when is end).|
|CHAIN_DURATION_HUMANIZED||Contains the humanized duration (when is end).|
This values can be defined in our chains and can be used in the whole plan of the chain. This is also very useful when you want to overwrite a value defined in the
Notice that this values can be also past from the API.
This values cames from the output of an iterable chain. An iterable chain is an awesome feature of runnerty that allows you to be execute a chain for each object in the array previously returned by another chain.
You can know for more information about iterable chains in the chains here.
In this example we can see how the chain is receiving two input fields and the process is using their values to send an email.
As the executors are plugins for Runnerty, it is possible that some of them need to return additional information to Runnerty. For this task Runnerty provides the
EXTRA_OUTPUT values that can be used by the executors. Know more about this in the executors development documentation.