Skip to main content
Version: 6 - Palatschinke

Wrapper bundle

The Wrapper bundle contains several useful wrappers.

Please refer to Wrappers for details on how wrappers work within Cloudomation.

Download

Download the bundle here (right click and select "Save link as...").

Please refer to Importing records for documenation on how to import a bundle to your Cloudomation workspace.

Included example wrappers

Retry

The retry wrapper can be used for executions which sometimes fail due to external factors. When used without additional configuration it will start the child execution up to three times with a 10 second delay in between tries.

Parameters

ParameterDescriptionDefault value
max_triesThe number of times to try starting the child before failing.3
delay_secThe number of seconds to wait in between retries.10
timeout_secFail, if the child did not succeed within the timeout. Set to 0 to disable.0
archive_retriesArchive failed retries.True

Notify

The notify wrapper observes a child execution and generates notifications on end.

Parameters

ParameterDescriptionDefault value
notify_on_successIf a notification should be generated when the child ends with ENDED_SUCCESS.False
notify_on_errorIf a notification should be generated when the child ends with ENDED_ERROR or ENDED_CANCELLED.True
toA list of Cloudomation user names who will receive notifications.None
subjectThe subject line of the email.{child_name} {child_status}
bodyThe email body.<p>Execution <a href="{self_url}/execution/{child_id}">{child_name}</a> ended with status <strong>{child_status}</strong></p><pre>{child_message}</pre>

The following substitutions are performed on the subject and body parameters

PlaceholderDescription
{child_name}The name of the child execution.
{child_id}The ID of the child execution.
{child_status}The end status of the child execution.
{child_message}The end message of the child execution.
{self_url}The URL to the workspace where the execution was running.

Timeout

The timeout wrapper starts a child execution and waits for it to end within a timeout. If the timeout is exceeded, the child execution and all descendants are cancelled.

Parameters

ParameterDescriptionDefault value
secondsThe number of seconds before a timeout occurs.60

Interactive

The interactive wrapper observes a child execution and, in case of an error, allows an operator to decide if to retry, ignore the error or fail.

Parameters

ParameterDescriptionDefault value
interactive_limit_minutesAfter how many minutes of inactivity a Cloudomation user is considered "away".30
archive_retriesArchive failed retries.True

Check

The check wrapper can be used to verify if a child execution succeeded by analyzing the output_value of the child execution.

Parameters

ParameterDescriptionDefault value
checker_flowThe name of a flow which performs the validation of the child's output_value.None
checker_scriptA flow script which performs the validation of the child's output_value.None
checkerAn alias for checker_script.None
inputsAdditional inputs passed to the checker flow or script.None

Mock

The mock wrapper can be used to return an output_value without running the child.

Parameters

ParameterDescriptionDefault value
modeOne of ENDED_SUCCESS, ENDED_ERROR, LAST, STATIC, or FIXED.ENDED_SUCCESS
ignore_in_productive_modeWhen set and run in productive mode, the child will not be mocked but started normally.True
output_valueThe output_value to return. Required for mode STATIC.None
execution_idThe ID of the execution of which the output_value to return. Required for mode FIXED.None

Modes

ENDED_SUCCESS

Looks for the last successful execution of the child and returns its output_value.

ENDED_ERROR

Looks for the last failed execution of the child and returns its output_value.

LAST

Looks for the last execution of the child and returns its output_value.

STATIC

Returns the output_value which is configured in the output_value parameter of the wrapper.

FIXED

Returns the output_value of the execution which is specified using the execution_id parameter of the wrapper.

Cache

The cache wrapper caches the output_value of a child execution for a defined time. Multiple calls to the same child execution within the timeframe will return the same output_value without actually calling the external system.

Parameters

ParameterDescriptionDefault value
max_age_minutesHow many minutes a previously fetched output_value remains valid before re-fetching it.60

Validate

The validate wrapper can be used to validate the input_value or output_value of the child against a json schema or to create/extend a json schema based on the input_value or output_value.

Parameters

ParameterDescriptionDefault value
schema_nameThe name of the json schema that should be used for the wrapper.None
modeOne of complain, learn.complain
point_of_validationOne of input, output. Controls whether the input_value or output_value of the child is used by the wrapper.input

Modes

complain

Validates the input_value or output_value of the child against a json schema and raises a SchemaValidationError on failed validation.

learn

Creates a json schema from the input_value or output_value of the child. If flow_api.schema.Schema(<schema_name>) exists it gets updated so that it accommodates its old schema and the newly learned schema. Otherwise flow_api.schema.Schema(<schema_name>) is created with the newly learned schema.

Rollback

The rollback wrapper can be used to execute a rollback flow if the original flow fails. In this case the wrapper passes the id, status and message of the original flow to the rollback flow. Finally, the wrapper raises the DependencyFailedError of the original flow.

Parameters

ParameterDescriptionDefault value
rollback_flow_nameThe name of the flow that should be executed in case of a DependencyFailedError.None

Learn More

Wrappers
Import / Export and Upload