Every logic river is defined from basic array of steps and block of variables.
* steps block is an array that include the step definitions per each step/container in the logic.
* variables block is an object that define the river variables of the logic.
12345678
properties:steps:# The "steps" block which includes all steps # (below for each step, based on step type)-<step block 1>-<step block 2>variables:# Logic variables<variable block>
Steps:
The steps block which includes all steps (below for each step, based on step type) to run in the river.
Every step type has it's own required and definitions, in addition to the basic step definition every step in the yaml has.
Basic step definition
Every step in rivery has a basic implementation as that:
12345678
steps:-type:step|container# the type of the step - "step" or "container", every type has its own definitionisEnabled:true|false.# Step is enabled or not.step_name:Step Namestep_type:sql|action|river|container<step block> |<container block>
SQL Step
SQL Step provides you the option to run query into table, variable and external file.
steps:-type:stepblock_primary_type:sqlblock_db_type:snowflake|big_query_sql|redshift|rds_pg# The step target type - Snowflake / BigQuery etc.block_type:same as block db typetarget_type:table|file_export|variable# Where to store the results of the SQL query# Source section# =================connection_id:5aa5387b5674093f6a98c600# The connection id that is connected to this step.# In order to get the connection id, you can use Rivery API or `rivery connections` command lineexecute_sql_command:true|false# Use SQL Script or not in the step?query_priority:interactive# For DWH Support (BQ interactive)sql_query:"SELECT*FROMTABLE..."|!sql: <relative sql path under the sql directory># The actual SQL query. The SQL can be inline or using !sql key to a specific SQL file.# e.g. `sql_query`: !sql: file_path.sql (under the SQL directory in the root directory of the project) # Target section:# ==================## ** Table **database:MY_DB# The target database name to send the data toschema_id:MY_SCHEMA# In compatible targets (like Snowflake) -drop_after:true|false# Should the step drop the table after the river endstarget_table:MY_TABLE# The target table to load intotarget_loading:merge|overwrite|append# The loading methodmerge_method:switch_tables|delete_insert|merge# The merge method to use in compatible targets (Snowflake, Postgres). split_tables:true|false# Splitting table to table partitions, in BQ legacy mode.split_interval:d|d_h|d_h_m# Splitting interval for table partitions, in BQ Legacy mode only.use_standard_sql:true|false# In BQ only, use standard/legacy SQLfields:# The column mapping. This is optional if there are no keys. # User can either have the fields inline or !map to a table represented as yaml.-fieldName:impressions# The field nameisKey:true|false# Is this field a keylength:0...2456432# The field length (if supported)type:VARCHAR|TIMESTAMP|INTEGER...# The field typealias:impressionsnew# The target field nameexpression:current_timestamp()# The target field expressionfields:# In case of object field type, there's a need to define the fields under it.-<fields object>| !map:<relative map path under the mapping directory>## ** File Export **bucket_name:MY_BUCKET# The bucket/container namecompression:gzip# Does the file in the bucket is compressed or not?fzConnection:5aa5387b5674093f6a98c600# The filezone connection, if needed (like in custom file zone definition in the source connection)file_path_destination:PATH/TO/FILE# The file path destination to put the results onfile_type:json|csv# File type - json/csvcsv_details:# In a case of CSV file type, provide the csv definitionheader:true|false# Should we add an header to the csvdelimiter:,# delimiter of the csv, default=,quote:\"# the quote char in the csv, default="## ** Variable **variable_name:Target variable name# variable name to send the result into
Action Step
Logic can run an action step, provide and gets variable data from and to the step.
1 2 3 4 5 6 7 8 9101112131415161718192021
steps:-type:stepblock_primary_type:actionblock_type:actionaction_id:5ddbfae556740961a97f6f37# The action cross id to run in the logic step.# You can get the action id using the river url, and by the API,# or as a reference from another action river entity.connection_oid:5aa5387b5674093f6a98c600# The connection id the action will run withaction_vars:# An object with the action variables to pass/get from the action, using variable mapping of key-valaction_variables:# variables to pass/return to the actionkey:valconnection_details:# The connection variables to pass inkey:valinterval_params:# The interval parameters to pass inkey:val
River Step
Logic can run a river inside a step
123456
steps:-type:stepblock_primary_type:riverblock_type:riverriver_id:5ddbfae556740961a97f6f37# The river id to run under the step.
Container
Steps can also be set as container type, which means they include other steps (or containers, for example).
1 2 3 4 5 6 7 8 9101112131415161718192021
steps:-type:containerstep_name:Container Namecontainer_running:run_once|for_loop|condition# How the container is running.# run_once = run the container on time# for_loop = run the container with for <> set in <> loop# condition = make a condition containerisEnabled:true|false# does the container enabledisParallel:true|false# Should steps inside this container run in parallelloop_over_value:all_rows_var# For loop over only:the "first" partloop_over_variable_name:one_row_var# For loop over only:the "set in" partsteps:-<step 1 block>-<step 2 block>-<container 1 block>...
Condition
Condition is a specific type of container, which create a specific run of specific step/containers by condition flow / else flow...
In condition container, the "setting" of each step for each condition will be added to the step itself.
Condition Definition
123456789
condition:condition_name:Condition 1condition_then:run_step | stop | failed | passkey:'{myvar}'# The condition key in the equationoperator:equals | greater_than | lower_than | exists ...# The "equalilty" sign...val:my_val# The value for equals to
Condition example
1 2 3 4 5 6 7 8 9101112131415161718192021
steps:type:containerstep_name:Container Namecontainer_running:run_once|for_loop|condition# How the container is running.# run_once = run the container on time# for_loop = run the container with for <> set in <> loop# condition = make a condition containerisEnabled:true|false# does the container enabledisParallel:true|falsesteps:-block_primary_type:riverblock_type:rivercondition:condition_name:Condition 1condition_then:run_stepkey:'{myvar}'operator:equalsval:my_val-....
Variables
Variables are setting up in the logic river as the local variable of the specific river.
1234567
variables:variable_name:# Variable nameclear_value_on_start:true | false# Should the value be cleared on the startvalue:variable_value# The variable value