The following workflow is called "CRM - Case - Inform Contact" and is by default shipped in Aire Hub. It's a short workflow with 1 trigger and 6 steps.
Generic description:
The workflow is triggered manually via a button on the record page of a case item in the CRM. When clicked it's first checked if it's closed or not and if there is an email address to send the email to. If all is ok, it continues to prepare the email, it sends it and it shows a notification that the case info has been sent.
Detailed description:
The trigger
The trigger -> Configuration
The resource of the trigger is "Compose Record" - a record in the app - and the selected event is "onManual". So, the button that triggers this event can only be placed on a record page, because it needs the record ID to set the initial scope.
The trigger -> Constraints
We want this button to only be placed in the "Case" module in the "crm" namespace. So, constraints are added.
The trigger -> Initial Scope
The initial scope is a set of variables that the workflow has access to at the start of the workflow. During the workflow the values can be accessed.
The available variables in the initial scope for a record is:
record
All the data of the record as shown on the screen. So, before saving the record, values inserted by the user are already accessible.oldRecord
All the data of the record before it was edited by the user. This means, the data of the record in the database before any changes made by the user or a workflow. It's particularly useful when comparing new values to old values.module
The module of the record. This variable allows you to retrieve data from the module. However, a more common use case it to use it as a reference within function block, because instead of writing the module name in a function block (when required) you can just use this variable.namespace
Similar to the module variable, it allows you to get namespace info. But, it's more commonly used as a variable for some function blocks.recordValueErrors
The list of errors upon saving the record.selected
If the record is selected on a record list and the workflow is triggered thanks to that list, the selected variable is true. By default, it's false.