Run steps one by one, if any of steps fail - chain of execution will stop on it.
Note: parameters for each action will be cloned. Meaning each action will start its own branch unless shareParameters option is used.
ID:com.fireblink.fbl.flow.sequence
Aliases:
fbl.flow.sequence
flow.sequence
sequence
sync
--
Example 1: Base Declaration
# Run actions in a sequence'--': - ctx:'.':inline:something:true - ctx:fromFile:files: - test.yml
Example 2: Detailed Declaration
# Run actions in a sequence'--':# [optional] whether to share parameters between actions instead of making a clone.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] list of actions to invoke in a sequenceactions: - ctx:'.':inline:something:true - ctx:fromFile:files: - test.yml
Warning:shareParameters usage is considered an anti-pattern
Action Handler: Parallel steps execution
Run all steps in parallel. If any of steps will fail - it will not affect others. However parallel step itself will be marked as failed.
ID:com.fireblink.fbl.flow.parallel
Aliases:
fbl.flow.parallel
flow.parallel
parallel
async
||
Example 1: Base syntax
# Run steps in parallel'||': - ctx:'.':inline:something:true - ctx:fromFile:files: - test.yml
Example 2: Alternative syntax
'||':# [optional] whether to share parameters between actions instead of making a clone.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] actions to invoke in parallelactions: - ctx:'.':inline:something:true - ctx:fromFile:files: - test.yml
Action Handler: Attached flow
Allows to reference external flow by its pass. Helps to logically split big flows for better organized structure.
ID:com.fireblink.fbl.flow.attachment
Aliases:
fbl.flow.attachment
flow.attachment
attachment
@
Example 1: Specify flow file
# Run steps from external flow file or package (*.tar.gz)'@':flow.yml
Example 2: Specify directory
# Run steps from external flow file (index.yml) inside "flow" directory# Note: slash in the end of path is not required'@':flow/
Example 3: Specify url to download a package
# Run steps from external flow file (index.yml) inside "flow" directory# Note: slash in the end of path is not required'@':http://some.host/flow.tar.gz
Example 4: Specify target inside the package
'@':# [required] path or url to download the packagepath:flow.tar.gz# [optional] specify custom flow entry file name inside the packagetarget:custom.yml
Example 5: Custom HTTP headers
'@':# [required] path or url to download the packagepath:http://some.host/flow.tar.gz# [optional] specify custom flow entry file name inside the packagetarget:custom.yml# [optional] http parametershttp:# [optional] custom http headersheaders:Authorization:Basic YWRtaW46YWRtaW4=# [optional] cache downloaded package inside $FBL_HOME/cache foldercache:true
Action Handler: Repeat flow
Repeat action multiple times.
ID:com.fireblink.fbl.flow.repeat
Aliases:
fbl.flow.repeat
flow.repeat
repeat
Example:
repeat:# [optional] whether to share parameters between actions instead of making a clone.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] number of iterationstimes:2# [optional] whether each iteration should wait previous to complete or run in parallel# Default value: falseasync:false# [required] action to runaction:# run flow_0.yml and flow_1.yml flows @:flow_<%- iteration.index %>.yml
Action Handler: Retry flow
Retry action multiple times till it passes or reach max failure attempts.
ID:com.fireblink.fbl.flow.retry
Aliases:
fbl.flow.retry
flow.retry
retry
Example:
retry:# [required] number of attempts to run the actionattempts:2# [required] action to runaction:sleep:1# [optional] allows to record last error code from last failed attempt# Note: will only be executed if all attempts are failederrorCode:# [optional] assign error code to context field# Follows common assignment logic practicies https://fbl.fireblink.com/plugins/common#assign-toassignTo:'$.ctx.errorCode'# [optional] push error code to context field# Follows common push logic practicies https://fbl.fireblink.com/plugins/common#push-topushTo:'$.ctx.errorCode'
Action Handler: For Each
Allows to execute action for every item in the array or key of an object.
ID:com.fireblink.fbl.flow.foreach
Aliases:
fbl.flow.foreach
flow.foreach
foreach
each
Example: Array
each:# [optional] whether to share parameters between actions instead of making a clone of parameters.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] array to iterate overof: [1,2,3]# [required] action to invoke on every iterationaction:ctx:test_<%- iteration.index %>:# assign 1,2,3 to test_0, test_1, test_3inline:$ref:iteration.value
Example: Object
each:# [optional] whether to share parameters between actions instead of making a clone of parameters.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] object to iterate overof:a:1b:2# [required] action to invoke for each iterationaction:ctx:test_<%- iteration.index %>:# assign 1a to test_0 and b2 to test_1 valuesinline:<%- iteration.value %><%- iteration.name %>
Action Handler: Switch flow
Allows to run action based on some condition
ID:com.fireblink.fbl.flow.switch
Aliases:
fbl.flow.switch
flow.switch
switch
if
?
Example:
'?':# [required] value to checkvalue:<% ctx.test %># [requied] actions to run on specific valueis:# execute "foo.yml" if "foo"foo: @:foo.yml# execute "bar.yml" if "bar"bar: @:bar.yml# [optional] if no match found "else" handler will get executedelse: @:else.yml
Action Handler: While
Runs action till condition is successful or not (based on configuration).
ID:com.fireblink.fbl.flow.while
Aliases:
fbl.flow.while
flow.while
while
Example: Positive condition check
while:# [optional] whether to share parameters between actions instead of making a clone of parameters.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] value to checkvalue:<%- ctx.something %># [required] if value IS equal to provided one - action will get executedis:true# [required] action to runaction:'@':something.yml
Example: Negative condition check
while:# [optional] whether to share parameters between actions instead of making a clone of parameters.# Default value: false, e.g. make cloned parameters for each action in a sequence.shareParameters:false# [required] value to checkvalue:<%- ctx.something %># [required] if value IS NOT equal to provided one - action will get executednot:true# [required] action to runaction:'@':something.yml
Action Handler: Sleep
Sleep for a given amount of seconds.
ID:com.fireblink.fbl.flow.sleep
Aliases:
fbl.flow.sleep
flow.sleep
sleep
Example:
# sleep for a minutesleep:60
Action Handler: Try - Catch - Finally Flow
Allows to run sub-step in isolation causing its failure to be ignored by parent step. Optionally catch and finally steps can be invoked.
If catch or finally step block will be failed - this step will also be marked as failed even try block passes successfully.
ID:com.fireblink.fbl.flow.try
Aliases:
fbl.flow.try
flow.try
try
Example:
try:# [required] action to runaction: @:foo.yml# [optional] call error.yml if foo.yml failedcatch: @:error.yml# [optional] error code assignment, can be used to better handle error processing inside catch/final actionserrorCode:# [optional] assign error code to context field# Follows common assignment logic practicies https://fbl.fireblink.com/plugins/common#assign-toassignTo:'$.ctx.errorCode'# [optional] push error code to context field# Follows common push logic practicies https://fbl.fireblink.com/plugins/common#push-topushTo:'$.ctx.errorCode'# [optional] call cleanup.yml either after successful execution of foo.yml or error.ymlfinally: @:cleanup.yml
Action Handler: Template
Run action based on dynamically constructed template. This is handy as you generally can not dynamically construct YAML with EJS template inside most of the actions.
Allows to create virtual action handler for another action (that can be represented as one of the flows).
ID:com.fireblink.fbl.flow.virtual
Aliases:
fbl.flow.virtual
flow.virtual
virtual
Example:
virtual:# [required] virtual handler IDid:handler.id# [optional] aliases for the handler to referencealiases: - handler.alias# [optional] JSON Schema of options that can/should be passed to the generated handlerparametersSchema:type:objectproperties:test:type:string# [optional] default parameters and merge function# Note: if no mergeFunction or modifiers is provided defaults with parameters will be deeply merged.# Upon merge arrays will be concatenated.defaults:# [required] default valuesvalues:test:yes# [optional] merge modification functions for given paths# This is a recommended way of overriding merge behaviour.# Use "mergeFunction" only when you need to do something really unique.# "parameters" - represents field state by given path# "defaults" - its default value if anymodifiers:$.test:|- return parameters + defaults# [optional] custom merge function# Use it only when "modifiers" functionality isn't enough# "parameters" - represents provided parameters# "defaults" - defaults by itselfmergeFunction:|- return parameters.test + defaults.test# [optional] Change working directory location based on the place of virtual execution# instead of declaration.## By default all relative paths are resolved based on the place where virtual action is declared.# If you need to change the behavior - set this property to "true".## Parameters:# $.parameters.wd - will be dynamically set to either working directory where virtual# is declared or place where it will be invoked.## $.parameters.pwd - always points to the working directory where virtual was declared.dynamicWorkDir:true# [required] action to invokeaction:ctx:some_field:# Note: you may use "parameters" to reference passed options to the virtual handler# These options are first pre-validated with provided validationSchema (if any)inline:<%- parameters.test %>
Then you can reference your generated handler like any other:
handler.id:test:some_field_value
Action Handler: Invoke
Allows to execute action passed as parameter. Can be used in pair with virtual to pass flow actions as parameters and create reach execution flow patterns.
ID:com.fireblink.fbl.flow.invoke
Aliases:
fbl.flow.invoke
flow.invoke
invoke
Example:
# Invoke action described in parameters `action` fieldinvoke:$ref:parameters.action
Action Handler: Error
Throw error upon execution with given message.
ID:com.fireblink.fbl.flow.error
Aliases:
fbl.flow.error
flow.error
error
Example:
error:'message'
Action Handler: Echo
Print message to console
ID:com.fireblink.fbl.flow.echo
Aliases:
fbl.flow.echo
flow.echo
echo
Example:
echo:'message'
Action Handler: Void
Action handler that does nothing. Main usecase to bypass limitations of other action handlers that require action handler to be provided as an option, but you might not want to do that for some reason.